diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 12 | ||||
-rw-r--r-- | fs/ext2/ioctl.c | 6 | ||||
-rw-r--r-- | fs/ext3/ioctl.c | 10 | ||||
-rw-r--r-- | fs/ext4/ioctl.c | 14 | ||||
-rw-r--r-- | fs/fat/file.c | 2 | ||||
-rw-r--r-- | fs/gfs2/file.c | 2 | ||||
-rw-r--r-- | fs/hfsplus/ioctl.c | 2 | ||||
-rw-r--r-- | fs/inode.c | 2 | ||||
-rw-r--r-- | fs/jfs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/namespace.c | 6 | ||||
-rw-r--r-- | fs/ncpfs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/nfsd/nfs4recover.c | 6 | ||||
-rw-r--r-- | fs/nilfs2/ioctl.c | 12 | ||||
-rw-r--r-- | fs/ocfs2/ioctl.c | 2 | ||||
-rw-r--r-- | fs/ocfs2/move_extents.c | 2 | ||||
-rw-r--r-- | fs/open.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/ioctl.c | 4 | ||||
-rw-r--r-- | fs/ubifs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/xattr.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl32.c | 4 | ||||
-rw-r--r-- | include/linux/mount.h | 1 |
22 files changed, 55 insertions, 48 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 20dd8f3b6c72..5441ff1480fd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -259,7 +259,7 @@ static int btrfs_ioctl_setflags(struct file *file, void __user *arg) | |||
259 | 259 | ||
260 | btrfs_end_transaction(trans, root); | 260 | btrfs_end_transaction(trans, root); |
261 | 261 | ||
262 | mnt_drop_write(file->f_path.mnt); | 262 | mnt_drop_write_file(file); |
263 | 263 | ||
264 | ret = 0; | 264 | ret = 0; |
265 | out_unlock: | 265 | out_unlock: |
@@ -1971,7 +1971,7 @@ out_dput: | |||
1971 | dput(dentry); | 1971 | dput(dentry); |
1972 | out_unlock_dir: | 1972 | out_unlock_dir: |
1973 | mutex_unlock(&dir->i_mutex); | 1973 | mutex_unlock(&dir->i_mutex); |
1974 | mnt_drop_write(file->f_path.mnt); | 1974 | mnt_drop_write_file(file); |
1975 | out: | 1975 | out: |
1976 | kfree(vol_args); | 1976 | kfree(vol_args); |
1977 | return err; | 1977 | return err; |
@@ -2040,7 +2040,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp) | |||
2040 | ret = -EINVAL; | 2040 | ret = -EINVAL; |
2041 | } | 2041 | } |
2042 | out: | 2042 | out: |
2043 | mnt_drop_write(file->f_path.mnt); | 2043 | mnt_drop_write_file(file); |
2044 | return ret; | 2044 | return ret; |
2045 | } | 2045 | } |
2046 | 2046 | ||
@@ -2510,7 +2510,7 @@ out_unlock: | |||
2510 | out_fput: | 2510 | out_fput: |
2511 | fput(src_file); | 2511 | fput(src_file); |
2512 | out_drop_write: | 2512 | out_drop_write: |
2513 | mnt_drop_write(file->f_path.mnt); | 2513 | mnt_drop_write_file(file); |
2514 | return ret; | 2514 | return ret; |
2515 | } | 2515 | } |
2516 | 2516 | ||
@@ -2565,7 +2565,7 @@ static long btrfs_ioctl_trans_start(struct file *file) | |||
2565 | 2565 | ||
2566 | out_drop: | 2566 | out_drop: |
2567 | atomic_dec(&root->fs_info->open_ioctl_trans); | 2567 | atomic_dec(&root->fs_info->open_ioctl_trans); |
2568 | mnt_drop_write(file->f_path.mnt); | 2568 | mnt_drop_write_file(file); |
2569 | out: | 2569 | out: |
2570 | return ret; | 2570 | return ret; |
2571 | } | 2571 | } |
@@ -2800,7 +2800,7 @@ long btrfs_ioctl_trans_end(struct file *file) | |||
2800 | 2800 | ||
2801 | atomic_dec(&root->fs_info->open_ioctl_trans); | 2801 | atomic_dec(&root->fs_info->open_ioctl_trans); |
2802 | 2802 | ||
2803 | mnt_drop_write(file->f_path.mnt); | 2803 | mnt_drop_write_file(file); |
2804 | return 0; | 2804 | return 0; |
2805 | } | 2805 | } |
2806 | 2806 | ||
diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 61a3f9661728..1089f760c847 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c | |||
@@ -83,7 +83,7 @@ long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
83 | inode->i_ctime = CURRENT_TIME_SEC; | 83 | inode->i_ctime = CURRENT_TIME_SEC; |
84 | mark_inode_dirty(inode); | 84 | mark_inode_dirty(inode); |
85 | setflags_out: | 85 | setflags_out: |
86 | mnt_drop_write(filp->f_path.mnt); | 86 | mnt_drop_write_file(filp); |
87 | return ret; | 87 | return ret; |
88 | } | 88 | } |
89 | case EXT2_IOC_GETVERSION: | 89 | case EXT2_IOC_GETVERSION: |
@@ -100,7 +100,7 @@ setflags_out: | |||
100 | inode->i_ctime = CURRENT_TIME_SEC; | 100 | inode->i_ctime = CURRENT_TIME_SEC; |
101 | mark_inode_dirty(inode); | 101 | mark_inode_dirty(inode); |
102 | } | 102 | } |
103 | mnt_drop_write(filp->f_path.mnt); | 103 | mnt_drop_write_file(filp); |
104 | return ret; | 104 | return ret; |
105 | case EXT2_IOC_GETRSVSZ: | 105 | case EXT2_IOC_GETRSVSZ: |
106 | if (test_opt(inode->i_sb, RESERVATION) | 106 | if (test_opt(inode->i_sb, RESERVATION) |
@@ -145,7 +145,7 @@ setflags_out: | |||
145 | rsv->rsv_goal_size = rsv_window_size; | 145 | rsv->rsv_goal_size = rsv_window_size; |
146 | } | 146 | } |
147 | mutex_unlock(&ei->truncate_mutex); | 147 | mutex_unlock(&ei->truncate_mutex); |
148 | mnt_drop_write(filp->f_path.mnt); | 148 | mnt_drop_write_file(filp); |
149 | return 0; | 149 | return 0; |
150 | } | 150 | } |
151 | default: | 151 | default: |
diff --git a/fs/ext3/ioctl.c b/fs/ext3/ioctl.c index a02863a080d3..8e37c41a071b 100644 --- a/fs/ext3/ioctl.c +++ b/fs/ext3/ioctl.c | |||
@@ -110,7 +110,7 @@ flags_err: | |||
110 | err = ext3_change_inode_journal_flag(inode, jflag); | 110 | err = ext3_change_inode_journal_flag(inode, jflag); |
111 | flags_out: | 111 | flags_out: |
112 | mutex_unlock(&inode->i_mutex); | 112 | mutex_unlock(&inode->i_mutex); |
113 | mnt_drop_write(filp->f_path.mnt); | 113 | mnt_drop_write_file(filp); |
114 | return err; | 114 | return err; |
115 | } | 115 | } |
116 | case EXT3_IOC_GETVERSION: | 116 | case EXT3_IOC_GETVERSION: |
@@ -147,7 +147,7 @@ flags_out: | |||
147 | } | 147 | } |
148 | ext3_journal_stop(handle); | 148 | ext3_journal_stop(handle); |
149 | setversion_out: | 149 | setversion_out: |
150 | mnt_drop_write(filp->f_path.mnt); | 150 | mnt_drop_write_file(filp); |
151 | return err; | 151 | return err; |
152 | } | 152 | } |
153 | case EXT3_IOC_GETRSVSZ: | 153 | case EXT3_IOC_GETRSVSZ: |
@@ -195,7 +195,7 @@ setversion_out: | |||
195 | } | 195 | } |
196 | mutex_unlock(&ei->truncate_mutex); | 196 | mutex_unlock(&ei->truncate_mutex); |
197 | setrsvsz_out: | 197 | setrsvsz_out: |
198 | mnt_drop_write(filp->f_path.mnt); | 198 | mnt_drop_write_file(filp); |
199 | return err; | 199 | return err; |
200 | } | 200 | } |
201 | case EXT3_IOC_GROUP_EXTEND: { | 201 | case EXT3_IOC_GROUP_EXTEND: { |
@@ -221,7 +221,7 @@ setrsvsz_out: | |||
221 | if (err == 0) | 221 | if (err == 0) |
222 | err = err2; | 222 | err = err2; |
223 | group_extend_out: | 223 | group_extend_out: |
224 | mnt_drop_write(filp->f_path.mnt); | 224 | mnt_drop_write_file(filp); |
225 | return err; | 225 | return err; |
226 | } | 226 | } |
227 | case EXT3_IOC_GROUP_ADD: { | 227 | case EXT3_IOC_GROUP_ADD: { |
@@ -249,7 +249,7 @@ group_extend_out: | |||
249 | if (err == 0) | 249 | if (err == 0) |
250 | err = err2; | 250 | err = err2; |
251 | group_add_out: | 251 | group_add_out: |
252 | mnt_drop_write(filp->f_path.mnt); | 252 | mnt_drop_write_file(filp); |
253 | return err; | 253 | return err; |
254 | } | 254 | } |
255 | case FITRIM: { | 255 | case FITRIM: { |
diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c index 9a49760b554d..d37b3bb2a3b8 100644 --- a/fs/ext4/ioctl.c +++ b/fs/ext4/ioctl.c | |||
@@ -134,7 +134,7 @@ flags_err: | |||
134 | err = ext4_ext_migrate(inode); | 134 | err = ext4_ext_migrate(inode); |
135 | flags_out: | 135 | flags_out: |
136 | mutex_unlock(&inode->i_mutex); | 136 | mutex_unlock(&inode->i_mutex); |
137 | mnt_drop_write(filp->f_path.mnt); | 137 | mnt_drop_write_file(filp); |
138 | return err; | 138 | return err; |
139 | } | 139 | } |
140 | case EXT4_IOC_GETVERSION: | 140 | case EXT4_IOC_GETVERSION: |
@@ -171,7 +171,7 @@ flags_out: | |||
171 | } | 171 | } |
172 | ext4_journal_stop(handle); | 172 | ext4_journal_stop(handle); |
173 | setversion_out: | 173 | setversion_out: |
174 | mnt_drop_write(filp->f_path.mnt); | 174 | mnt_drop_write_file(filp); |
175 | return err; | 175 | return err; |
176 | } | 176 | } |
177 | case EXT4_IOC_GROUP_EXTEND: { | 177 | case EXT4_IOC_GROUP_EXTEND: { |
@@ -204,7 +204,7 @@ setversion_out: | |||
204 | } | 204 | } |
205 | if (err == 0) | 205 | if (err == 0) |
206 | err = err2; | 206 | err = err2; |
207 | mnt_drop_write(filp->f_path.mnt); | 207 | mnt_drop_write_file(filp); |
208 | ext4_resize_end(sb); | 208 | ext4_resize_end(sb); |
209 | 209 | ||
210 | return err; | 210 | return err; |
@@ -246,7 +246,7 @@ setversion_out: | |||
246 | 246 | ||
247 | err = ext4_move_extents(filp, donor_filp, me.orig_start, | 247 | err = ext4_move_extents(filp, donor_filp, me.orig_start, |
248 | me.donor_start, me.len, &me.moved_len); | 248 | me.donor_start, me.len, &me.moved_len); |
249 | mnt_drop_write(filp->f_path.mnt); | 249 | mnt_drop_write_file(filp); |
250 | if (me.moved_len > 0) | 250 | if (me.moved_len > 0) |
251 | file_remove_suid(donor_filp); | 251 | file_remove_suid(donor_filp); |
252 | 252 | ||
@@ -289,7 +289,7 @@ mext_out: | |||
289 | } | 289 | } |
290 | if (err == 0) | 290 | if (err == 0) |
291 | err = err2; | 291 | err = err2; |
292 | mnt_drop_write(filp->f_path.mnt); | 292 | mnt_drop_write_file(filp); |
293 | ext4_resize_end(sb); | 293 | ext4_resize_end(sb); |
294 | 294 | ||
295 | return err; | 295 | return err; |
@@ -313,7 +313,7 @@ mext_out: | |||
313 | mutex_lock(&(inode->i_mutex)); | 313 | mutex_lock(&(inode->i_mutex)); |
314 | err = ext4_ext_migrate(inode); | 314 | err = ext4_ext_migrate(inode); |
315 | mutex_unlock(&(inode->i_mutex)); | 315 | mutex_unlock(&(inode->i_mutex)); |
316 | mnt_drop_write(filp->f_path.mnt); | 316 | mnt_drop_write_file(filp); |
317 | return err; | 317 | return err; |
318 | } | 318 | } |
319 | 319 | ||
@@ -327,7 +327,7 @@ mext_out: | |||
327 | if (err) | 327 | if (err) |
328 | return err; | 328 | return err; |
329 | err = ext4_alloc_da_blocks(inode); | 329 | err = ext4_alloc_da_blocks(inode); |
330 | mnt_drop_write(filp->f_path.mnt); | 330 | mnt_drop_write_file(filp); |
331 | return err; | 331 | return err; |
332 | } | 332 | } |
333 | 333 | ||
diff --git a/fs/fat/file.c b/fs/fat/file.c index 50746a1a0789..d81d01a99b2c 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c | |||
@@ -108,7 +108,7 @@ static int fat_ioctl_set_attributes(struct file *file, u32 __user *user_attr) | |||
108 | fat_save_attrs(inode, attr); | 108 | fat_save_attrs(inode, attr); |
109 | mark_inode_dirty(inode); | 109 | mark_inode_dirty(inode); |
110 | out_drop_write: | 110 | out_drop_write: |
111 | mnt_drop_write(file->f_path.mnt); | 111 | mnt_drop_write_file(file); |
112 | out_unlock_inode: | 112 | out_unlock_inode: |
113 | mutex_unlock(&inode->i_mutex); | 113 | mutex_unlock(&inode->i_mutex); |
114 | out: | 114 | out: |
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index 28fc6e3855f3..b8927d4f3bf2 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -285,7 +285,7 @@ out_trans_end: | |||
285 | out: | 285 | out: |
286 | gfs2_glock_dq_uninit(&gh); | 286 | gfs2_glock_dq_uninit(&gh); |
287 | out_drop_write: | 287 | out_drop_write: |
288 | mnt_drop_write(filp->f_path.mnt); | 288 | mnt_drop_write_file(filp); |
289 | return error; | 289 | return error; |
290 | } | 290 | } |
291 | 291 | ||
diff --git a/fs/hfsplus/ioctl.c b/fs/hfsplus/ioctl.c index 31d3fe576429..f66c7655b3f7 100644 --- a/fs/hfsplus/ioctl.c +++ b/fs/hfsplus/ioctl.c | |||
@@ -94,7 +94,7 @@ static int hfsplus_ioctl_setflags(struct file *file, int __user *user_flags) | |||
94 | out_unlock_inode: | 94 | out_unlock_inode: |
95 | mutex_unlock(&inode->i_mutex); | 95 | mutex_unlock(&inode->i_mutex); |
96 | out_drop_write: | 96 | out_drop_write: |
97 | mnt_drop_write(file->f_path.mnt); | 97 | mnt_drop_write_file(file); |
98 | out: | 98 | out: |
99 | return err; | 99 | return err; |
100 | } | 100 | } |
diff --git a/fs/inode.c b/fs/inode.c index ee4e66b998f4..4fda5ee85518 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1508,7 +1508,7 @@ void file_update_time(struct file *file) | |||
1508 | if (sync_it & S_MTIME) | 1508 | if (sync_it & S_MTIME) |
1509 | inode->i_mtime = now; | 1509 | inode->i_mtime = now; |
1510 | mark_inode_dirty_sync(inode); | 1510 | mark_inode_dirty_sync(inode); |
1511 | mnt_drop_write(file->f_path.mnt); | 1511 | mnt_drop_write_file(file); |
1512 | } | 1512 | } |
1513 | EXPORT_SYMBOL(file_update_time); | 1513 | EXPORT_SYMBOL(file_update_time); |
1514 | 1514 | ||
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index 73d9eaa91c05..f19d1e04a374 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c | |||
@@ -120,7 +120,7 @@ long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
120 | inode->i_ctime = CURRENT_TIME_SEC; | 120 | inode->i_ctime = CURRENT_TIME_SEC; |
121 | mark_inode_dirty(inode); | 121 | mark_inode_dirty(inode); |
122 | setflags_out: | 122 | setflags_out: |
123 | mnt_drop_write(filp->f_path.mnt); | 123 | mnt_drop_write_file(filp); |
124 | return err; | 124 | return err; |
125 | } | 125 | } |
126 | default: | 126 | default: |
diff --git a/fs/namespace.c b/fs/namespace.c index 7a8f949cec1b..86b4f6406470 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -392,6 +392,12 @@ void mnt_drop_write(struct vfsmount *mnt) | |||
392 | } | 392 | } |
393 | EXPORT_SYMBOL_GPL(mnt_drop_write); | 393 | EXPORT_SYMBOL_GPL(mnt_drop_write); |
394 | 394 | ||
395 | void mnt_drop_write_file(struct file *file) | ||
396 | { | ||
397 | mnt_drop_write(file->f_path.mnt); | ||
398 | } | ||
399 | EXPORT_SYMBOL(mnt_drop_write_file); | ||
400 | |||
395 | static int mnt_make_readonly(struct vfsmount *mnt) | 401 | static int mnt_make_readonly(struct vfsmount *mnt) |
396 | { | 402 | { |
397 | int ret = 0; | 403 | int ret = 0; |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 790e92a9ec63..6958adfaff08 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
@@ -901,7 +901,7 @@ long ncp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
901 | ret = __ncp_ioctl(inode, cmd, arg); | 901 | ret = __ncp_ioctl(inode, cmd, arg); |
902 | outDropWrite: | 902 | outDropWrite: |
903 | if (need_drop_write) | 903 | if (need_drop_write) |
904 | mnt_drop_write(filp->f_path.mnt); | 904 | mnt_drop_write_file(filp); |
905 | out: | 905 | out: |
906 | return ret; | 906 | return ret; |
907 | } | 907 | } |
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index a9aa2f161262..80a0be9ed008 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -151,7 +151,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
151 | if (status) | 151 | if (status) |
152 | goto out_put; | 152 | goto out_put; |
153 | status = vfs_mkdir(dir->d_inode, dentry, S_IRWXU); | 153 | status = vfs_mkdir(dir->d_inode, dentry, S_IRWXU); |
154 | mnt_drop_write(rec_file->f_path.mnt); | 154 | mnt_drop_write_file(rec_file); |
155 | out_put: | 155 | out_put: |
156 | dput(dentry); | 156 | dput(dentry); |
157 | out_unlock: | 157 | out_unlock: |
@@ -281,7 +281,7 @@ nfsd4_remove_clid_dir(struct nfs4_client *clp) | |||
281 | nfs4_reset_creds(original_cred); | 281 | nfs4_reset_creds(original_cred); |
282 | if (status == 0) | 282 | if (status == 0) |
283 | vfs_fsync(rec_file, 0); | 283 | vfs_fsync(rec_file, 0); |
284 | mnt_drop_write(rec_file->f_path.mnt); | 284 | mnt_drop_write_file(rec_file); |
285 | out: | 285 | out: |
286 | if (status) | 286 | if (status) |
287 | printk("NFSD: Failed to remove expired client state directory" | 287 | printk("NFSD: Failed to remove expired client state directory" |
@@ -317,7 +317,7 @@ nfsd4_recdir_purge_old(void) { | |||
317 | status = nfsd4_list_rec_dir(purge_old); | 317 | status = nfsd4_list_rec_dir(purge_old); |
318 | if (status == 0) | 318 | if (status == 0) |
319 | vfs_fsync(rec_file, 0); | 319 | vfs_fsync(rec_file, 0); |
320 | mnt_drop_write(rec_file->f_path.mnt); | 320 | mnt_drop_write_file(rec_file); |
321 | out: | 321 | out: |
322 | if (status) | 322 | if (status) |
323 | printk("nfsd4: failed to purge old clients from recovery" | 323 | printk("nfsd4: failed to purge old clients from recovery" |
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index b7697d1ccd61..886649627c3d 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_file(), mnt_drop_write() */ | 30 | #include <linux/mount.h> /* mnt_want_write_file(), mnt_drop_write_file() */ |
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" |
@@ -154,7 +154,7 @@ static int nilfs_ioctl_setflags(struct inode *inode, struct file *filp, | |||
154 | ret = nilfs_transaction_commit(inode->i_sb); | 154 | ret = nilfs_transaction_commit(inode->i_sb); |
155 | out: | 155 | out: |
156 | mutex_unlock(&inode->i_mutex); | 156 | mutex_unlock(&inode->i_mutex); |
157 | mnt_drop_write(filp->f_path.mnt); | 157 | mnt_drop_write_file(filp); |
158 | return ret; | 158 | return ret; |
159 | } | 159 | } |
160 | 160 | ||
@@ -194,7 +194,7 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp, | |||
194 | 194 | ||
195 | up_read(&inode->i_sb->s_umount); | 195 | up_read(&inode->i_sb->s_umount); |
196 | out: | 196 | out: |
197 | mnt_drop_write(filp->f_path.mnt); | 197 | mnt_drop_write_file(filp); |
198 | return ret; | 198 | return ret; |
199 | } | 199 | } |
200 | 200 | ||
@@ -225,7 +225,7 @@ nilfs_ioctl_delete_checkpoint(struct inode *inode, struct file *filp, | |||
225 | else | 225 | else |
226 | nilfs_transaction_commit(inode->i_sb); /* never fails */ | 226 | nilfs_transaction_commit(inode->i_sb); /* never fails */ |
227 | out: | 227 | out: |
228 | mnt_drop_write(filp->f_path.mnt); | 228 | mnt_drop_write_file(filp); |
229 | return ret; | 229 | return ret; |
230 | } | 230 | } |
231 | 231 | ||
@@ -675,7 +675,7 @@ out_free: | |||
675 | vfree(kbufs[n]); | 675 | vfree(kbufs[n]); |
676 | kfree(kbufs[4]); | 676 | kfree(kbufs[4]); |
677 | out: | 677 | out: |
678 | mnt_drop_write(filp->f_path.mnt); | 678 | mnt_drop_write_file(filp); |
679 | return ret; | 679 | return ret; |
680 | } | 680 | } |
681 | 681 | ||
@@ -721,7 +721,7 @@ static int nilfs_ioctl_resize(struct inode *inode, struct file *filp, | |||
721 | ret = nilfs_resize_fs(inode->i_sb, newsize); | 721 | ret = nilfs_resize_fs(inode->i_sb, newsize); |
722 | 722 | ||
723 | out_drop_write: | 723 | out_drop_write: |
724 | mnt_drop_write(filp->f_path.mnt); | 724 | mnt_drop_write_file(filp); |
725 | out: | 725 | out: |
726 | return ret; | 726 | return ret; |
727 | } | 727 | } |
diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index 892ace253f97..a6fda3c188aa 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c | |||
@@ -911,7 +911,7 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
911 | return status; | 911 | return status; |
912 | status = ocfs2_set_inode_attr(inode, flags, | 912 | status = ocfs2_set_inode_attr(inode, flags, |
913 | OCFS2_FL_MODIFIABLE); | 913 | OCFS2_FL_MODIFIABLE); |
914 | mnt_drop_write(filp->f_path.mnt); | 914 | mnt_drop_write_file(filp); |
915 | return status; | 915 | return status; |
916 | case OCFS2_IOC_RESVSP: | 916 | case OCFS2_IOC_RESVSP: |
917 | case OCFS2_IOC_RESVSP64: | 917 | case OCFS2_IOC_RESVSP64: |
diff --git a/fs/ocfs2/move_extents.c b/fs/ocfs2/move_extents.c index 1d3bf83f8b85..b1e3fce72ea4 100644 --- a/fs/ocfs2/move_extents.c +++ b/fs/ocfs2/move_extents.c | |||
@@ -1145,7 +1145,7 @@ out: | |||
1145 | 1145 | ||
1146 | kfree(context); | 1146 | kfree(context); |
1147 | 1147 | ||
1148 | mnt_drop_write(filp->f_path.mnt); | 1148 | mnt_drop_write_file(filp); |
1149 | 1149 | ||
1150 | return status; | 1150 | return status; |
1151 | } | 1151 | } |
@@ -608,7 +608,7 @@ SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group) | |||
608 | dentry = file->f_path.dentry; | 608 | dentry = file->f_path.dentry; |
609 | audit_inode(NULL, dentry); | 609 | audit_inode(NULL, dentry); |
610 | error = chown_common(&file->f_path, user, group); | 610 | error = chown_common(&file->f_path, user, group); |
611 | mnt_drop_write(file->f_path.mnt); | 611 | mnt_drop_write_file(file); |
612 | out_fput: | 612 | out_fput: |
613 | fput(file); | 613 | fput(file); |
614 | out: | 614 | out: |
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c index 0b94d7b2b11f..950e3d1b5c9e 100644 --- a/fs/reiserfs/ioctl.c +++ b/fs/reiserfs/ioctl.c | |||
@@ -96,7 +96,7 @@ long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
96 | inode->i_ctime = CURRENT_TIME_SEC; | 96 | inode->i_ctime = CURRENT_TIME_SEC; |
97 | mark_inode_dirty(inode); | 97 | mark_inode_dirty(inode); |
98 | setflags_out: | 98 | setflags_out: |
99 | mnt_drop_write(filp->f_path.mnt); | 99 | mnt_drop_write_file(filp); |
100 | break; | 100 | break; |
101 | } | 101 | } |
102 | case REISERFS_IOC_GETVERSION: | 102 | case REISERFS_IOC_GETVERSION: |
@@ -117,7 +117,7 @@ setflags_out: | |||
117 | inode->i_ctime = CURRENT_TIME_SEC; | 117 | inode->i_ctime = CURRENT_TIME_SEC; |
118 | mark_inode_dirty(inode); | 118 | mark_inode_dirty(inode); |
119 | setversion_out: | 119 | setversion_out: |
120 | mnt_drop_write(filp->f_path.mnt); | 120 | mnt_drop_write_file(filp); |
121 | break; | 121 | break; |
122 | default: | 122 | default: |
123 | err = -ENOTTY; | 123 | err = -ENOTTY; |
diff --git a/fs/ubifs/ioctl.c b/fs/ubifs/ioctl.c index e52c84598feb..1a7e2d8bdbe9 100644 --- a/fs/ubifs/ioctl.c +++ b/fs/ubifs/ioctl.c | |||
@@ -178,7 +178,7 @@ long ubifs_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
178 | return err; | 178 | return err; |
179 | dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags); | 179 | dbg_gen("set flags: %#x, i_flags %#x", flags, inode->i_flags); |
180 | err = setflags(inode, flags); | 180 | err = setflags(inode, flags); |
181 | mnt_drop_write(file->f_path.mnt); | 181 | mnt_drop_write_file(file); |
182 | return err; | 182 | return err; |
183 | } | 183 | } |
184 | 184 | ||
diff --git a/fs/xattr.c b/fs/xattr.c index 67583de8218c..82f43376c7cd 100644 --- a/fs/xattr.c +++ b/fs/xattr.c | |||
@@ -397,7 +397,7 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name, | |||
397 | error = mnt_want_write_file(f); | 397 | error = mnt_want_write_file(f); |
398 | if (!error) { | 398 | if (!error) { |
399 | error = setxattr(dentry, name, value, size, flags); | 399 | error = setxattr(dentry, name, value, size, flags); |
400 | mnt_drop_write(f->f_path.mnt); | 400 | mnt_drop_write_file(f); |
401 | } | 401 | } |
402 | fput(f); | 402 | fput(f); |
403 | return error; | 403 | return error; |
@@ -624,7 +624,7 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, const char __user *, name) | |||
624 | error = mnt_want_write_file(f); | 624 | error = mnt_want_write_file(f); |
625 | if (!error) { | 625 | if (!error) { |
626 | error = removexattr(dentry, name); | 626 | error = removexattr(dentry, name); |
627 | mnt_drop_write(f->f_path.mnt); | 627 | mnt_drop_write_file(f); |
628 | } | 628 | } |
629 | fput(f); | 629 | fput(f); |
630 | return error; | 630 | return error; |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index b436e17c753e..76f3ca5cfc36 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -566,7 +566,7 @@ xfs_attrmulti_by_handle( | |||
566 | dentry->d_inode, attr_name, | 566 | dentry->d_inode, attr_name, |
567 | ops[i].am_attrvalue, ops[i].am_length, | 567 | ops[i].am_attrvalue, ops[i].am_length, |
568 | ops[i].am_flags); | 568 | ops[i].am_flags); |
569 | mnt_drop_write(parfilp->f_path.mnt); | 569 | mnt_drop_write_file(parfilp); |
570 | break; | 570 | break; |
571 | case ATTR_OP_REMOVE: | 571 | case ATTR_OP_REMOVE: |
572 | ops[i].am_error = mnt_want_write_file(parfilp); | 572 | ops[i].am_error = mnt_want_write_file(parfilp); |
@@ -575,7 +575,7 @@ xfs_attrmulti_by_handle( | |||
575 | ops[i].am_error = xfs_attrmulti_attr_remove( | 575 | ops[i].am_error = xfs_attrmulti_attr_remove( |
576 | dentry->d_inode, attr_name, | 576 | dentry->d_inode, attr_name, |
577 | ops[i].am_flags); | 577 | ops[i].am_flags); |
578 | mnt_drop_write(parfilp->f_path.mnt); | 578 | mnt_drop_write_file(parfilp); |
579 | break; | 579 | break; |
580 | default: | 580 | default: |
581 | ops[i].am_error = EINVAL; | 581 | ops[i].am_error = EINVAL; |
diff --git a/fs/xfs/xfs_ioctl32.c b/fs/xfs/xfs_ioctl32.c index dd4ba1d4c582..f9ccb7b7c043 100644 --- a/fs/xfs/xfs_ioctl32.c +++ b/fs/xfs/xfs_ioctl32.c | |||
@@ -461,7 +461,7 @@ xfs_compat_attrmulti_by_handle( | |||
461 | dentry->d_inode, attr_name, | 461 | dentry->d_inode, attr_name, |
462 | compat_ptr(ops[i].am_attrvalue), | 462 | compat_ptr(ops[i].am_attrvalue), |
463 | ops[i].am_length, ops[i].am_flags); | 463 | ops[i].am_length, ops[i].am_flags); |
464 | mnt_drop_write(parfilp->f_path.mnt); | 464 | mnt_drop_write_file(parfilp); |
465 | break; | 465 | break; |
466 | case ATTR_OP_REMOVE: | 466 | case ATTR_OP_REMOVE: |
467 | ops[i].am_error = mnt_want_write_file(parfilp); | 467 | ops[i].am_error = mnt_want_write_file(parfilp); |
@@ -470,7 +470,7 @@ xfs_compat_attrmulti_by_handle( | |||
470 | ops[i].am_error = xfs_attrmulti_attr_remove( | 470 | ops[i].am_error = xfs_attrmulti_attr_remove( |
471 | dentry->d_inode, attr_name, | 471 | dentry->d_inode, attr_name, |
472 | ops[i].am_flags); | 472 | ops[i].am_flags); |
473 | mnt_drop_write(parfilp->f_path.mnt); | 473 | mnt_drop_write_file(parfilp); |
474 | break; | 474 | break; |
475 | default: | 475 | default: |
476 | ops[i].am_error = EINVAL; | 476 | ops[i].am_error = EINVAL; |
diff --git a/include/linux/mount.h b/include/linux/mount.h index 65c1bb013836..00f5c4f2160b 100644 --- a/include/linux/mount.h +++ b/include/linux/mount.h | |||
@@ -94,6 +94,7 @@ extern int mnt_want_write(struct vfsmount *mnt); | |||
94 | extern int mnt_want_write_file(struct file *file); | 94 | extern int mnt_want_write_file(struct file *file); |
95 | extern int mnt_clone_write(struct vfsmount *mnt); | 95 | extern int mnt_clone_write(struct vfsmount *mnt); |
96 | extern void mnt_drop_write(struct vfsmount *mnt); | 96 | extern void mnt_drop_write(struct vfsmount *mnt); |
97 | extern void mnt_drop_write_file(struct file *file); | ||
97 | extern void mntput(struct vfsmount *mnt); | 98 | extern void mntput(struct vfsmount *mnt); |
98 | extern struct vfsmount *mntget(struct vfsmount *mnt); | 99 | extern struct vfsmount *mntget(struct vfsmount *mnt); |
99 | extern void mnt_pin(struct vfsmount *mnt); | 100 | extern void mnt_pin(struct vfsmount *mnt); |