linux/fs/ufs/inode.c

// SPDX-License-Identifier: GPL-2.0
/*
 *  linux/fs/ufs/inode.c
 *
 * Copyright (C) 1998
 * Daniel Pirkl <[email protected]>
 * Charles University, Faculty of Mathematics and Physics
 *
 *  from
 *
 *  linux/fs/ext2/inode.c
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card ([email protected])
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 *
 *  from
 *
 *  linux/fs/minix/inode.c
 *
 *  Copyright (C) 1991, 1992  Linus Torvalds
 *
 *  Goal-directed block allocation by Stephen Tweedie ([email protected]), 1993
 *  Big-endian to little-endian byte-swapping/bitmaps by
 *        David S. Miller ([email protected]), 1995
 */

#include <linux/uaccess.h>

#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/time.h>
#include <linux/stat.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/buffer_head.h>
#include <linux/mpage.h>
#include <linux/writeback.h>
#include <linux/iversion.h>

#include "ufs_fs.h"
#include "ufs.h"
#include "swab.h"
#include "util.h"

static int ufs_block_to_path(struct inode *inode, sector_t i_block, unsigned offsets[4])
{}

Indirect;

static inline int grow_chain32(struct ufs_inode_info *ufsi,
			       struct buffer_head *bh, __fs32 *v,
			       Indirect *from, Indirect *to)
{}

static inline int grow_chain64(struct ufs_inode_info *ufsi,
			       struct buffer_head *bh, __fs64 *v,
			       Indirect *from, Indirect *to)
{}

/*
 * Returns the location of the fragment from
 * the beginning of the filesystem.
 */

static u64 ufs_frag_map(struct inode *inode, unsigned offsets[4], int depth)
{}

/*
 * Unpacking tails: we have a file with partial final block and
 * we had been asked to extend it.  If the fragment being written
 * is within the same block, we need to extend the tail just to cover
 * that fragment.  Otherwise the tail is extended to full block.
 *
 * Note that we might need to create a _new_ tail, but that will
 * be handled elsewhere; this is strictly for resizing old
 * ones.
 */
static bool
ufs_extend_tail(struct inode *inode, u64 writes_to,
		  int *err, struct page *locked_page)
{}

/**
 * ufs_inode_getfrag() - allocate new fragment(s)
 * @inode: pointer to inode
 * @index: number of block pointer within the inode's array.
 * @new_fragment: number of new allocated fragment(s)
 * @err: we set it if something wrong
 * @new: we set it if we allocate new block
 * @locked_page: for ufs_new_fragments()
 */
static u64
ufs_inode_getfrag(struct inode *inode, unsigned index,
		  sector_t new_fragment, int *err,
		  int *new, struct page *locked_page)
{}

/**
 * ufs_inode_getblock() - allocate new block
 * @inode: pointer to inode
 * @ind_block: block number of the indirect block
 * @index: number of pointer within the indirect block
 * @new_fragment: number of new allocated fragment
 *  (block will hold this fragment and also uspi->s_fpb-1)
 * @err: see ufs_inode_getfrag()
 * @new: see ufs_inode_getfrag()
 * @locked_page: see ufs_inode_getfrag()
 */
static u64
ufs_inode_getblock(struct inode *inode, u64 ind_block,
		  unsigned index, sector_t new_fragment, int *err,
		  int *new, struct page *locked_page)
{}

/**
 * ufs_getfrag_block() - `get_block_t' function, interface between UFS and
 * read_folio, writepages and so on
 */

static int ufs_getfrag_block(struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create)
{}

static int ufs_writepages(struct address_space *mapping,
		struct writeback_control *wbc)
{}

static int ufs_read_folio(struct file *file, struct folio *folio)
{}

int ufs_prepare_chunk(struct page *page, loff_t pos, unsigned len)
{}

static void ufs_truncate_blocks(struct inode *);

static void ufs_write_failed(struct address_space *mapping, loff_t to)
{}

static int ufs_write_begin(struct file *file, struct address_space *mapping,
			loff_t pos, unsigned len,
			struct page **pagep, void **fsdata)
{}

static int ufs_write_end(struct file *file, struct address_space *mapping,
			loff_t pos, unsigned len, unsigned copied,
			struct page *page, void *fsdata)
{}

static sector_t ufs_bmap(struct address_space *mapping, sector_t block)
{}

const struct address_space_operations ufs_aops =;

static void ufs_set_inode_ops(struct inode *inode)
{}

static int ufs1_read_inode(struct inode *inode, struct ufs_inode *ufs_inode)
{}

static int ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode)
{}

struct inode *ufs_iget(struct super_block *sb, unsigned long ino)
{}

static void ufs1_update_inode(struct inode *inode, struct ufs_inode *ufs_inode)
{}

static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode)
{}

static int ufs_update_inode(struct inode * inode, int do_sync)
{}

int ufs_write_inode(struct inode *inode, struct writeback_control *wbc)
{}

int ufs_sync_inode (struct inode *inode)
{}

void ufs_evict_inode(struct inode * inode)
{}

struct to_free {};

static inline void free_data(struct to_free *ctx, u64 from, unsigned count)
{}

#define DIRECT_FRAGMENT

static void ufs_trunc_direct(struct inode *inode)
{}

static void free_full_branch(struct inode *inode, u64 ind_block, int depth)
{}

static void free_branch_tail(struct inode *inode, unsigned from, struct ufs_buffer_head *ubh, int depth)
{}

static int ufs_alloc_lastblock(struct inode *inode, loff_t size)
{}

static void ufs_truncate_blocks(struct inode *inode)
{}

static int ufs_truncate(struct inode *inode, loff_t size)
{}

int ufs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
		struct iattr *attr)
{}

const struct inode_operations ufs_file_inode_operations =;