aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
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/reiserfs
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/reiserfs')
-rw-r--r--fs/reiserfs/xattr_acl.c41
1 files changed, 18 insertions, 23 deletions
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c
index 3dc38f1206f..26b08acf913 100644
--- a/fs/reiserfs/xattr_acl.c
+++ b/fs/reiserfs/xattr_acl.c
@@ -445,7 +445,10 @@ int reiserfs_cache_default_acl(struct inode *inode)
445 445
446int reiserfs_acl_chmod(struct inode *inode) 446int reiserfs_acl_chmod(struct inode *inode)
447{ 447{
448 struct posix_acl *acl, *clone; 448 struct reiserfs_transaction_handle th;
449 struct posix_acl *acl;
450 size_t size;
451 int depth;
449 int error; 452 int error;
450 453
451 if (S_ISLNK(inode->i_mode)) 454 if (S_ISLNK(inode->i_mode))
@@ -463,30 +466,22 @@ int reiserfs_acl_chmod(struct inode *inode)
463 return 0; 466 return 0;
464 if (IS_ERR(acl)) 467 if (IS_ERR(acl))
465 return PTR_ERR(acl); 468 return PTR_ERR(acl);
466 clone = posix_acl_clone(acl, GFP_NOFS); 469 error = posix_acl_chmod(&acl, GFP_NOFS, inode->i_mode);
467 posix_acl_release(acl); 470 if (error)
468 if (!clone) 471 return error;
469 return -ENOMEM; 472
470 error = posix_acl_chmod_masq(clone, inode->i_mode); 473 size = reiserfs_xattr_nblocks(inode, reiserfs_acl_size(acl->a_count));
474 depth = reiserfs_write_lock_once(inode->i_sb);
475 error = journal_begin(&th, inode->i_sb, size * 2);
471 if (!error) { 476 if (!error) {
472 struct reiserfs_transaction_handle th; 477 int error2;
473 size_t size = reiserfs_xattr_nblocks(inode, 478 error = reiserfs_set_acl(&th, inode, ACL_TYPE_ACCESS, acl);
474 reiserfs_acl_size(clone->a_count)); 479 error2 = journal_end(&th, inode->i_sb, size * 2);
475 int depth; 480 if (error2)
476 481 error = error2;
477 depth = reiserfs_write_lock_once(inode->i_sb);
478 error = journal_begin(&th, inode->i_sb, size * 2);
479 if (!error) {
480 int error2;
481 error = reiserfs_set_acl(&th, inode, ACL_TYPE_ACCESS,
482 clone);
483 error2 = journal_end(&th, inode->i_sb, size * 2);
484 if (error2)
485 error = error2;
486 }
487 reiserfs_write_unlock_once(inode->i_sb, depth);
488 } 482 }
489 posix_acl_release(clone); 483 reiserfs_write_unlock_once(inode->i_sb, depth);
484 posix_acl_release(acl);
490 return error; 485 return error;
491} 486}
492 487