aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_acl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-07-18 03:13:28 -0400
committerNiv Sardi <xaiki@debian.org>2008-07-28 02:59:37 -0400
commit0f285c8a1c4cacfd9f2aec077b06e2b537ee57ab (patch)
tree5b10300cfe765f13e1437d0ffa4a66a6d31d1187 /fs/xfs/xfs_acl.c
parent25fe55e814a2964c7e16d16a5d08cae6e9313a3a (diff)
[XFS] Now that xfs_setattr is only used for attributes set from ->setattr
it can be switched to take struct iattr directly and thus simplify the implementation greatly. Also rename the ATTR_ flags to XFS_ATTR_ to not conflict with the ATTR_ flags used by the VFS. SGI-PV: 984565 SGI-Modid: xfs-linux-melb:xfs-kern:31678a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Tim Shimmin <tes@sgi.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_acl.c')
-rw-r--r--fs/xfs/xfs_acl.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 93057af2fe3d..3e4648ad9cfc 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -719,7 +719,7 @@ xfs_acl_setmode(
719 xfs_acl_t *acl, 719 xfs_acl_t *acl,
720 int *basicperms) 720 int *basicperms)
721{ 721{
722 bhv_vattr_t va; 722 struct iattr iattr;
723 xfs_acl_entry_t *ap; 723 xfs_acl_entry_t *ap;
724 xfs_acl_entry_t *gap = NULL; 724 xfs_acl_entry_t *gap = NULL;
725 int i, nomask = 1; 725 int i, nomask = 1;
@@ -733,25 +733,25 @@ xfs_acl_setmode(
733 * Copy the u::, g::, o::, and m:: bits from the ACL into the 733 * Copy the u::, g::, o::, and m:: bits from the ACL into the
734 * mode. The m:: bits take precedence over the g:: bits. 734 * mode. The m:: bits take precedence over the g:: bits.
735 */ 735 */
736 va.va_mask = XFS_AT_MODE; 736 iattr.ia_valid = ATTR_MODE;
737 va.va_mode = xfs_vtoi(vp)->i_d.di_mode; 737 iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode;
738 va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); 738 iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO);
739 ap = acl->acl_entry; 739 ap = acl->acl_entry;
740 for (i = 0; i < acl->acl_cnt; ++i) { 740 for (i = 0; i < acl->acl_cnt; ++i) {
741 switch (ap->ae_tag) { 741 switch (ap->ae_tag) {
742 case ACL_USER_OBJ: 742 case ACL_USER_OBJ:
743 va.va_mode |= ap->ae_perm << 6; 743 iattr.ia_mode |= ap->ae_perm << 6;
744 break; 744 break;
745 case ACL_GROUP_OBJ: 745 case ACL_GROUP_OBJ:
746 gap = ap; 746 gap = ap;
747 break; 747 break;
748 case ACL_MASK: /* more than just standard modes */ 748 case ACL_MASK: /* more than just standard modes */
749 nomask = 0; 749 nomask = 0;
750 va.va_mode |= ap->ae_perm << 3; 750 iattr.ia_mode |= ap->ae_perm << 3;
751 *basicperms = 0; 751 *basicperms = 0;
752 break; 752 break;
753 case ACL_OTHER: 753 case ACL_OTHER:
754 va.va_mode |= ap->ae_perm; 754 iattr.ia_mode |= ap->ae_perm;
755 break; 755 break;
756 default: /* more than just standard modes */ 756 default: /* more than just standard modes */
757 *basicperms = 0; 757 *basicperms = 0;
@@ -762,9 +762,9 @@ xfs_acl_setmode(
762 762
763 /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ 763 /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */
764 if (gap && nomask) 764 if (gap && nomask)
765 va.va_mode |= gap->ae_perm << 3; 765 iattr.ia_mode |= gap->ae_perm << 3;
766 766
767 return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred); 767 return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred);
768} 768}
769 769
770/* 770/*