Convert reiserfs_ioctl() to an unlocked_ioctl
PATCH 1/1 Convert reiserfs_ioctl() to an unlocked_ioctl
Signed-off-by Mathieu Segaud <[email protected]>
--- fs/reiserfs/dir.c | 2 +- fs/reiserfs/file.c | 2 +- fs/reiserfs/ioctl.c | 94 ++++++++++++++++++++++++++++--------------- include/linux/reiserfs_fs.h | 2 +- 4 files changed, 65 insertions(+), 35 deletions(-)
fs/reiserfs/dir.c +1 -1
@@ -20,7 +20,7 @@ const struct file_operations reiserfs_dir_operations = { .read = generic_read_dir, .readdir = reiserfs_readdir, .fsync = reiserfs_dir_fsync, - .ioctl = reiserfs_ioctl, + .unlocked_ioctl = reiserfs_ioctl,#ifdef CONFIG_COMPAT .compat_ioctl = reiserfs_compat_ioctl,#endif
fs/reiserfs/file.c +1 -1
@@ -284,7 +284,7 @@ static ssize_t reiserfs_file_write(struct file *file, /* the file we are going tconst struct file_operations reiserfs_file_operations = { .read = do_sync_read, .write = reiserfs_file_write, - .ioctl = reiserfs_ioctl, + .unlocked_ioctl = reiserfs_ioctl, #ifdef CONFIG_COMPAT .compat_ioctl = reiserfs_compat_ioctl, #endif
fs/reiserfs/ioctl.c +62 -32
142 lines not on this page · raw message
include/linux/reiserfs_fs.h +1 -1
@@ -2172,7 +2172,7 @@ __u32 r5_hash(const signed char *msg, int len);#define SPARE_SPACE 500/* prototypes from ioctl.c */ -int reiserfs_ioctl (struct inode *inode,struct file *filp, +long reiserfs_ioctl (struct file *filp,unsigned int cmd,unsigned long arg);long reiserfs_compat_ioctl (struct file *filp,unsigned int cmd,unsigned long arg);
Signature · 1 line
1.5.3.8
PATCH 1/1 reiserfs: coding style fixes
Signed-off-by Mathieu Segaud <[email protected]>
--- fs/reiserfs/ioctl.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-)
fs/reiserfs/ioctl.c +12 -10
@@ -17,7 +17,8 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp);** reiserfs_ioctl - handler for ioctl for inode ** supported commands: ** 1) REISERFS_IOC_UNPACK - try to unpack tail from direct item into indirect -** and prevent packing file (argument arg has to be non-zero) +** and prevent packing file (argument arg has to be +** non-zero) ** 2) REISERFS_IOC_[GS]ETFLAGS, REISERFS_IOC_[GS]ETVERSION ** 3) That's all for a while ... */
@@ -47,7 +48,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) } flags =REISERFS_I (inode)->i_attrs; -i_attrs_to_sd_attrs (inode, (__u16 *) & flags); +i_attrs_to_sd_attrs (inode, (__u16 *) &flags); retval =put_user (flags, (int __user *)arg); goto out;case REISERFS_IOC_SETFLAGS :{
@@ -71,7 +72,10 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) goto out; } -/* Is it quota file? Do not allow user to mess with it. */ +/* +* Is it quota file? +* Do not allow user to mess with it. +*/ if (IS_NOQUOTA (inode)) { retval = -EPERM ; goto out;
@@ -184,9 +188,8 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp)return 0 ; }/* ioctl already done */ -if (REISERFS_I (inode)->i_flags & i_nopack_mask) { +if (REISERFS_I (inode)->i_flags & i_nopack_mask)return 0 ; - }/* we need to make sure nobody is changing the file size beneath ** us
@@ -202,16 +205,15 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp) }/* we unpack by finding the page with the tail, and calling -** reiserfs_prepare_write on that page. This will force a +** reiserfs_prepare_write on that page. This will force a ** reiserfs_get_block to unpack the tail for us. */ index = inode->i_size >>PAGE_CACHE_SHIFT ; mapping = inode->i_mapping; page =grab_cache_page (mapping, index); retval = -ENOMEM ; -if (!page) { +if (!page) goto out; - } retval =reiserfs_prepare_write (NULL , page, write_from, write_from);if (retval) goto out_unlock;
@@ -221,11 +223,11 @@ static int reiserfs_unpack(struct inode *inode, struct file *filp) retval =reiserfs_commit_write (NULL , page, write_from, write_from);REISERFS_I (inode)->i_flags |= i_nopack_mask; - out_unlock: +out_unlock:unlock_page (page);page_cache_release (page); - out: +out:mutex_unlock (&inode->i_mutex);reiserfs_write_unlock (inode->i_sb);return retval;
Signature · 1 line
1.5.3.8