diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 18:37:50 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-08-01 02:09:42 -0400 |
commit | d3fb612076eebec6f67257db0c7a9666ac7e5892 (patch) | |
tree | 5265fca258a74ffa75b845998492abb9446db72c | |
parent | 782b94cdf577b4df1feb376f372dccc28e66a771 (diff) |
switch posix_acl_create() to umode_t *
so we can pass &inode->i_mode to it
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/9p/acl.c | 4 | ||||
-rw-r--r-- | fs/9p/acl.h | 4 | ||||
-rw-r--r-- | fs/9p/vfs_inode_dotl.c | 6 | ||||
-rw-r--r-- | fs/btrfs/acl.c | 5 | ||||
-rw-r--r-- | fs/ext2/acl.c | 4 | ||||
-rw-r--r-- | fs/ext3/acl.c | 5 | ||||
-rw-r--r-- | fs/ext4/acl.c | 5 | ||||
-rw-r--r-- | fs/generic_acl.c | 7 | ||||
-rw-r--r-- | fs/gfs2/acl.c | 4 | ||||
-rw-r--r-- | fs/jffs2/acl.c | 2 | ||||
-rw-r--r-- | fs/jffs2/acl.h | 2 | ||||
-rw-r--r-- | fs/jffs2/fs.c | 2 | ||||
-rw-r--r-- | fs/jffs2/os-linux.h | 2 | ||||
-rw-r--r-- | fs/jfs/acl.c | 4 | ||||
-rw-r--r-- | fs/nfs/nfs3acl.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 6 | ||||
-rw-r--r-- | fs/ocfs2/acl.c | 2 | ||||
-rw-r--r-- | fs/posix_acl.c | 6 | ||||
-rw-r--r-- | fs/reiserfs/xattr_acl.c | 6 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_acl.c | 4 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 4 | ||||
-rw-r--r-- | include/linux/posix_acl.h | 2 |
22 files changed, 35 insertions, 53 deletions
diff --git a/fs/9p/acl.c b/fs/9p/acl.c index e9cb57f07546..ad734e3220cf 100644 --- a/fs/9p/acl.c +++ b/fs/9p/acl.c | |||
@@ -182,11 +182,11 @@ int v9fs_set_create_acl(struct dentry *dentry, | |||
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
184 | 184 | ||
185 | int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 185 | int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
186 | struct posix_acl **dpacl, struct posix_acl **pacl) | 186 | struct posix_acl **dpacl, struct posix_acl **pacl) |
187 | { | 187 | { |
188 | int retval = 0; | 188 | int retval = 0; |
189 | mode_t mode = *modep; | 189 | umode_t mode = *modep; |
190 | struct posix_acl *acl = NULL; | 190 | struct posix_acl *acl = NULL; |
191 | 191 | ||
192 | if (!S_ISLNK(mode)) { | 192 | if (!S_ISLNK(mode)) { |
diff --git a/fs/9p/acl.h b/fs/9p/acl.h index ddb7ae19d971..559556411965 100644 --- a/fs/9p/acl.h +++ b/fs/9p/acl.h | |||
@@ -20,7 +20,7 @@ extern struct posix_acl *v9fs_iop_get_acl(struct inode *inode, int type); | |||
20 | extern int v9fs_acl_chmod(struct dentry *); | 20 | extern int v9fs_acl_chmod(struct dentry *); |
21 | extern int v9fs_set_create_acl(struct dentry *, | 21 | extern int v9fs_set_create_acl(struct dentry *, |
22 | struct posix_acl **, struct posix_acl **); | 22 | struct posix_acl **, struct posix_acl **); |
23 | extern int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 23 | extern int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
24 | struct posix_acl **dpacl, struct posix_acl **pacl); | 24 | struct posix_acl **dpacl, struct posix_acl **pacl); |
25 | #else | 25 | #else |
26 | #define v9fs_iop_get_acl NULL | 26 | #define v9fs_iop_get_acl NULL |
@@ -38,7 +38,7 @@ static inline int v9fs_set_create_acl(struct dentry *dentry, | |||
38 | { | 38 | { |
39 | return 0; | 39 | return 0; |
40 | } | 40 | } |
41 | static inline int v9fs_acl_mode(struct inode *dir, mode_t *modep, | 41 | static inline int v9fs_acl_mode(struct inode *dir, umode_t *modep, |
42 | struct posix_acl **dpacl, | 42 | struct posix_acl **dpacl, |
43 | struct posix_acl **pacl) | 43 | struct posix_acl **pacl) |
44 | { | 44 | { |
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 9a26dce5a99f..b6c8ed205192 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c | |||
@@ -206,7 +206,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, | |||
206 | int err = 0; | 206 | int err = 0; |
207 | gid_t gid; | 207 | gid_t gid; |
208 | int flags; | 208 | int flags; |
209 | mode_t mode; | 209 | umode_t mode; |
210 | char *name = NULL; | 210 | char *name = NULL; |
211 | struct file *filp; | 211 | struct file *filp; |
212 | struct p9_qid qid; | 212 | struct p9_qid qid; |
@@ -348,7 +348,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, | |||
348 | struct p9_fid *fid = NULL, *dfid = NULL; | 348 | struct p9_fid *fid = NULL, *dfid = NULL; |
349 | gid_t gid; | 349 | gid_t gid; |
350 | char *name; | 350 | char *name; |
351 | mode_t mode; | 351 | umode_t mode; |
352 | struct inode *inode; | 352 | struct inode *inode; |
353 | struct p9_qid qid; | 353 | struct p9_qid qid; |
354 | struct dentry *dir_dentry; | 354 | struct dentry *dir_dentry; |
@@ -751,7 +751,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, | |||
751 | int err; | 751 | int err; |
752 | gid_t gid; | 752 | gid_t gid; |
753 | char *name; | 753 | char *name; |
754 | mode_t mode; | 754 | umode_t mode; |
755 | struct v9fs_session_info *v9ses; | 755 | struct v9fs_session_info *v9ses; |
756 | struct p9_fid *fid = NULL, *dfid = NULL; | 756 | struct p9_fid *fid = NULL, *dfid = NULL; |
757 | struct inode *inode; | 757 | struct inode *inode; |
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 65a735d8f6e4..59086142c14d 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -222,19 +222,16 @@ int btrfs_init_acl(struct btrfs_trans_handle *trans, | |||
222 | } | 222 | } |
223 | 223 | ||
224 | if (IS_POSIXACL(dir) && acl) { | 224 | if (IS_POSIXACL(dir) && acl) { |
225 | mode_t mode = inode->i_mode; | ||
226 | |||
227 | if (S_ISDIR(inode->i_mode)) { | 225 | if (S_ISDIR(inode->i_mode)) { |
228 | ret = btrfs_set_acl(trans, inode, acl, | 226 | ret = btrfs_set_acl(trans, inode, acl, |
229 | ACL_TYPE_DEFAULT); | 227 | ACL_TYPE_DEFAULT); |
230 | if (ret) | 228 | if (ret) |
231 | goto failed; | 229 | goto failed; |
232 | } | 230 | } |
233 | ret = posix_acl_create(&acl, GFP_NOFS, &mode); | 231 | ret = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
234 | if (ret < 0) | 232 | if (ret < 0) |
235 | return ret; | 233 | return ret; |
236 | 234 | ||
237 | inode->i_mode = mode; | ||
238 | if (ret > 0) { | 235 | if (ret > 0) { |
239 | /* we need an acl */ | 236 | /* we need an acl */ |
240 | ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); | 237 | ret = btrfs_set_acl(trans, inode, acl, ACL_TYPE_ACCESS); |
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index 52c053763942..0ce740489ab1 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -253,16 +253,14 @@ ext2_init_acl(struct inode *inode, struct inode *dir) | |||
253 | inode->i_mode &= ~current_umask(); | 253 | inode->i_mode &= ~current_umask(); |
254 | } | 254 | } |
255 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 255 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
256 | mode_t mode = inode->i_mode; | ||
257 | if (S_ISDIR(inode->i_mode)) { | 256 | if (S_ISDIR(inode->i_mode)) { |
258 | error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl); | 257 | error = ext2_set_acl(inode, ACL_TYPE_DEFAULT, acl); |
259 | if (error) | 258 | if (error) |
260 | goto cleanup; | 259 | goto cleanup; |
261 | } | 260 | } |
262 | error = posix_acl_create(&acl, GFP_KERNEL, &mode); | 261 | error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
263 | if (error < 0) | 262 | if (error < 0) |
264 | return error; | 263 | return error; |
265 | inode->i_mode = mode; | ||
266 | if (error > 0) { | 264 | if (error > 0) { |
267 | /* This is an extended ACL */ | 265 | /* This is an extended ACL */ |
268 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); | 266 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c index 6c29bf0df04a..74a3c6486f8f 100644 --- a/fs/ext3/acl.c +++ b/fs/ext3/acl.c | |||
@@ -261,19 +261,16 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
261 | inode->i_mode &= ~current_umask(); | 261 | inode->i_mode &= ~current_umask(); |
262 | } | 262 | } |
263 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 263 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
264 | mode_t mode = inode->i_mode; | ||
265 | |||
266 | if (S_ISDIR(inode->i_mode)) { | 264 | if (S_ISDIR(inode->i_mode)) { |
267 | error = ext3_set_acl(handle, inode, | 265 | error = ext3_set_acl(handle, inode, |
268 | ACL_TYPE_DEFAULT, acl); | 266 | ACL_TYPE_DEFAULT, acl); |
269 | if (error) | 267 | if (error) |
270 | goto cleanup; | 268 | goto cleanup; |
271 | } | 269 | } |
272 | error = posix_acl_create(&acl, GFP_NOFS, &mode); | 270 | error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
273 | if (error < 0) | 271 | if (error < 0) |
274 | return error; | 272 | return error; |
275 | 273 | ||
276 | inode->i_mode = mode; | ||
277 | if (error > 0) { | 274 | if (error > 0) { |
278 | /* This is an extended ACL */ | 275 | /* This is an extended ACL */ |
279 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); | 276 | error = ext3_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c index dca2d1ded931..74e469ccdf50 100644 --- a/fs/ext4/acl.c +++ b/fs/ext4/acl.c | |||
@@ -259,19 +259,16 @@ ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) | |||
259 | inode->i_mode &= ~current_umask(); | 259 | inode->i_mode &= ~current_umask(); |
260 | } | 260 | } |
261 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { | 261 | if (test_opt(inode->i_sb, POSIX_ACL) && acl) { |
262 | mode_t mode = inode->i_mode; | ||
263 | |||
264 | if (S_ISDIR(inode->i_mode)) { | 262 | if (S_ISDIR(inode->i_mode)) { |
265 | error = ext4_set_acl(handle, inode, | 263 | error = ext4_set_acl(handle, inode, |
266 | ACL_TYPE_DEFAULT, acl); | 264 | ACL_TYPE_DEFAULT, acl); |
267 | if (error) | 265 | if (error) |
268 | goto cleanup; | 266 | goto cleanup; |
269 | } | 267 | } |
270 | error = posix_acl_create(&acl, GFP_NOFS, &mode); | 268 | error = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
271 | if (error < 0) | 269 | if (error < 0) |
272 | return error; | 270 | return error; |
273 | 271 | ||
274 | inode->i_mode = mode; | ||
275 | if (error > 0) { | 272 | if (error > 0) { |
276 | /* This is an extended ACL */ | 273 | /* This is an extended ACL */ |
277 | error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); | 274 | error = ext4_set_acl(handle, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/generic_acl.c b/fs/generic_acl.c index d5e33a077a67..2dd434d6ff29 100644 --- a/fs/generic_acl.c +++ b/fs/generic_acl.c | |||
@@ -125,21 +125,20 @@ int | |||
125 | generic_acl_init(struct inode *inode, struct inode *dir) | 125 | generic_acl_init(struct inode *inode, struct inode *dir) |
126 | { | 126 | { |
127 | struct posix_acl *acl = NULL; | 127 | struct posix_acl *acl = NULL; |
128 | mode_t mode = inode->i_mode; | ||
129 | int error; | 128 | int error; |
130 | 129 | ||
131 | inode->i_mode = mode & ~current_umask(); | ||
132 | if (!S_ISLNK(inode->i_mode)) | 130 | if (!S_ISLNK(inode->i_mode)) |
133 | acl = get_cached_acl(dir, ACL_TYPE_DEFAULT); | 131 | acl = get_cached_acl(dir, ACL_TYPE_DEFAULT); |
134 | if (acl) { | 132 | if (acl) { |
135 | if (S_ISDIR(inode->i_mode)) | 133 | if (S_ISDIR(inode->i_mode)) |
136 | set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); | 134 | set_cached_acl(inode, ACL_TYPE_DEFAULT, acl); |
137 | error = posix_acl_create(&acl, GFP_KERNEL, &mode); | 135 | error = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
138 | if (error < 0) | 136 | if (error < 0) |
139 | return error; | 137 | return error; |
140 | inode->i_mode = mode; | ||
141 | if (error > 0) | 138 | if (error > 0) |
142 | set_cached_acl(inode, ACL_TYPE_ACCESS, acl); | 139 | set_cached_acl(inode, ACL_TYPE_ACCESS, acl); |
140 | } else { | ||
141 | inode->i_mode &= ~current_umask(); | ||
143 | } | 142 | } |
144 | error = 0; | 143 | error = 0; |
145 | 144 | ||
diff --git a/fs/gfs2/acl.c b/fs/gfs2/acl.c index 884c9af0542f..0ac3c53f928f 100644 --- a/fs/gfs2/acl.c +++ b/fs/gfs2/acl.c | |||
@@ -72,7 +72,7 @@ struct posix_acl *gfs2_get_acl(struct inode *inode, int type) | |||
72 | return gfs2_acl_get(GFS2_I(inode), type); | 72 | return gfs2_acl_get(GFS2_I(inode), type); |
73 | } | 73 | } |
74 | 74 | ||
75 | static int gfs2_set_mode(struct inode *inode, mode_t mode) | 75 | static int gfs2_set_mode(struct inode *inode, umode_t mode) |
76 | { | 76 | { |
77 | int error = 0; | 77 | int error = 0; |
78 | 78 | ||
@@ -117,7 +117,7 @@ int gfs2_acl_create(struct gfs2_inode *dip, struct inode *inode) | |||
117 | { | 117 | { |
118 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); | 118 | struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); |
119 | struct posix_acl *acl; | 119 | struct posix_acl *acl; |
120 | mode_t mode = inode->i_mode; | 120 | umode_t mode = inode->i_mode; |
121 | int error = 0; | 121 | int error = 0; |
122 | 122 | ||
123 | if (!sdp->sd_args.ar_posix_acl) | 123 | if (!sdp->sd_args.ar_posix_acl) |
diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 27c511a1cf05..6372a84728d7 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c | |||
@@ -259,7 +259,7 @@ static int jffs2_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
259 | return rc; | 259 | return rc; |
260 | } | 260 | } |
261 | 261 | ||
262 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, mode_t *i_mode) | 262 | int jffs2_init_acl_pre(struct inode *dir_i, struct inode *inode, umode_t *i_mode) |
263 | { | 263 | { |
264 | struct posix_acl *acl; | 264 | struct posix_acl *acl; |
265 | int rc; | 265 | int rc; |
diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index b3421c78d9f8..9b477246f2a6 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h | |||
@@ -28,7 +28,7 @@ struct jffs2_acl_header { | |||
28 | 28 | ||
29 | struct posix_acl *jffs2_get_acl(struct inode *inode, int type); | 29 | struct posix_acl *jffs2_get_acl(struct inode *inode, int type); |
30 | extern int jffs2_acl_chmod(struct inode *); | 30 | extern int jffs2_acl_chmod(struct inode *); |
31 | extern int jffs2_init_acl_pre(struct inode *, struct inode *, mode_t *); | 31 | extern int jffs2_init_acl_pre(struct inode *, struct inode *, umode_t *); |
32 | extern int jffs2_init_acl_post(struct inode *); | 32 | extern int jffs2_init_acl_post(struct inode *); |
33 | 33 | ||
34 | extern const struct xattr_handler jffs2_acl_access_xattr_handler; | 34 | extern const struct xattr_handler jffs2_acl_access_xattr_handler; |
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index b81b35ddf4e4..bbcb9755dd2b 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -406,7 +406,7 @@ int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) | |||
406 | 406 | ||
407 | /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, | 407 | /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, |
408 | fill in the raw_inode while you're at it. */ | 408 | fill in the raw_inode while you're at it. */ |
409 | struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, struct jffs2_raw_inode *ri) | 409 | struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, struct jffs2_raw_inode *ri) |
410 | { | 410 | { |
411 | struct inode *inode; | 411 | struct inode *inode; |
412 | struct super_block *sb = dir_i->i_sb; | 412 | struct super_block *sb = dir_i->i_sb; |
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 526979c607b6..6c1755c59c0f 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h | |||
@@ -173,7 +173,7 @@ int jffs2_do_setattr (struct inode *, struct iattr *); | |||
173 | struct inode *jffs2_iget(struct super_block *, unsigned long); | 173 | struct inode *jffs2_iget(struct super_block *, unsigned long); |
174 | void jffs2_evict_inode (struct inode *); | 174 | void jffs2_evict_inode (struct inode *); |
175 | void jffs2_dirty_inode(struct inode *inode, int flags); | 175 | void jffs2_dirty_inode(struct inode *inode, int flags); |
176 | struct inode *jffs2_new_inode (struct inode *dir_i, mode_t mode, | 176 | struct inode *jffs2_new_inode (struct inode *dir_i, umode_t mode, |
177 | struct jffs2_raw_inode *ri); | 177 | struct jffs2_raw_inode *ri); |
178 | int jffs2_statfs (struct dentry *, struct kstatfs *); | 178 | int jffs2_statfs (struct dentry *, struct kstatfs *); |
179 | int jffs2_remount_fs (struct super_block *, int *, char *); | 179 | int jffs2_remount_fs (struct super_block *, int *, char *); |
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index b3a32caf2b45..45559dc3ea2f 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -127,16 +127,14 @@ int jfs_init_acl(tid_t tid, struct inode *inode, struct inode *dir) | |||
127 | return PTR_ERR(acl); | 127 | return PTR_ERR(acl); |
128 | 128 | ||
129 | if (acl) { | 129 | if (acl) { |
130 | mode_t mode = inode->i_mode; | ||
131 | if (S_ISDIR(inode->i_mode)) { | 130 | if (S_ISDIR(inode->i_mode)) { |
132 | rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); | 131 | rc = jfs_set_acl(tid, inode, ACL_TYPE_DEFAULT, acl); |
133 | if (rc) | 132 | if (rc) |
134 | goto cleanup; | 133 | goto cleanup; |
135 | } | 134 | } |
136 | rc = posix_acl_create(&acl, GFP_KERNEL, &mode); | 135 | rc = posix_acl_create(&acl, GFP_KERNEL, &inode->i_mode); |
137 | if (rc < 0) | 136 | if (rc < 0) |
138 | goto cleanup; /* posix_acl_release(NULL) is no-op */ | 137 | goto cleanup; /* posix_acl_release(NULL) is no-op */ |
139 | inode->i_mode = mode; | ||
140 | if (rc > 0) | 138 | if (rc > 0) |
141 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); | 139 | rc = jfs_set_acl(tid, inode, ACL_TYPE_ACCESS, acl); |
142 | cleanup: | 140 | cleanup: |
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c index e49e73107e62..7ef23979896d 100644 --- a/fs/nfs/nfs3acl.c +++ b/fs/nfs/nfs3acl.c | |||
@@ -415,7 +415,7 @@ fail: | |||
415 | } | 415 | } |
416 | 416 | ||
417 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | 417 | int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, |
418 | mode_t mode) | 418 | umode_t mode) |
419 | { | 419 | { |
420 | struct posix_acl *dfacl, *acl; | 420 | struct posix_acl *dfacl, *acl; |
421 | int error = 0; | 421 | int error = 0; |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 38053d823eb0..85f1690ca08c 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -316,7 +316,7 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
316 | int flags, struct nfs_open_context *ctx) | 316 | int flags, struct nfs_open_context *ctx) |
317 | { | 317 | { |
318 | struct nfs3_createdata *data; | 318 | struct nfs3_createdata *data; |
319 | mode_t mode = sattr->ia_mode; | 319 | umode_t mode = sattr->ia_mode; |
320 | int status = -ENOMEM; | 320 | int status = -ENOMEM; |
321 | 321 | ||
322 | dprintk("NFS call create %s\n", dentry->d_name.name); | 322 | dprintk("NFS call create %s\n", dentry->d_name.name); |
@@ -562,7 +562,7 @@ static int | |||
562 | nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) | 562 | nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr) |
563 | { | 563 | { |
564 | struct nfs3_createdata *data; | 564 | struct nfs3_createdata *data; |
565 | int mode = sattr->ia_mode; | 565 | umode_t mode = sattr->ia_mode; |
566 | int status = -ENOMEM; | 566 | int status = -ENOMEM; |
567 | 567 | ||
568 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); | 568 | dprintk("NFS call mkdir %s\n", dentry->d_name.name); |
@@ -681,7 +681,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr, | |||
681 | dev_t rdev) | 681 | dev_t rdev) |
682 | { | 682 | { |
683 | struct nfs3_createdata *data; | 683 | struct nfs3_createdata *data; |
684 | mode_t mode = sattr->ia_mode; | 684 | umode_t mode = sattr->ia_mode; |
685 | int status = -ENOMEM; | 685 | int status = -ENOMEM; |
686 | 686 | ||
687 | dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name, | 687 | dprintk("NFS call mknod %s %u:%u\n", dentry->d_name.name, |
diff --git a/fs/ocfs2/acl.c b/fs/ocfs2/acl.c index 783c58d9daf1..fbafc6e36e25 100644 --- a/fs/ocfs2/acl.c +++ b/fs/ocfs2/acl.c | |||
@@ -351,7 +351,7 @@ int ocfs2_init_acl(handle_t *handle, | |||
351 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 351 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
352 | struct posix_acl *acl = NULL; | 352 | struct posix_acl *acl = NULL; |
353 | int ret = 0, ret2; | 353 | int ret = 0, ret2; |
354 | mode_t mode; | 354 | umode_t mode; |
355 | 355 | ||
356 | if (!S_ISLNK(inode->i_mode)) { | 356 | if (!S_ISLNK(inode->i_mode)) { |
357 | if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) { | 357 | if (osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) { |
diff --git a/fs/posix_acl.c b/fs/posix_acl.c index d43729a760e2..f0a017edee1e 100644 --- a/fs/posix_acl.c +++ b/fs/posix_acl.c | |||
@@ -279,11 +279,11 @@ check_perm: | |||
279 | * system calls. All permissions that are not granted by the acl are removed. | 279 | * system calls. All permissions that are not granted by the acl are removed. |
280 | * The permissions in the acl are changed to reflect the mode_p parameter. | 280 | * The permissions in the acl are changed to reflect the mode_p parameter. |
281 | */ | 281 | */ |
282 | static int posix_acl_create_masq(struct posix_acl *acl, mode_t *mode_p) | 282 | static int posix_acl_create_masq(struct posix_acl *acl, umode_t *mode_p) |
283 | { | 283 | { |
284 | struct posix_acl_entry *pa, *pe; | 284 | struct posix_acl_entry *pa, *pe; |
285 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; | 285 | struct posix_acl_entry *group_obj = NULL, *mask_obj = NULL; |
286 | mode_t mode = *mode_p; | 286 | umode_t mode = *mode_p; |
287 | int not_equiv = 0; | 287 | int not_equiv = 0; |
288 | 288 | ||
289 | /* assert(atomic_read(acl->a_refcount) == 1); */ | 289 | /* assert(atomic_read(acl->a_refcount) == 1); */ |
@@ -382,7 +382,7 @@ static int posix_acl_chmod_masq(struct posix_acl *acl, mode_t mode) | |||
382 | } | 382 | } |
383 | 383 | ||
384 | int | 384 | int |
385 | posix_acl_create(struct posix_acl **acl, gfp_t gfp, mode_t *mode_p) | 385 | posix_acl_create(struct posix_acl **acl, gfp_t gfp, umode_t *mode_p) |
386 | { | 386 | { |
387 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); | 387 | struct posix_acl *clone = posix_acl_clone(*acl, gfp); |
388 | int err = -ENOMEM; | 388 | int err = -ENOMEM; |
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 7362cf4c946a..89ebc77e0e9a 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -354,8 +354,6 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
354 | return PTR_ERR(acl); | 354 | return PTR_ERR(acl); |
355 | 355 | ||
356 | if (acl) { | 356 | if (acl) { |
357 | mode_t mode = inode->i_mode; | ||
358 | |||
359 | /* Copy the default ACL to the default ACL of a new directory */ | 357 | /* Copy the default ACL to the default ACL of a new directory */ |
360 | if (S_ISDIR(inode->i_mode)) { | 358 | if (S_ISDIR(inode->i_mode)) { |
361 | err = reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT, | 359 | err = reiserfs_set_acl(th, inode, ACL_TYPE_DEFAULT, |
@@ -366,12 +364,10 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
366 | 364 | ||
367 | /* Now we reconcile the new ACL and the mode, | 365 | /* Now we reconcile the new ACL and the mode, |
368 | potentially modifying both */ | 366 | potentially modifying both */ |
369 | err = posix_acl_create(&acl, GFP_NOFS, &mode); | 367 | err = posix_acl_create(&acl, GFP_NOFS, &inode->i_mode); |
370 | if (err < 0) | 368 | if (err < 0) |
371 | return err; | 369 | return err; |
372 | 370 | ||
373 | inode->i_mode = mode; | ||
374 | |||
375 | /* If we need an ACL.. */ | 371 | /* If we need an ACL.. */ |
376 | if (err > 0) | 372 | if (err > 0) |
377 | err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl); | 373 | err = reiserfs_set_acl(th, inode, ACL_TYPE_ACCESS, acl); |
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c index 44ce51656804..bb85500e0b88 100644 --- a/fs/xfs/linux-2.6/xfs_acl.c +++ b/fs/xfs/linux-2.6/xfs_acl.c | |||
@@ -221,7 +221,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
221 | } | 221 | } |
222 | 222 | ||
223 | static int | 223 | static int |
224 | xfs_set_mode(struct inode *inode, mode_t mode) | 224 | xfs_set_mode(struct inode *inode, umode_t mode) |
225 | { | 225 | { |
226 | int error = 0; | 226 | int error = 0; |
227 | 227 | ||
@@ -267,7 +267,7 @@ posix_acl_default_exists(struct inode *inode) | |||
267 | int | 267 | int |
268 | xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) | 268 | xfs_inherit_acl(struct inode *inode, struct posix_acl *acl) |
269 | { | 269 | { |
270 | mode_t mode = inode->i_mode; | 270 | umode_t mode = inode->i_mode; |
271 | int error = 0, inherit = 0; | 271 | int error = 0, inherit = 0; |
272 | 272 | ||
273 | if (S_ISDIR(inode->i_mode)) { | 273 | if (S_ISDIR(inode->i_mode)) { |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 8b579beb6358..dda2ac8a5f7b 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -568,12 +568,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); | |||
568 | extern int nfs3_proc_setacl(struct inode *inode, int type, | 568 | extern int nfs3_proc_setacl(struct inode *inode, int type, |
569 | struct posix_acl *acl); | 569 | struct posix_acl *acl); |
570 | extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, | 570 | extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, |
571 | mode_t mode); | 571 | umode_t mode); |
572 | extern void nfs3_forget_cached_acls(struct inode *inode); | 572 | extern void nfs3_forget_cached_acls(struct inode *inode); |
573 | #else | 573 | #else |
574 | static inline int nfs3_proc_set_default_acl(struct inode *dir, | 574 | static inline int nfs3_proc_set_default_acl(struct inode *dir, |
575 | struct inode *inode, | 575 | struct inode *inode, |
576 | mode_t mode) | 576 | umode_t mode) |
577 | { | 577 | { |
578 | return 0; | 578 | return 0; |
579 | } | 579 | } |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 9a53b99818e2..bd8d0050d725 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -77,7 +77,7 @@ extern int posix_acl_valid(const struct posix_acl *); | |||
77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 77 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); | 78 | extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); |
79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); | 79 | extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); |
80 | extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *); | 80 | extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *); |
81 | extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); | 81 | extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); |
82 | 82 | ||
83 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 83 | extern struct posix_acl *get_posix_acl(struct inode *, int); |