aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/xattr_acl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/xattr_acl.c')
-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 3dc38f1206fc..26b08acf913f 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