linux/fs/hfs/inode.c

/*
 *  linux/fs/hfs/inode.c
 *
 * Copyright (C) 1995-1997  Paul H. Hargrove
 * (C) 2003 Ardis Technologies <[email protected]>
 * This file may be distributed under the terms of the GNU General Public License.
 *
 * This file contains inode-related functions which do not depend on
 * which scheme is being used to represent forks.
 *
 * Based on the minix file system code, (C) 1991, 1992 by Linus Torvalds
 */

#include <linux/pagemap.h>
#include <linux/mpage.h>
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/uio.h>
#include <linux/xattr.h>
#include <linux/blkdev.h>

#include "hfs_fs.h"
#include "btree.h"

static const struct file_operations hfs_file_operations;
static const struct inode_operations hfs_file_inode_operations;

/*================ Variable-like macros ================*/

#define HFS_VALID_MODE_BITS

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

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

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

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

static bool hfs_release_folio(struct folio *folio, gfp_t mask)
{}

static ssize_t hfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
{}

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

const struct address_space_operations hfs_btree_aops =;

const struct address_space_operations hfs_aops =;

/*
 * hfs_new_inode
 */
struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t mode)
{}

void hfs_delete_inode(struct inode *inode)
{}

void hfs_inode_read_fork(struct inode *inode, struct hfs_extent *ext,
			 __be32 __log_size, __be32 phys_size, u32 clump_size)
{}

struct hfs_iget_data {};

static int hfs_test_inode(struct inode *inode, void *data)
{}

/*
 * hfs_read_inode
 */
static int hfs_read_inode(struct inode *inode, void *data)
{}

/*
 * __hfs_iget()
 *
 * Given the MDB for a HFS filesystem, a 'key' and an 'entry' in
 * the catalog B-tree and the 'type' of the desired file return the
 * inode for that file/directory or NULL.  Note that 'type' indicates
 * whether we want the actual file or directory, or the corresponding
 * metadata (AppleDouble header file or CAP metadata file).
 */
struct inode *hfs_iget(struct super_block *sb, struct hfs_cat_key *key, hfs_cat_rec *rec)
{}

void hfs_inode_write_fork(struct inode *inode, struct hfs_extent *ext,
			  __be32 *log_size, __be32 *phys_size)
{}

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

static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
				      unsigned int flags)
{}

void hfs_evict_inode(struct inode *inode)
{}

static int hfs_file_open(struct inode *inode, struct file *file)
{}

static int hfs_file_release(struct inode *inode, struct file *file)
{}

/*
 * hfs_notify_change()
 *
 * Based very closely on fs/msdos/inode.c by Werner Almesberger
 *
 * This is the notify_change() field in the super_operations structure
 * for HFS file systems.  The purpose is to take that changes made to
 * an inode and apply then in a filesystem-dependent manner.  In this
 * case the process has a few of tasks to do:
 *  1) prevent changes to the i_uid and i_gid fields.
 *  2) map file permissions to the closest allowable permissions
 *  3) Since multiple Linux files can share the same on-disk inode under
 *     HFS (for instance the data and resource forks of a file) a change
 *     to permissions must be applied to all other in-core inodes which
 *     correspond to the same HFS file.
 */

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

static int hfs_file_fsync(struct file *filp, loff_t start, loff_t end,
			  int datasync)
{}

static const struct file_operations hfs_file_operations =;

static const struct inode_operations hfs_file_inode_operations =;