diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-06-20 19:28:19 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:43:24 -0400 |
commit | 10556cb21a0d0b24d95f00ea6df16f599a3345b2 (patch) | |
tree | 3d7d8dfba807805a55c154f1850717bf3b49f343 /fs | |
parent | 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890 (diff) |
->permission() sanitizing: don't pass flags to ->permission()
not used by the instances anymore.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/afs/internal.h | 2 | ||||
-rw-r--r-- | fs/afs/security.c | 4 | ||||
-rw-r--r-- | fs/bad_inode.c | 2 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 2 | ||||
-rw-r--r-- | fs/ceph/inode.c | 4 | ||||
-rw-r--r-- | fs/ceph/super.h | 2 | ||||
-rw-r--r-- | fs/cifs/cifsfs.c | 2 | ||||
-rw-r--r-- | fs/coda/coda_linux.h | 2 | ||||
-rw-r--r-- | fs/coda/dir.c | 4 | ||||
-rw-r--r-- | fs/coda/pioctl.c | 4 | ||||
-rw-r--r-- | fs/ecryptfs/inode.c | 4 | ||||
-rw-r--r-- | fs/fuse/dir.c | 14 | ||||
-rw-r--r-- | fs/gfs2/file.c | 2 | ||||
-rw-r--r-- | fs/gfs2/inode.c | 16 | ||||
-rw-r--r-- | fs/gfs2/inode.h | 2 | ||||
-rw-r--r-- | fs/hostfs/hostfs_kern.c | 4 | ||||
-rw-r--r-- | fs/namei.c | 4 | ||||
-rw-r--r-- | fs/nfs/dir.c | 4 | ||||
-rw-r--r-- | fs/nilfs2/inode.c | 2 | ||||
-rw-r--r-- | fs/nilfs2/nilfs.h | 2 | ||||
-rw-r--r-- | fs/ocfs2/file.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/file.h | 2 | ||||
-rw-r--r-- | fs/proc/base.c | 2 | ||||
-rw-r--r-- | fs/proc/proc_sysctl.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 2 | ||||
-rw-r--r-- | fs/sysfs/inode.c | 4 | ||||
-rw-r--r-- | fs/sysfs/sysfs.h | 2 |
27 files changed, 50 insertions, 50 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 5a9b6843bac1..f396d337b817 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h | |||
@@ -627,7 +627,7 @@ extern void afs_clear_permits(struct afs_vnode *); | |||
627 | extern void afs_cache_permit(struct afs_vnode *, struct key *, long); | 627 | extern void afs_cache_permit(struct afs_vnode *, struct key *, long); |
628 | extern void afs_zap_permits(struct rcu_head *); | 628 | extern void afs_zap_permits(struct rcu_head *); |
629 | extern struct key *afs_request_key(struct afs_cell *); | 629 | extern struct key *afs_request_key(struct afs_cell *); |
630 | extern int afs_permission(struct inode *, int, unsigned int); | 630 | extern int afs_permission(struct inode *, int); |
631 | 631 | ||
632 | /* | 632 | /* |
633 | * server.c | 633 | * server.c |
diff --git a/fs/afs/security.c b/fs/afs/security.c index ab6b3147f05f..8d010422dc89 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c | |||
@@ -285,14 +285,14 @@ static int afs_check_permit(struct afs_vnode *vnode, struct key *key, | |||
285 | * - AFS ACLs are attached to directories only, and a file is controlled by its | 285 | * - AFS ACLs are attached to directories only, and a file is controlled by its |
286 | * parent directory's ACL | 286 | * parent directory's ACL |
287 | */ | 287 | */ |
288 | int afs_permission(struct inode *inode, int mask, unsigned int flags) | 288 | int afs_permission(struct inode *inode, int mask) |
289 | { | 289 | { |
290 | struct afs_vnode *vnode = AFS_FS_I(inode); | 290 | struct afs_vnode *vnode = AFS_FS_I(inode); |
291 | afs_access_t uninitialized_var(access); | 291 | afs_access_t uninitialized_var(access); |
292 | struct key *key; | 292 | struct key *key; |
293 | int ret; | 293 | int ret; |
294 | 294 | ||
295 | if (flags & IPERM_FLAG_RCU) | 295 | if (mask & MAY_NOT_BLOCK) |
296 | return -ECHILD; | 296 | return -ECHILD; |
297 | 297 | ||
298 | _enter("{{%x:%u},%lx},%x,", | 298 | _enter("{{%x:%u},%lx},%x,", |
diff --git a/fs/bad_inode.c b/fs/bad_inode.c index bfcb18feb1df..f024d8aaddef 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c | |||
@@ -229,7 +229,7 @@ static int bad_inode_readlink(struct dentry *dentry, char __user *buffer, | |||
229 | return -EIO; | 229 | return -EIO; |
230 | } | 230 | } |
231 | 231 | ||
232 | static int bad_inode_permission(struct inode *inode, int mask, unsigned int flags) | 232 | static int bad_inode_permission(struct inode *inode, int mask) |
233 | { | 233 | { |
234 | return -EIO; | 234 | return -EIO; |
235 | } | 235 | } |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index b61b0477a8ac..cb170ca51c64 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -7331,7 +7331,7 @@ static int btrfs_set_page_dirty(struct page *page) | |||
7331 | return __set_page_dirty_nobuffers(page); | 7331 | return __set_page_dirty_nobuffers(page); |
7332 | } | 7332 | } |
7333 | 7333 | ||
7334 | static int btrfs_permission(struct inode *inode, int mask, unsigned int flags) | 7334 | static int btrfs_permission(struct inode *inode, int mask) |
7335 | { | 7335 | { |
7336 | struct btrfs_root *root = BTRFS_I(inode)->root; | 7336 | struct btrfs_root *root = BTRFS_I(inode)->root; |
7337 | 7337 | ||
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 9c169741b416..dfb2831d8d85 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -1795,11 +1795,11 @@ int ceph_do_getattr(struct inode *inode, int mask) | |||
1795 | * Check inode permissions. We verify we have a valid value for | 1795 | * Check inode permissions. We verify we have a valid value for |
1796 | * the AUTH cap, then call the generic handler. | 1796 | * the AUTH cap, then call the generic handler. |
1797 | */ | 1797 | */ |
1798 | int ceph_permission(struct inode *inode, int mask, unsigned int flags) | 1798 | int ceph_permission(struct inode *inode, int mask) |
1799 | { | 1799 | { |
1800 | int err; | 1800 | int err; |
1801 | 1801 | ||
1802 | if (flags & IPERM_FLAG_RCU) | 1802 | if (mask & MAY_NOT_BLOCK) |
1803 | return -ECHILD; | 1803 | return -ECHILD; |
1804 | 1804 | ||
1805 | err = ceph_do_getattr(inode, CEPH_CAP_AUTH_SHARED); | 1805 | err = ceph_do_getattr(inode, CEPH_CAP_AUTH_SHARED); |
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index f5cabefa98dc..56c41ef47cad 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -692,7 +692,7 @@ extern void ceph_queue_invalidate(struct inode *inode); | |||
692 | extern void ceph_queue_writeback(struct inode *inode); | 692 | extern void ceph_queue_writeback(struct inode *inode); |
693 | 693 | ||
694 | extern int ceph_do_getattr(struct inode *inode, int mask); | 694 | extern int ceph_do_getattr(struct inode *inode, int mask); |
695 | extern int ceph_permission(struct inode *inode, int mask, unsigned int flags); | 695 | extern int ceph_permission(struct inode *inode, int mask); |
696 | extern int ceph_setattr(struct dentry *dentry, struct iattr *attr); | 696 | extern int ceph_setattr(struct dentry *dentry, struct iattr *attr); |
697 | extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, | 697 | extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry, |
698 | struct kstat *stat); | 698 | struct kstat *stat); |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index b285b5bcf711..cbbb55e781d3 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -224,7 +224,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
224 | return 0; | 224 | return 0; |
225 | } | 225 | } |
226 | 226 | ||
227 | static int cifs_permission(struct inode *inode, int mask, unsigned int flags) | 227 | static int cifs_permission(struct inode *inode, int mask) |
228 | { | 228 | { |
229 | struct cifs_sb_info *cifs_sb; | 229 | struct cifs_sb_info *cifs_sb; |
230 | 230 | ||
diff --git a/fs/coda/coda_linux.h b/fs/coda/coda_linux.h index 9b0c5323890b..44e17e9c21ae 100644 --- a/fs/coda/coda_linux.h +++ b/fs/coda/coda_linux.h | |||
@@ -39,7 +39,7 @@ extern const struct file_operations coda_ioctl_operations; | |||
39 | /* operations shared over more than one file */ | 39 | /* operations shared over more than one file */ |
40 | int coda_open(struct inode *i, struct file *f); | 40 | int coda_open(struct inode *i, struct file *f); |
41 | int coda_release(struct inode *i, struct file *f); | 41 | int coda_release(struct inode *i, struct file *f); |
42 | int coda_permission(struct inode *inode, int mask, unsigned int flags); | 42 | int coda_permission(struct inode *inode, int mask); |
43 | int coda_revalidate_inode(struct dentry *); | 43 | int coda_revalidate_inode(struct dentry *); |
44 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); | 44 | int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); |
45 | int coda_setattr(struct dentry *, struct iattr *); | 45 | int coda_setattr(struct dentry *, struct iattr *); |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 2b8dae4d121e..cd5532398c15 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -132,11 +132,11 @@ exit: | |||
132 | } | 132 | } |
133 | 133 | ||
134 | 134 | ||
135 | int coda_permission(struct inode *inode, int mask, unsigned int flags) | 135 | int coda_permission(struct inode *inode, int mask) |
136 | { | 136 | { |
137 | int error; | 137 | int error; |
138 | 138 | ||
139 | if (flags & IPERM_FLAG_RCU) | 139 | if (mask & MAY_NOT_BLOCK) |
140 | return -ECHILD; | 140 | return -ECHILD; |
141 | 141 | ||
142 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; | 142 | mask &= MAY_READ | MAY_WRITE | MAY_EXEC; |
diff --git a/fs/coda/pioctl.c b/fs/coda/pioctl.c index cb140ef293e4..ee0981f1375b 100644 --- a/fs/coda/pioctl.c +++ b/fs/coda/pioctl.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "coda_linux.h" | 24 | #include "coda_linux.h" |
25 | 25 | ||
26 | /* pioctl ops */ | 26 | /* pioctl ops */ |
27 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags); | 27 | static int coda_ioctl_permission(struct inode *inode, int mask); |
28 | static long coda_pioctl(struct file *filp, unsigned int cmd, | 28 | static long coda_pioctl(struct file *filp, unsigned int cmd, |
29 | unsigned long user_data); | 29 | unsigned long user_data); |
30 | 30 | ||
@@ -41,7 +41,7 @@ const struct file_operations coda_ioctl_operations = { | |||
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* the coda pioctl inode ops */ | 43 | /* the coda pioctl inode ops */ |
44 | static int coda_ioctl_permission(struct inode *inode, int mask, unsigned int flags) | 44 | static int coda_ioctl_permission(struct inode *inode, int mask) |
45 | { | 45 | { |
46 | return (mask & MAY_EXEC) ? -EACCES : 0; | 46 | return (mask & MAY_EXEC) ? -EACCES : 0; |
47 | } | 47 | } |
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 7349ade17de6..bec75f8e91ac 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c | |||
@@ -942,9 +942,9 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length) | |||
942 | } | 942 | } |
943 | 943 | ||
944 | static int | 944 | static int |
945 | ecryptfs_permission(struct inode *inode, int mask, unsigned int flags) | 945 | ecryptfs_permission(struct inode *inode, int mask) |
946 | { | 946 | { |
947 | if (flags & IPERM_FLAG_RCU) | 947 | if (mask & MAY_NOT_BLOCK) |
948 | return -ECHILD; | 948 | return -ECHILD; |
949 | return inode_permission(ecryptfs_inode_to_lower(inode), mask); | 949 | return inode_permission(ecryptfs_inode_to_lower(inode), mask); |
950 | } | 950 | } |
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 0df56b6c26e2..e2b14001cea5 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -971,9 +971,9 @@ static int fuse_access(struct inode *inode, int mask) | |||
971 | return err; | 971 | return err; |
972 | } | 972 | } |
973 | 973 | ||
974 | static int fuse_perm_getattr(struct inode *inode, int flags) | 974 | static int fuse_perm_getattr(struct inode *inode, int mask) |
975 | { | 975 | { |
976 | if (flags & IPERM_FLAG_RCU) | 976 | if (mask & MAY_NOT_BLOCK) |
977 | return -ECHILD; | 977 | return -ECHILD; |
978 | 978 | ||
979 | return fuse_do_getattr(inode, NULL, NULL); | 979 | return fuse_do_getattr(inode, NULL, NULL); |
@@ -992,7 +992,7 @@ static int fuse_perm_getattr(struct inode *inode, int flags) | |||
992 | * access request is sent. Execute permission is still checked | 992 | * access request is sent. Execute permission is still checked |
993 | * locally based on file mode. | 993 | * locally based on file mode. |
994 | */ | 994 | */ |
995 | static int fuse_permission(struct inode *inode, int mask, unsigned int flags) | 995 | static int fuse_permission(struct inode *inode, int mask) |
996 | { | 996 | { |
997 | struct fuse_conn *fc = get_fuse_conn(inode); | 997 | struct fuse_conn *fc = get_fuse_conn(inode); |
998 | bool refreshed = false; | 998 | bool refreshed = false; |
@@ -1011,7 +1011,7 @@ static int fuse_permission(struct inode *inode, int mask, unsigned int flags) | |||
1011 | if (fi->i_time < get_jiffies_64()) { | 1011 | if (fi->i_time < get_jiffies_64()) { |
1012 | refreshed = true; | 1012 | refreshed = true; |
1013 | 1013 | ||
1014 | err = fuse_perm_getattr(inode, flags); | 1014 | err = fuse_perm_getattr(inode, mask); |
1015 | if (err) | 1015 | if (err) |
1016 | return err; | 1016 | return err; |
1017 | } | 1017 | } |
@@ -1024,7 +1024,7 @@ static int fuse_permission(struct inode *inode, int mask, unsigned int flags) | |||
1024 | attributes. This is also needed, because the root | 1024 | attributes. This is also needed, because the root |
1025 | node will at first have no permissions */ | 1025 | node will at first have no permissions */ |
1026 | if (err == -EACCES && !refreshed) { | 1026 | if (err == -EACCES && !refreshed) { |
1027 | err = fuse_perm_getattr(inode, flags); | 1027 | err = fuse_perm_getattr(inode, mask); |
1028 | if (!err) | 1028 | if (!err) |
1029 | err = generic_permission(inode, mask); | 1029 | err = generic_permission(inode, mask); |
1030 | } | 1030 | } |
@@ -1034,7 +1034,7 @@ static int fuse_permission(struct inode *inode, int mask, unsigned int flags) | |||
1034 | noticed immediately, only after the attribute | 1034 | noticed immediately, only after the attribute |
1035 | timeout has expired */ | 1035 | timeout has expired */ |
1036 | } else if (mask & (MAY_ACCESS | MAY_CHDIR)) { | 1036 | } else if (mask & (MAY_ACCESS | MAY_CHDIR)) { |
1037 | if (flags & IPERM_FLAG_RCU) | 1037 | if (mask & MAY_NOT_BLOCK) |
1038 | return -ECHILD; | 1038 | return -ECHILD; |
1039 | 1039 | ||
1040 | err = fuse_access(inode, mask); | 1040 | err = fuse_access(inode, mask); |
@@ -1043,7 +1043,7 @@ static int fuse_permission(struct inode *inode, int mask, unsigned int flags) | |||
1043 | if (refreshed) | 1043 | if (refreshed) |
1044 | return -EACCES; | 1044 | return -EACCES; |
1045 | 1045 | ||
1046 | err = fuse_perm_getattr(inode, flags); | 1046 | err = fuse_perm_getattr(inode, mask); |
1047 | if (!err && !(inode->i_mode & S_IXUGO)) | 1047 | if (!err && !(inode->i_mode & S_IXUGO)) |
1048 | return -EACCES; | 1048 | return -EACCES; |
1049 | } | 1049 | } |
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c index a9f5cbe45cd9..89c39e53760d 100644 --- a/fs/gfs2/file.c +++ b/fs/gfs2/file.c | |||
@@ -243,7 +243,7 @@ static int do_gfs2_set_flags(struct file *filp, u32 reqflags, u32 mask) | |||
243 | !capable(CAP_LINUX_IMMUTABLE)) | 243 | !capable(CAP_LINUX_IMMUTABLE)) |
244 | goto out; | 244 | goto out; |
245 | if (!IS_IMMUTABLE(inode)) { | 245 | if (!IS_IMMUTABLE(inode)) { |
246 | error = gfs2_permission(inode, MAY_WRITE, 0); | 246 | error = gfs2_permission(inode, MAY_WRITE); |
247 | if (error) | 247 | if (error) |
248 | goto out; | 248 | goto out; |
249 | } | 249 | } |
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index b776ec8f9c19..b1090d66a6fd 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -307,7 +307,7 @@ struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name, | |||
307 | } | 307 | } |
308 | 308 | ||
309 | if (!is_root) { | 309 | if (!is_root) { |
310 | error = gfs2_permission(dir, MAY_EXEC, 0); | 310 | error = gfs2_permission(dir, MAY_EXEC); |
311 | if (error) | 311 | if (error) |
312 | goto out; | 312 | goto out; |
313 | } | 313 | } |
@@ -337,7 +337,7 @@ static int create_ok(struct gfs2_inode *dip, const struct qstr *name, | |||
337 | { | 337 | { |
338 | int error; | 338 | int error; |
339 | 339 | ||
340 | error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, 0); | 340 | error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC); |
341 | if (error) | 341 | if (error) |
342 | return error; | 342 | return error; |
343 | 343 | ||
@@ -857,7 +857,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir, | |||
857 | if (inode->i_nlink == 0) | 857 | if (inode->i_nlink == 0) |
858 | goto out_gunlock; | 858 | goto out_gunlock; |
859 | 859 | ||
860 | error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC, 0); | 860 | error = gfs2_permission(dir, MAY_WRITE | MAY_EXEC); |
861 | if (error) | 861 | if (error) |
862 | goto out_gunlock; | 862 | goto out_gunlock; |
863 | 863 | ||
@@ -990,7 +990,7 @@ static int gfs2_unlink_ok(struct gfs2_inode *dip, const struct qstr *name, | |||
990 | if (IS_APPEND(&dip->i_inode)) | 990 | if (IS_APPEND(&dip->i_inode)) |
991 | return -EPERM; | 991 | return -EPERM; |
992 | 992 | ||
993 | error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC, 0); | 993 | error = gfs2_permission(&dip->i_inode, MAY_WRITE | MAY_EXEC); |
994 | if (error) | 994 | if (error) |
995 | return error; | 995 | return error; |
996 | 996 | ||
@@ -1336,7 +1336,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
1336 | } | 1336 | } |
1337 | } | 1337 | } |
1338 | } else { | 1338 | } else { |
1339 | error = gfs2_permission(ndir, MAY_WRITE | MAY_EXEC, 0); | 1339 | error = gfs2_permission(ndir, MAY_WRITE | MAY_EXEC); |
1340 | if (error) | 1340 | if (error) |
1341 | goto out_gunlock; | 1341 | goto out_gunlock; |
1342 | 1342 | ||
@@ -1371,7 +1371,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry, | |||
1371 | /* Check out the dir to be renamed */ | 1371 | /* Check out the dir to be renamed */ |
1372 | 1372 | ||
1373 | if (dir_rename) { | 1373 | if (dir_rename) { |
1374 | error = gfs2_permission(odentry->d_inode, MAY_WRITE, 0); | 1374 | error = gfs2_permission(odentry->d_inode, MAY_WRITE); |
1375 | if (error) | 1375 | if (error) |
1376 | goto out_gunlock; | 1376 | goto out_gunlock; |
1377 | } | 1377 | } |
@@ -1543,7 +1543,7 @@ static void gfs2_put_link(struct dentry *dentry, struct nameidata *nd, void *p) | |||
1543 | * Returns: errno | 1543 | * Returns: errno |
1544 | */ | 1544 | */ |
1545 | 1545 | ||
1546 | int gfs2_permission(struct inode *inode, int mask, unsigned int flags) | 1546 | int gfs2_permission(struct inode *inode, int mask) |
1547 | { | 1547 | { |
1548 | struct gfs2_inode *ip; | 1548 | struct gfs2_inode *ip; |
1549 | struct gfs2_holder i_gh; | 1549 | struct gfs2_holder i_gh; |
@@ -1553,7 +1553,7 @@ int gfs2_permission(struct inode *inode, int mask, unsigned int flags) | |||
1553 | 1553 | ||
1554 | ip = GFS2_I(inode); | 1554 | ip = GFS2_I(inode); |
1555 | if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { | 1555 | if (gfs2_glock_is_locked_by_me(ip->i_gl) == NULL) { |
1556 | if (flags & IPERM_FLAG_RCU) | 1556 | if (mask & MAY_NOT_BLOCK) |
1557 | return -ECHILD; | 1557 | return -ECHILD; |
1558 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); | 1558 | error = gfs2_glock_nq_init(ip->i_gl, LM_ST_SHARED, LM_FLAG_ANY, &i_gh); |
1559 | if (error) | 1559 | if (error) |
diff --git a/fs/gfs2/inode.h b/fs/gfs2/inode.h index 31606076f701..8d90e0c07672 100644 --- a/fs/gfs2/inode.h +++ b/fs/gfs2/inode.h | |||
@@ -108,7 +108,7 @@ extern int gfs2_inode_refresh(struct gfs2_inode *ip); | |||
108 | 108 | ||
109 | extern struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name, | 109 | extern struct inode *gfs2_lookupi(struct inode *dir, const struct qstr *name, |
110 | int is_root); | 110 | int is_root); |
111 | extern int gfs2_permission(struct inode *inode, int mask, unsigned int flags); | 111 | extern int gfs2_permission(struct inode *inode, int mask); |
112 | extern int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr); | 112 | extern int gfs2_setattr_simple(struct gfs2_inode *ip, struct iattr *attr); |
113 | extern struct inode *gfs2_lookup_simple(struct inode *dip, const char *name); | 113 | extern struct inode *gfs2_lookup_simple(struct inode *dip, const char *name); |
114 | extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf); | 114 | extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf); |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index b1bc31bde833..6e449c599b9d 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -748,12 +748,12 @@ int hostfs_rename(struct inode *from_ino, struct dentry *from, | |||
748 | return err; | 748 | return err; |
749 | } | 749 | } |
750 | 750 | ||
751 | int hostfs_permission(struct inode *ino, int desired, unsigned int flags) | 751 | int hostfs_permission(struct inode *ino, int desired) |
752 | { | 752 | { |
753 | char *name; | 753 | char *name; |
754 | int r = 0, w = 0, x = 0, err; | 754 | int r = 0, w = 0, x = 0, err; |
755 | 755 | ||
756 | if (flags & IPERM_FLAG_RCU) | 756 | if (desired & MAY_NOT_BLOCK) |
757 | return -ECHILD; | 757 | return -ECHILD; |
758 | 758 | ||
759 | if (desired & MAY_READ) r = 1; | 759 | if (desired & MAY_READ) r = 1; |
diff --git a/fs/namei.c b/fs/namei.c index 684e0f30cf4c..c5c382620a86 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -287,7 +287,7 @@ int inode_permission(struct inode *inode, int mask) | |||
287 | } | 287 | } |
288 | 288 | ||
289 | if (inode->i_op->permission) | 289 | if (inode->i_op->permission) |
290 | retval = inode->i_op->permission(inode, mask, 0); | 290 | retval = inode->i_op->permission(inode, mask); |
291 | else | 291 | else |
292 | retval = generic_permission(inode, mask); | 292 | retval = generic_permission(inode, mask); |
293 | 293 | ||
@@ -323,7 +323,7 @@ static inline int exec_permission(struct inode *inode, unsigned int flags) | |||
323 | mask |= MAY_NOT_BLOCK; | 323 | mask |= MAY_NOT_BLOCK; |
324 | 324 | ||
325 | if (inode->i_op->permission) { | 325 | if (inode->i_op->permission) { |
326 | ret = inode->i_op->permission(inode, mask, flags); | 326 | ret = inode->i_op->permission(inode, mask); |
327 | if (likely(!ret)) | 327 | if (likely(!ret)) |
328 | goto ok; | 328 | goto ok; |
329 | } else { | 329 | } else { |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 16cf84b4afb9..a86acd6d0cb4 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -2273,12 +2273,12 @@ int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags) | |||
2273 | return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags)); | 2273 | return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags)); |
2274 | } | 2274 | } |
2275 | 2275 | ||
2276 | int nfs_permission(struct inode *inode, int mask, unsigned int flags) | 2276 | int nfs_permission(struct inode *inode, int mask) |
2277 | { | 2277 | { |
2278 | struct rpc_cred *cred; | 2278 | struct rpc_cred *cred; |
2279 | int res = 0; | 2279 | int res = 0; |
2280 | 2280 | ||
2281 | if (flags & IPERM_FLAG_RCU) | 2281 | if (mask & MAY_NOT_BLOCK) |
2282 | return -ECHILD; | 2282 | return -ECHILD; |
2283 | 2283 | ||
2284 | nfs_inc_stats(inode, NFSIOS_VFSACCESS); | 2284 | nfs_inc_stats(inode, NFSIOS_VFSACCESS); |
diff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c index 0df6de58bbcb..be8664c6a825 100644 --- a/fs/nilfs2/inode.c +++ b/fs/nilfs2/inode.c | |||
@@ -799,7 +799,7 @@ out_err: | |||
799 | return err; | 799 | return err; |
800 | } | 800 | } |
801 | 801 | ||
802 | int nilfs_permission(struct inode *inode, int mask, unsigned int flags) | 802 | int nilfs_permission(struct inode *inode, int mask) |
803 | { | 803 | { |
804 | struct nilfs_root *root = NILFS_I(inode)->i_root; | 804 | struct nilfs_root *root = NILFS_I(inode)->i_root; |
805 | if ((mask & MAY_WRITE) && root && | 805 | if ((mask & MAY_WRITE) && root && |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index f02b9ad43a21..6fb7511c0328 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -264,7 +264,7 @@ extern void nilfs_update_inode(struct inode *, struct buffer_head *); | |||
264 | extern void nilfs_truncate(struct inode *); | 264 | extern void nilfs_truncate(struct inode *); |
265 | extern void nilfs_evict_inode(struct inode *); | 265 | extern void nilfs_evict_inode(struct inode *); |
266 | extern int nilfs_setattr(struct dentry *, struct iattr *); | 266 | extern int nilfs_setattr(struct dentry *, struct iattr *); |
267 | int nilfs_permission(struct inode *inode, int mask, unsigned int flags); | 267 | int nilfs_permission(struct inode *inode, int mask); |
268 | int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh); | 268 | int nilfs_load_inode_block(struct inode *inode, struct buffer_head **pbh); |
269 | extern int nilfs_inode_dirty(struct inode *); | 269 | extern int nilfs_inode_dirty(struct inode *); |
270 | int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty); | 270 | int nilfs_set_file_dirty(struct inode *inode, unsigned nr_dirty); |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index ecb52b028964..1406c37a5722 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -1279,11 +1279,11 @@ bail: | |||
1279 | return err; | 1279 | return err; |
1280 | } | 1280 | } |
1281 | 1281 | ||
1282 | int ocfs2_permission(struct inode *inode, int mask, unsigned int flags) | 1282 | int ocfs2_permission(struct inode *inode, int mask) |
1283 | { | 1283 | { |
1284 | int ret; | 1284 | int ret; |
1285 | 1285 | ||
1286 | if (flags & IPERM_FLAG_RCU) | 1286 | if (mask & MAY_NOT_BLOCK) |
1287 | return -ECHILD; | 1287 | return -ECHILD; |
1288 | 1288 | ||
1289 | ret = ocfs2_inode_lock(inode, NULL, 0); | 1289 | ret = ocfs2_inode_lock(inode, NULL, 0); |
diff --git a/fs/ocfs2/file.h b/fs/ocfs2/file.h index f5afbbef6703..97bf761c9e7c 100644 --- a/fs/ocfs2/file.h +++ b/fs/ocfs2/file.h | |||
@@ -61,7 +61,7 @@ int ocfs2_zero_extend(struct inode *inode, struct buffer_head *di_bh, | |||
61 | int ocfs2_setattr(struct dentry *dentry, struct iattr *attr); | 61 | int ocfs2_setattr(struct dentry *dentry, struct iattr *attr); |
62 | int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry, | 62 | int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry, |
63 | struct kstat *stat); | 63 | struct kstat *stat); |
64 | int ocfs2_permission(struct inode *inode, int mask, unsigned int flags); | 64 | int ocfs2_permission(struct inode *inode, int mask); |
65 | 65 | ||
66 | int ocfs2_should_update_atime(struct inode *inode, | 66 | int ocfs2_should_update_atime(struct inode *inode, |
67 | struct vfsmount *vfsmnt); | 67 | struct vfsmount *vfsmnt); |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 53a1a961b25f..be1ff932033b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2167,7 +2167,7 @@ static const struct file_operations proc_fd_operations = { | |||
2167 | * /proc/pid/fd needs a special permission handler so that a process can still | 2167 | * /proc/pid/fd needs a special permission handler so that a process can still |
2168 | * access /proc/self/fd after it has executed a setuid(). | 2168 | * access /proc/self/fd after it has executed a setuid(). |
2169 | */ | 2169 | */ |
2170 | static int proc_fd_permission(struct inode *inode, int mask, unsigned int flags) | 2170 | static int proc_fd_permission(struct inode *inode, int mask) |
2171 | { | 2171 | { |
2172 | int rv = generic_permission(inode, mask); | 2172 | int rv = generic_permission(inode, mask); |
2173 | if (rv == 0) | 2173 | if (rv == 0) |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 349b22f434d8..1a77dbef226f 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c | |||
@@ -294,7 +294,7 @@ out: | |||
294 | return ret; | 294 | return ret; |
295 | } | 295 | } |
296 | 296 | ||
297 | static int proc_sys_permission(struct inode *inode, int mask,unsigned int flags) | 297 | static int proc_sys_permission(struct inode *inode, int mask) |
298 | { | 298 | { |
299 | /* | 299 | /* |
300 | * sysctl entries that are not writeable, | 300 | * sysctl entries that are not writeable, |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index f17319613a85..4ea2ab41fdee 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -958,7 +958,7 @@ static int xattr_mount_check(struct super_block *s) | |||
958 | return 0; | 958 | return 0; |
959 | } | 959 | } |
960 | 960 | ||
961 | int reiserfs_permission(struct inode *inode, int mask, unsigned int flags) | 961 | int reiserfs_permission(struct inode *inode, int mask) |
962 | { | 962 | { |
963 | /* | 963 | /* |
964 | * We don't do permission checks on the internal objects. | 964 | * We don't do permission checks on the internal objects. |
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index 04c81e5ba6f7..e3f091a81c72 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -349,11 +349,11 @@ int sysfs_hash_and_remove(struct sysfs_dirent *dir_sd, const void *ns, const cha | |||
349 | return -ENOENT; | 349 | return -ENOENT; |
350 | } | 350 | } |
351 | 351 | ||
352 | int sysfs_permission(struct inode *inode, int mask, unsigned int flags) | 352 | int sysfs_permission(struct inode *inode, int mask) |
353 | { | 353 | { |
354 | struct sysfs_dirent *sd; | 354 | struct sysfs_dirent *sd; |
355 | 355 | ||
356 | if (flags & IPERM_FLAG_RCU) | 356 | if (mask & MAY_NOT_BLOCK) |
357 | return -ECHILD; | 357 | return -ECHILD; |
358 | 358 | ||
359 | sd = inode->i_private; | 359 | sd = inode->i_private; |
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index 2ed2404f3113..845ab3ad229d 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -201,7 +201,7 @@ static inline void __sysfs_put(struct sysfs_dirent *sd) | |||
201 | struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd); | 201 | struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd); |
202 | void sysfs_evict_inode(struct inode *inode); | 202 | void sysfs_evict_inode(struct inode *inode); |
203 | int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr); | 203 | int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr); |
204 | int sysfs_permission(struct inode *inode, int mask, unsigned int flags); | 204 | int sysfs_permission(struct inode *inode, int mask); |
205 | int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); | 205 | int sysfs_setattr(struct dentry *dentry, struct iattr *iattr); |
206 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); | 206 | int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); |
207 | int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value, | 207 | int sysfs_setxattr(struct dentry *dentry, const char *name, const void *value, |