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/affs/dir.c | 30 +++++++++++------------------- fs/affs/file.c | 39 ++++----------------------------------- fs/affs/inode.c | 16 +++++----------- fs/affs/namei.c | 8 ++++++-- fs/affs/super.c | 17 ++++++++--------- fs/affs/symlink.c | 6 ++++++ 6 files changed, 40 insertions(+), 76 deletions(-) (limited to 'fs/affs') diff --git a/fs/affs/dir.c b/fs/affs/dir.c index b554daf0c..3fc8409b0 100644 --- a/fs/affs/dir.c +++ b/fs/affs/dir.c @@ -25,10 +25,9 @@ #include static int affs_readdir(struct file *, void *, filldir_t); -static ssize_t affs_dir_read(struct file *, char *, size_t, loff_t *); -static struct file_operations affs_dir_operations = { - read: affs_dir_read, +struct file_operations affs_dir_operations = { + read: generic_read_dir, readdir: affs_readdir, fsync: file_fsync, }; @@ -37,24 +36,17 @@ static struct file_operations affs_dir_operations = { * directories can handle most operations... */ struct inode_operations affs_dir_inode_operations = { - &affs_dir_operations, /* default directory file-ops */ - affs_create, /* create */ - affs_lookup, /* lookup */ - affs_link, /* link */ - affs_unlink, /* unlink */ - affs_symlink, /* symlink */ - affs_mkdir, /* mkdir */ - affs_rmdir, /* rmdir */ - NULL, /* mknod */ - affs_rename, /* rename */ + create: affs_create, + lookup: affs_lookup, + link: affs_link, + unlink: affs_unlink, + symlink: affs_symlink, + mkdir: affs_mkdir, + rmdir: affs_rmdir, + rename: affs_rename, + setattr: affs_notify_change, }; -static ssize_t -affs_dir_read(struct file *filp, char *buf, size_t count, loff_t *ppos) -{ - return -EISDIR; -} - static int affs_readdir(struct file *filp, void *dirent, filldir_t filldir) { diff --git a/fs/affs/file.c b/fs/affs/file.c index 8881fe3e4..069964acb 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -43,7 +43,7 @@ static ssize_t affs_file_write(struct file *filp, const char *buf, size_t count, static ssize_t affs_file_write_ofs(struct file *filp, const char *buf, size_t cnt, loff_t *ppos); static int alloc_ext_cache(struct inode *inode); -static struct file_operations affs_file_operations = { +struct file_operations affs_file_operations = { read: generic_file_read, write: affs_file_write, mmap: generic_file_mmap, @@ -51,47 +51,16 @@ static struct file_operations affs_file_operations = { }; struct inode_operations affs_file_inode_operations = { - &affs_file_operations, /* 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 */ - affs_truncate, /* truncate */ - NULL, /* permission */ - NULL /* revalidate */ + truncate: affs_truncate, + setattr: affs_notify_change, }; -static struct file_operations affs_file_operations_ofs = { +struct file_operations affs_file_operations_ofs = { read: affs_file_read_ofs, write: affs_file_write_ofs, fsync: file_fsync, }; -struct inode_operations affs_file_inode_operations_ofs = { - &affs_file_operations_ofs, /* 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 */ - affs_truncate, /* truncate */ - NULL, /* permission */ - NULL /* revalidate */ -}; - #define AFFS_ISINDEX(x) ((x < 129) || \ (x < 512 && (x & 1) == 0) || \ (x < 1024 && (x & 3) == 0) || \ diff --git a/fs/affs/inode.c b/fs/affs/inode.c index e0d411861..1e5647c39 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inode.c @@ -162,22 +162,24 @@ affs_read_inode(struct inode *inode) sys_tz.tz_minuteswest * 60; affs_brelse(bh); - inode->i_op = NULL; if (S_ISREG(inode->i_mode)) { if (inode->i_sb->u.affs_sb.s_flags & SF_OFS) { - inode->i_op = &affs_file_inode_operations_ofs; + inode->i_op = &affs_file_inode_operations; + inode->i_fop = &affs_file_operations_ofs; return; } inode->i_op = &affs_file_inode_operations; + inode->i_fop = &affs_file_operations; inode->i_mapping->a_ops = &affs_aops; inode->u.affs_i.mmu_private = inode->i_size; } else if (S_ISDIR(inode->i_mode)) { /* Maybe it should be controlled by mount parameter? */ inode->i_mode |= S_ISVTX; inode->i_op = &affs_dir_inode_operations; + inode->i_fop = &affs_dir_operations; } else if (S_ISLNK(inode->i_mode)) { - inode->i_op = &page_symlink_inode_operations; + inode->i_op = &affs_symlink_inode_operations; inode->i_data.a_ops = &affs_symlink_aops; } } @@ -295,24 +297,16 @@ affs_new_inode(const struct inode *dir) sb = dir->i_sb; inode->i_sb = sb; - inode->i_flags = 0; if (!(block = affs_new_header((struct inode *)dir))) { iput(inode); return NULL; } - inode->i_count = 1; - inode->i_nlink = 1; inode->i_dev = sb->s_dev; inode->i_uid = current->fsuid; inode->i_gid = current->fsgid; inode->i_ino = block; - inode->i_op = NULL; - inode->i_blocks = 0; - inode->i_size = 0; - inode->i_mode = 0; - inode->i_blksize = 0; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; inode->u.affs_i.i_original = 0; diff --git a/fs/affs/namei.c b/fs/affs/namei.c index d2c27b9d1..8ebf8319b 100644 --- a/fs/affs/namei.c +++ b/fs/affs/namei.c @@ -274,9 +274,11 @@ affs_create(struct inode *dir, struct dentry *dentry, int mode) pr_debug("AFFS: ino=%lu\n",inode->i_ino); if (dir->i_sb->u.affs_sb.s_flags & SF_OFS) - inode->i_op = &affs_file_inode_operations_ofs; + inode->i_op = &affs_file_inode_operations; + inode->i_fop = &affs_file_operations_ofs; else { inode->i_op = &affs_file_inode_operations; + inode->i_fop = &affs_file_operations; inode->i_mapping->a_ops = &affs_aops; inode->u.affs_i.mmu_private = inode->i_size; } @@ -314,6 +316,7 @@ affs_mkdir(struct inode *dir, struct dentry *dentry, int mode) goto out; inode->i_op = &affs_dir_inode_operations; + inode->i_fop = &affs_dir_operations; error = affs_add_entry(dir,NULL,inode,dentry,ST_USERDIR); if (error) goto out_iput; @@ -403,7 +406,7 @@ affs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) if (!inode) goto out; - inode->i_op = &page_symlink_inode_operations; + inode->i_op = &affs_symlink_inode_operations; inode->i_data.a_ops = &affs_symlink_aops; inode->i_mode = S_IFLNK | 0777; inode->u.affs_i.i_protect = mode_to_prot(inode->i_mode); @@ -495,6 +498,7 @@ affs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) goto out; inode->i_op = oldinode->i_op; + inode->i_fop = oldinode->i_fop; inode->u.affs_i.i_protect = mode_to_prot(oldinode->i_mode); inode->u.affs_i.i_original = oldinode->i_ino; inode->u.affs_i.i_hlink = 1; diff --git a/fs/affs/super.c b/fs/affs/super.c index fe5fd1042..9eed5c09e 100644 --- a/fs/affs/super.c +++ b/fs/affs/super.c @@ -98,15 +98,14 @@ affs_write_super(struct super_block *sb) } static struct super_operations affs_sops = { - affs_read_inode, - affs_write_inode, - affs_put_inode, - affs_delete_inode, - affs_notify_change, - affs_put_super, - affs_write_super, - affs_statfs, - affs_remount + read_inode: affs_read_inode, + write_inode: affs_write_inode, + put_inode: affs_put_inode, + delete_inode: affs_delete_inode, + put_super: affs_put_super, + write_super: affs_write_super, + statfs: affs_statfs, + remount_fs: affs_remount, }; static int diff --git a/fs/affs/symlink.c b/fs/affs/symlink.c index 885d5099d..cd02b93dd 100644 --- a/fs/affs/symlink.c +++ b/fs/affs/symlink.c @@ -74,3 +74,9 @@ fail: struct address_space_operations affs_symlink_aops = { readpage: affs_symlink_readpage, }; + +struct inode_operations affs_symlink_inode_operations = { + readlink: page_readlink, + follow_link: page_follow_link, + setattr: affs_notify_change, +}; -- cgit v1.2.3