aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/ioctl.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-11-23 11:57:51 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-01-03 22:52:35 -0500
commita561be7100cd610bd2e082f3211c1dfb45835817 (patch)
treea1016a11df967be6f289a4e8ae29597ba39df17e /fs/nilfs2/ioctl.c
parentf47ec3f28354795f000c14bf18ed967ec81a3ec3 (diff)
switch a bunch of places to mnt_want_write_file()
it's both faster (in case when file has been opened for write) and cleaner. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nilfs2/ioctl.c')
-rw-r--r--fs/nilfs2/ioctl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index ac258beeda3c..b7697d1ccd61 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -27,7 +27,7 @@
27#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */ 27#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */
28#include <linux/vmalloc.h> 28#include <linux/vmalloc.h>
29#include <linux/compat.h> /* compat_ptr() */ 29#include <linux/compat.h> /* compat_ptr() */
30#include <linux/mount.h> /* mnt_want_write(), mnt_drop_write() */ 30#include <linux/mount.h> /* mnt_want_write_file(), mnt_drop_write() */
31#include <linux/buffer_head.h> 31#include <linux/buffer_head.h>
32#include <linux/nilfs2_fs.h> 32#include <linux/nilfs2_fs.h>
33#include "nilfs.h" 33#include "nilfs.h"
@@ -119,7 +119,7 @@ static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp,
119 if (get_user(flags, (int __user *)argp)) 119 if (get_user(flags, (int __user *)argp))
120 return -EFAULT; 120 return -EFAULT;
121 121
122 ret = mnt_want_write(filp->f_path.mnt); 122 ret = mnt_want_write_file(filp);
123 if (ret) 123 if (ret)
124 return ret; 124 return ret;
125 125
@@ -174,7 +174,7 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
174 if (!capable(CAP_SYS_ADMIN)) 174 if (!capable(CAP_SYS_ADMIN))
175 return -EPERM; 175 return -EPERM;
176 176
177 ret = mnt_want_write(filp->f_path.mnt); 177 ret = mnt_want_write_file(filp);
178 if (ret) 178 if (ret)
179 return ret; 179 return ret;
180 180
@@ -210,7 +210,7 @@ nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp,
210 if (!capable(CAP_SYS_ADMIN)) 210 if (!capable(CAP_SYS_ADMIN))
211 return -EPERM; 211 return -EPERM;
212 212
213 ret = mnt_want_write(filp->f_path.mnt); 213 ret = mnt_want_write_file(filp);
214 if (ret) 214 if (ret)
215 return ret; 215 return ret;
216 216
@@ -591,7 +591,7 @@ static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp,
591 if (!capable(CAP_SYS_ADMIN)) 591 if (!capable(CAP_SYS_ADMIN))
592 return -EPERM; 592 return -EPERM;
593 593
594 ret = mnt_want_write(filp->f_path.mnt); 594 ret = mnt_want_write_file(filp);
595 if (ret) 595 if (ret)
596 return ret; 596 return ret;
597 597
@@ -710,7 +710,7 @@ static int nilfs_ioctl_resize(struct inode *inode, struct file *filp,
710 if (!capable(CAP_SYS_ADMIN)) 710 if (!capable(CAP_SYS_ADMIN))
711 goto out; 711 goto out;
712 712
713 ret = mnt_want_write(filp->f_path.mnt); 713 ret = mnt_want_write_file(filp);
714 if (ret) 714 if (ret)
715 goto out; 715 goto out;
716 716