diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-23 00:18:02 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-25 14:27:30 -0400 |
commit | bc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch) | |
tree | 85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/ext2 | |
parent | 4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (diff) |
kill boilerplate around posix_acl_chmod_masq()
new helper: posix_acl_chmod(&acl, gfp, mode). Replaces acl with modified
clone or with NULL if that has failed; returns 0 or -ve on error. All
callers of posix_acl_chmod_masq() switched to that - they'd been doing
exactly the same thing.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/acl.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c index ced1c478ebdb..1226dbcc66f5 100644 --- a/fs/ext2/acl.c +++ b/fs/ext2/acl.c | |||
@@ -316,7 +316,7 @@ cleanup: | |||
316 | int | 316 | int |
317 | ext2_acl_chmod(struct inode *inode) | 317 | ext2_acl_chmod(struct inode *inode) |
318 | { | 318 | { |
319 | struct posix_acl *acl, *clone; | 319 | struct posix_acl *acl; |
320 | int error; | 320 | int error; |
321 | 321 | ||
322 | if (!test_opt(inode->i_sb, POSIX_ACL)) | 322 | if (!test_opt(inode->i_sb, POSIX_ACL)) |
@@ -326,14 +326,11 @@ ext2_acl_chmod(struct inode *inode) | |||
326 | acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); | 326 | acl = ext2_get_acl(inode, ACL_TYPE_ACCESS); |
327 | if (IS_ERR(acl) || !acl) | 327 | if (IS_ERR(acl) || !acl) |
328 | return PTR_ERR(acl); | 328 | return PTR_ERR(acl); |
329 | clone = posix_acl_clone(acl, GFP_KERNEL); | 329 | error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode); |
330 | if (error) | ||
331 | return error; | ||
332 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, acl); | ||
330 | posix_acl_release(acl); | 333 | posix_acl_release(acl); |
331 | if (!clone) | ||
332 | return -ENOMEM; | ||
333 | error = posix_acl_chmod_masq(clone, inode->i_mode); | ||
334 | if (!error) | ||
335 | error = ext2_set_acl(inode, ACL_TYPE_ACCESS, clone); | ||
336 | posix_acl_release(clone); | ||
337 | return error; | 334 | return error; |
338 | } | 335 | } |
339 | 336 | ||