diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-02 02:36:47 +0000 |
commit | 8624512aa908741ba2795200133eae0d7f4557ea (patch) | |
tree | d5d3036fccf2604f4c98dedc11e8adb929d6b52e /fs/sysv | |
parent | 7b8f5d6f1d45d9f9de1d26e7d3c32aa5af11b488 (diff) |
Merge with 2.3.48.
Diffstat (limited to 'fs/sysv')
-rw-r--r-- | fs/sysv/dir.c | 28 | ||||
-rw-r--r-- | fs/sysv/file.c | 11 | ||||
-rw-r--r-- | fs/sysv/ialloc.c | 1 | ||||
-rw-r--r-- | fs/sysv/inode.c | 33 | ||||
-rw-r--r-- | fs/sysv/namei.c | 38 |
5 files changed, 50 insertions, 61 deletions
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index f21a47578..57968a839 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -19,38 +19,14 @@ #include <linux/stat.h> #include <linux/string.h> -#include <asm/uaccess.h> - -static ssize_t sysv_dir_read(struct file * filp, char * buf, - size_t count, loff_t *ppos) -{ - return -EISDIR; -} - static int sysv_readdir(struct file *, void *, filldir_t); -static struct file_operations sysv_dir_operations = { - read: sysv_dir_read, +struct file_operations sysv_dir_operations = { + read: generic_read_dir, readdir: sysv_readdir, fsync: file_fsync, }; -/* - * directories can handle most operations... - */ -struct inode_operations sysv_dir_inode_operations = { - &sysv_dir_operations, /* default directory file-ops */ - sysv_create, /* create */ - sysv_lookup, /* lookup */ - sysv_link, /* link */ - sysv_unlink, /* unlink */ - sysv_symlink, /* symlink */ - sysv_mkdir, /* mkdir */ - sysv_rmdir, /* rmdir */ - sysv_mknod, /* mknod */ - sysv_rename, /* rename */ -}; - static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir) { struct inode *inode = filp->f_dentry->d_inode; diff --git a/fs/sysv/file.c b/fs/sysv/file.c index b60a1d02e..d68967b19 100644 --- a/fs/sysv/file.c +++ b/fs/sysv/file.c @@ -13,21 +13,14 @@ * SystemV/Coherent regular file handling primitives */ -#include <linux/kernel.h> #include <linux/fs.h> #include <linux/sysv_fs.h> -#include <linux/errno.h> -#include <linux/fcntl.h> -#include <linux/stat.h> -#include <linux/string.h> -#include <linux/locks.h> -#include <linux/pagemap.h> /* * We have mostly NULLs here: the current defaults are OK for * the coh filesystem. */ -static struct file_operations sysv_file_operations = { +struct file_operations sysv_file_operations = { read: generic_file_read, write: generic_file_write, mmap: generic_file_mmap, @@ -35,6 +28,6 @@ static struct file_operations sysv_file_operations = { }; struct inode_operations sysv_file_inode_operations = { - &sysv_file_operations, truncate: sysv_truncate, + setattr: sysv_notify_change, }; diff --git a/fs/sysv/ialloc.c b/fs/sysv/ialloc.c index 2826286cc..0bdceb2f5 100644 --- a/fs/sysv/ialloc.c +++ b/fs/sysv/ialloc.c @@ -156,7 +156,6 @@ struct inode * sysv_new_inode(const struct inode * dir) inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid; inode->i_ino = ino; inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; - inode->i_op = NULL; inode->i_blocks = inode->i_blksize = 0; insert_inode_hash(inode); mark_inode_dirty(inode); diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index 6580b6125..2c79b3c71 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c @@ -68,19 +68,15 @@ static void sysv_delete_inode(struct inode *inode) static void sysv_put_super(struct super_block *); static void sysv_write_super(struct super_block *); static void sysv_read_inode(struct inode *); -static int sysv_notify_change(struct dentry *, struct iattr *); static int sysv_statfs(struct super_block *, struct statfs *, int); static struct super_operations sysv_sops = { - sysv_read_inode, - sysv_write_inode, - NULL, /* nothing special on put_inode() */ - sysv_delete_inode, - sysv_notify_change, - sysv_put_super, - sysv_write_super, - sysv_statfs, - NULL /* remount_fs */ + read_inode: sysv_read_inode, + write_inode: sysv_write_inode, + delete_inode: sysv_delete_inode, + put_super: sysv_put_super, + write_super: sysv_write_super, + statfs: sysv_statfs, }; /* The following functions try to recognize specific filesystems. @@ -1027,6 +1023,12 @@ static inline void coh_write3byte (unsigned char * p, unsigned long val) *(unsigned short *)(p+1) = (unsigned short) val; } +struct inode_operations sysv_symlink_inode_operations = { + readlink: page_readlink, + follow_link: page_follow_link, + setattr: sysv_notify_change, +}; + static void sysv_read_inode(struct inode *inode) { struct super_block * sb = inode->i_sb; @@ -1036,7 +1038,6 @@ static void sysv_read_inode(struct inode *inode) umode_t mode; ino = inode->i_ino; - inode->i_op = NULL; inode->i_mode = 0; if (!ino || ino > sb->sv_ninodes) { printk("Bad inode number on dev %s" @@ -1085,11 +1086,13 @@ static void sysv_read_inode(struct inode *inode) read3byte(&raw_inode->i_a.i_addb[3*block]); if (S_ISREG(inode->i_mode)) { inode->i_op = &sysv_file_inode_operations; + inode->i_fop = &sysv_file_operations; inode->i_mapping->a_ops = &sysv_aops; - } else if (S_ISDIR(inode->i_mode)) + } else if (S_ISDIR(inode->i_mode)) { inode->i_op = &sysv_dir_inode_operations; - else if (S_ISLNK(inode->i_mode)) { - inode->i_op = &page_symlink_inode_operations; + inode->i_fop = &sysv_dir_operations; + } else if (S_ISLNK(inode->i_mode)) { + inode->i_op = &sysv_symlink_inode_operations; inode->i_mapping->a_ops = &sysv_aops; } else init_special_inode(inode, inode->i_mode,raw_inode->i_a.i_rdev); @@ -1097,7 +1100,7 @@ static void sysv_read_inode(struct inode *inode) } /* To avoid inconsistencies between inodes in memory and inodes on disk. */ -static int sysv_notify_change(struct dentry *dentry, struct iattr *attr) +int sysv_notify_change(struct dentry *dentry, struct iattr *attr) { struct inode *inode = dentry->d_inode; int error; diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index 9661af99c..a7b871073 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c @@ -101,7 +101,7 @@ static struct buffer_head * sysv_find_entry(struct inode * dir, return NULL; } -struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry) +static struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry) { struct inode * inode = NULL; struct sysv_dir_entry * de; @@ -193,7 +193,7 @@ static int sysv_add_entry(struct inode * dir, return 0; } -int sysv_create(struct inode * dir, struct dentry * dentry, int mode) +static int sysv_create(struct inode * dir, struct dentry * dentry, int mode) { int error; struct inode * inode; @@ -204,6 +204,7 @@ int sysv_create(struct inode * dir, struct dentry * dentry, int mode) if (!inode) return -ENOSPC; inode->i_op = &sysv_file_inode_operations; + inode->i_fop = &sysv_file_operations; inode->i_mapping->a_ops = &sysv_aops; inode->i_mode = mode; mark_inode_dirty(inode); @@ -222,7 +223,7 @@ int sysv_create(struct inode * dir, struct dentry * dentry, int mode) return 0; } -int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev) +static int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev) { int error; struct inode * inode; @@ -256,7 +257,7 @@ int sysv_mknod(struct inode * dir, struct dentry * dentry, int mode, int rdev) return 0; } -int sysv_mkdir(struct inode * dir, struct dentry *dentry, int mode) +static int sysv_mkdir(struct inode * dir, struct dentry *dentry, int mode) { int error; struct inode * inode; @@ -275,6 +276,7 @@ int sysv_mkdir(struct inode * dir, struct dentry *dentry, int mode) if (!inode) return -ENOSPC; inode->i_op = &sysv_dir_inode_operations; + inode->i_fop = &sysv_dir_operations; inode->i_size = 2 * SYSV_DIRSIZE; dir_block = sysv_file_bread(inode,0,1); if (!dir_block) { @@ -370,7 +372,7 @@ bad_dir: return 1; } -int sysv_rmdir(struct inode * dir, struct dentry * dentry) +static int sysv_rmdir(struct inode * dir, struct dentry * dentry) { int retval; struct inode * inode; @@ -407,7 +409,7 @@ end_rmdir: return retval; } -int sysv_unlink(struct inode * dir, struct dentry * dentry) +static int sysv_unlink(struct inode * dir, struct dentry * dentry) { int retval; struct inode * inode; @@ -438,7 +440,7 @@ end_unlink: return retval; } -int sysv_symlink(struct inode * dir, struct dentry * dentry, +static int sysv_symlink(struct inode * dir, struct dentry * dentry, const char * symname) { struct inode * inode; @@ -456,7 +458,7 @@ int sysv_symlink(struct inode * dir, struct dentry * dentry, goto out; inode->i_mode = S_IFLNK | 0777; - inode->i_op = &page_symlink_inode_operations; + inode->i_op = &sysv_symlink_inode_operations; inode->i_mapping->a_ops = &sysv_aops; err = block_symlink(inode, symname, l); if (err) @@ -479,7 +481,7 @@ out_no_entry: goto out; } -int sysv_link(struct dentry * old_dentry, struct inode * dir, +static int sysv_link(struct dentry * old_dentry, struct inode * dir, struct dentry * dentry) { struct inode *oldinode = old_dentry->d_inode; @@ -523,7 +525,7 @@ int sysv_link(struct dentry * old_dentry, struct inode * dir, * Anybody can rename anything with this: the permission checks are left to the * higher-level routines. */ -int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, +static int sysv_rename(struct inode * old_dir, struct dentry * old_dentry, struct inode * new_dir, struct dentry * new_dentry) { struct inode * old_inode, * new_inode; @@ -604,3 +606,19 @@ end_rename: brelse(new_bh); return retval; } + +/* + * directories can handle most operations... + */ +struct inode_operations sysv_dir_inode_operations = { + create: sysv_create, + lookup: sysv_lookup, + link: sysv_link, + unlink: sysv_unlink, + symlink: sysv_symlink, + mkdir: sysv_mkdir, + rmdir: sysv_rmdir, + mknod: sysv_mknod, + rename: sysv_rename, + setattr: sysv_notify_change, +}; |