From 8624512aa908741ba2795200133eae0d7f4557ea Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 2 Mar 2000 02:36:47 +0000 Subject: Merge with 2.3.48. --- fs/hpfs/dir.c | 5 ----- fs/hpfs/hpfs_fn.h | 1 - fs/hpfs/inode.c | 57 +++++++++++++++++++++++-------------------------------- fs/hpfs/super.c | 20 +++++++------------ 4 files changed, 31 insertions(+), 52 deletions(-) (limited to 'fs/hpfs') diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 280c47244..a2f33d56d 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -8,11 +8,6 @@ #include "hpfs_fn.h" -ssize_t hpfs_dir_read(struct file *filp, char *name, size_t len, loff_t *loff) -{ - return -EISDIR; -} - int hpfs_dir_release(struct inode *inode, struct file *filp) { hpfs_del_pos(inode, &filp->f_pos); diff --git a/fs/hpfs/hpfs_fn.h b/fs/hpfs/hpfs_fn.h index f0324cffa..44d1037cf 100644 --- a/fs/hpfs/hpfs_fn.h +++ b/fs/hpfs/hpfs_fn.h @@ -224,7 +224,6 @@ void hpfs_set_dentry_operations(struct dentry *); /* dir.c */ -ssize_t hpfs_dir_read(struct file *, char *, size_t, loff_t *); int hpfs_dir_release(struct inode *, struct file *); loff_t hpfs_dir_lseek(struct file *, loff_t, int); int hpfs_readdir(struct file *, void *, filldir_t); diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 2fa2d0dd4..c8283c672 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -8,7 +8,7 @@ #include "hpfs_fn.h" -static const struct file_operations hpfs_file_ops = +static struct file_operations hpfs_file_ops = { read: generic_file_read, write: hpfs_file_write, @@ -18,45 +18,33 @@ static const struct file_operations hpfs_file_ops = fsync: hpfs_file_fsync, }; -static const struct inode_operations hpfs_file_iops = +static struct inode_operations hpfs_file_iops = { - (nonconst *) & hpfs_file_ops, /* default file operations */ - NULL, /* create */ - NULL, /* lookup */ - NULL, /* link */ - NULL, /* unlink */ - NULL, /* symlink */ - NULL, /* mkdir */ - NULL, /* rmdir */ - NULL, /* mknod */ - NULL, /* rename */ - NULL, /* readlink */ - NULL, /* follow_link */ - hpfs_truncate, /* truncate */ + truncate: hpfs_truncate, + setattr: hpfs_notify_change, }; -static const struct file_operations hpfs_dir_ops = +static struct file_operations hpfs_dir_ops = { llseek: hpfs_dir_lseek, - read: hpfs_dir_read, + read: generic_read_dir, readdir: hpfs_readdir, open: hpfs_open, release: hpfs_dir_release, fsync: hpfs_file_fsync, }; -static const struct inode_operations hpfs_dir_iops = +static struct inode_operations hpfs_dir_iops = { - (nonconst *) & hpfs_dir_ops, /* default directory file ops */ - hpfs_create, /* create */ - hpfs_lookup, /* lookup */ - NULL, /* link */ - hpfs_unlink, /* unlink */ - hpfs_symlink, /* symlink */ - hpfs_mkdir, /* mkdir */ - hpfs_rmdir, /* rmdir */ - hpfs_mknod, /* mknod */ - hpfs_rename, /* rename */ + create: hpfs_create, + lookup: hpfs_lookup, + unlink: hpfs_unlink, + symlink: hpfs_symlink, + mkdir: hpfs_mkdir, + rmdir: hpfs_rmdir, + mknod: hpfs_mknod, + rename: hpfs_rename, + setattr: hpfs_notify_change, }; struct address_space_operations hpfs_symlink_aops = { @@ -70,7 +58,6 @@ void hpfs_read_inode(struct inode *i) struct super_block *sb = i->i_sb; unsigned char *ea; int ea_size; - i->i_op = 0; init_MUTEX(&i->i_hpfs_sem); i->i_uid = sb->s_hpfs_uid; i->i_gid = sb->s_hpfs_gid; @@ -104,14 +91,16 @@ void hpfs_read_inode(struct inode *i) if (i->i_sb->s_hpfs_rd_inode == 2) { i->i_mode |= S_IFREG; i->i_mode &= ~0111; - i->i_op = (struct inode_operations *) &hpfs_file_iops; + i->i_op = &hpfs_file_iops; + i->i_fop = &hpfs_file_ops; i->i_nlink = 1; return; } if (!(fnode = hpfs_map_fnode(sb, i->i_ino, &bh))) { /*i->i_mode |= S_IFREG; i->i_mode &= ~0111; - i->i_op = (struct inode_operations *) &hpfs_file_iops; + i->i_op = &hpfs_file_iops; + i->i_fop = &hpfs_file_ops; i->i_nlink = 0;*/ make_bad_inode(i); return; @@ -171,7 +160,8 @@ void hpfs_read_inode(struct inode *i) if (fnode->dirflag) { unsigned n_dnodes, n_subdirs; i->i_mode |= S_IFDIR; - i->i_op = (struct inode_operations *) &hpfs_dir_iops; + i->i_op = &hpfs_dir_iops; + i->i_fop = &hpfs_dir_ops; i->i_hpfs_parent_dir = fnode->up; i->i_hpfs_dno = fnode->u.external[0].disk_secno; if (sb->s_hpfs_chk >= 2) { @@ -186,7 +176,8 @@ void hpfs_read_inode(struct inode *i) } else { i->i_mode |= S_IFREG; if (!i->i_hpfs_ea_mode) i->i_mode &= ~0111; - i->i_op = (struct inode_operations *) &hpfs_file_iops; + i->i_op = &hpfs_file_iops; + i->i_fop = &hpfs_file_ops; i->i_nlink = 1; i->i_size = fnode->file_size; i->i_blocks = ((i->i_size + 511) >> 9) + 1; diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c index c6291c83a..8937bb90e 100644 --- a/fs/hpfs/super.c +++ b/fs/hpfs/super.c @@ -152,19 +152,13 @@ int hpfs_statfs(struct super_block *s, struct statfs *buf, int bufsiz) /* Super operations */ -static const struct super_operations hpfs_sops = +static struct super_operations hpfs_sops = { - hpfs_read_inode, /* read_inode */ - NULL, /* write_inode */ - NULL, /* put_inode */ - hpfs_delete_inode, /* delete inode */ - hpfs_notify_change, /* notify_change */ - hpfs_put_super, /* put_super */ - NULL, /* write_super */ - hpfs_statfs, /* statfs */ - hpfs_remount_fs, /* remount_fs */ - NULL, /* clear inode */ - NULL, /* umount_begin */ + read_inode: hpfs_read_inode, + delete_inode: hpfs_delete_inode, + put_super: hpfs_put_super, + statfs: hpfs_statfs, + remount_fs: hpfs_remount_fs, }; /* @@ -437,7 +431,7 @@ struct super_block *hpfs_read_super(struct super_block *s, void *options, s->s_magic = HPFS_SUPER_MAGIC; s->s_blocksize = 512; s->s_blocksize_bits = 9; - s->s_op = (struct super_operations *) &hpfs_sops; + s->s_op = &hpfs_sops; s->s_hpfs_root = superblock->root; s->s_hpfs_fs_size = superblock->n_sectors; -- cgit v1.2.3