aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_acl.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-23 00:18:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-25 14:27:30 -0400
commitbc26ab5f65ae41b71df86ea46df3c3833d1d8d83 (patch)
tree85bbc4e0da4fac99ccf31b3609c61e2b148a8498 /fs/xfs/linux-2.6/xfs_acl.c
parent4482a087d4c5a6ffbc385c56b4a4e2f694d9fd5d (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/xfs/linux-2.6/xfs_acl.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_acl.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_acl.c b/fs/xfs/linux-2.6/xfs_acl.c
index 13c4e4fd5c6e..4c554122db02 100644
--- a/fs/xfs/linux-2.6/xfs_acl.c
+++ b/fs/xfs/linux-2.6/xfs_acl.c
@@ -326,7 +326,7 @@ xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl)
326int 326int
327xfs_acl_chmod(struct inode *inode) 327xfs_acl_chmod(struct inode *inode)
328{ 328{
329 struct posix_acl *acl, *clone; 329 struct posix_acl *acl;
330 int error; 330 int error;
331 331
332 if (S_ISLNK(inode->i_mode)) 332 if (S_ISLNK(inode->i_mode))
@@ -336,16 +336,12 @@ xfs_acl_chmod(struct inode *inode)
336 if (IS_ERR(acl) || !acl) 336 if (IS_ERR(acl) || !acl)
337 return PTR_ERR(acl); 337 return PTR_ERR(acl);
338 338
339 clone = posix_acl_clone(acl, GFP_KERNEL); 339 error = posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode);
340 posix_acl_release(acl); 340 if (error)
341 if (!clone) 341 return error;
342 return -ENOMEM;
343
344 error = posix_acl_chmod_masq(clone, inode->i_mode);
345 if (!error)
346 error = xfs_set_acl(inode, ACL_TYPE_ACCESS, clone);
347 342
348 posix_acl_release(clone); 343 error = xfs_set_acl(inode, ACL_TYPE_ACCESS, acl);
344 posix_acl_release(acl);
349 return error; 345 return error;
350} 346}
351 347