aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_acl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-28 20:58:01 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 20:40:00 -0400
commit739bfb2a7dfa369324f74aad1d020d6e0775e4f0 (patch)
tree8fbe3e739e0d550137e3f148a36ce5c083f5ef2c /fs/xfs/xfs_acl.c
parent993386c19afa53fa54d00c7721e56ba820b3400d (diff)
[XFS] call common xfs vnode-level helpers directly and remove vnode operations
SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29493a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_acl.c')
-rw-r--r--fs/xfs/xfs_acl.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 4ca4beb7bb54..034c5ea80dd1 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -32,6 +32,7 @@
32#include "xfs_btree.h" 32#include "xfs_btree.h"
33#include "xfs_acl.h" 33#include "xfs_acl.h"
34#include "xfs_attr.h" 34#include "xfs_attr.h"
35#include "xfs_vnodeops.h"
35 36
36#include <linux/capability.h> 37#include <linux/capability.h>
37#include <linux/posix_acl_xattr.h> 38#include <linux/posix_acl_xattr.h>
@@ -241,7 +242,7 @@ xfs_acl_vget(
241 bhv_vattr_t va; 242 bhv_vattr_t va;
242 243
243 va.va_mask = XFS_AT_MODE; 244 va.va_mask = XFS_AT_MODE;
244 error = bhv_vop_getattr(vp, &va, 0, sys_cred); 245 error = xfs_getattr(xfs_vtoi(vp), &va, 0);
245 if (error) 246 if (error)
246 goto out; 247 goto out;
247 xfs_acl_sync_mode(va.va_mode, xfs_acl); 248 xfs_acl_sync_mode(va.va_mode, xfs_acl);
@@ -265,9 +266,10 @@ xfs_acl_vremove(
265 VN_HOLD(vp); 266 VN_HOLD(vp);
266 error = xfs_acl_allow_set(vp, kind); 267 error = xfs_acl_allow_set(vp, kind);
267 if (!error) { 268 if (!error) {
268 error = bhv_vop_attr_remove(vp, kind == _ACL_TYPE_DEFAULT? 269 error = xfs_attr_remove(xfs_vtoi(vp),
270 kind == _ACL_TYPE_DEFAULT?
269 SGI_ACL_DEFAULT: SGI_ACL_FILE, 271 SGI_ACL_DEFAULT: SGI_ACL_FILE,
270 ATTR_ROOT, sys_cred); 272 ATTR_ROOT);
271 if (error == ENOATTR) 273 if (error == ENOATTR)
272 error = 0; /* 'scool */ 274 error = 0; /* 'scool */
273 } 275 }
@@ -380,7 +382,7 @@ xfs_acl_allow_set(
380 if (vp->v_vfsp->vfs_flag & VFS_RDONLY) 382 if (vp->v_vfsp->vfs_flag & VFS_RDONLY)
381 return EROFS; 383 return EROFS;
382 va.va_mask = XFS_AT_UID; 384 va.va_mask = XFS_AT_UID;
383 error = bhv_vop_getattr(vp, &va, 0, NULL); 385 error = xfs_getattr(xfs_vtoi(vp), &va, 0);
384 if (error) 386 if (error)
385 return error; 387 return error;
386 if (va.va_uid != current->fsuid && !capable(CAP_FOWNER)) 388 if (va.va_uid != current->fsuid && !capable(CAP_FOWNER))
@@ -613,7 +615,8 @@ xfs_acl_get_attr(
613 615
614 ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1); 616 ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
615 flags |= ATTR_ROOT; 617 flags |= ATTR_ROOT;
616 *error = bhv_vop_attr_get(vp, kind == _ACL_TYPE_ACCESS ? 618 *error = xfs_attr_get(xfs_vtoi(vp),
619 kind == _ACL_TYPE_ACCESS ?
617 SGI_ACL_FILE : SGI_ACL_DEFAULT, 620 SGI_ACL_FILE : SGI_ACL_DEFAULT,
618 (char *)aclp, &len, flags, sys_cred); 621 (char *)aclp, &len, flags, sys_cred);
619 if (*error || (flags & ATTR_KERNOVAL)) 622 if (*error || (flags & ATTR_KERNOVAL))
@@ -651,9 +654,10 @@ xfs_acl_set_attr(
651 INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm); 654 INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm);
652 } 655 }
653 INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); 656 INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
654 *error = bhv_vop_attr_set(vp, kind == _ACL_TYPE_ACCESS ? 657 *error = xfs_attr_set(xfs_vtoi(vp),
658 kind == _ACL_TYPE_ACCESS ?
655 SGI_ACL_FILE: SGI_ACL_DEFAULT, 659 SGI_ACL_FILE: SGI_ACL_DEFAULT,
656 (char *)newacl, len, ATTR_ROOT, sys_cred); 660 (char *)newacl, len, ATTR_ROOT);
657 _ACL_FREE(newacl); 661 _ACL_FREE(newacl);
658} 662}
659 663
@@ -675,7 +679,7 @@ xfs_acl_vtoacl(
675 if (!error) { 679 if (!error) {
676 /* Got the ACL, need the mode... */ 680 /* Got the ACL, need the mode... */
677 va.va_mask = XFS_AT_MODE; 681 va.va_mask = XFS_AT_MODE;
678 error = bhv_vop_getattr(vp, &va, 0, sys_cred); 682 error = xfs_getattr(xfs_vtoi(vp), &va, 0);
679 } 683 }
680 684
681 if (error) 685 if (error)
@@ -773,7 +777,7 @@ xfs_acl_setmode(
773 * mode. The m:: bits take precedence over the g:: bits. 777 * mode. The m:: bits take precedence over the g:: bits.
774 */ 778 */
775 va.va_mask = XFS_AT_MODE; 779 va.va_mask = XFS_AT_MODE;
776 error = bhv_vop_getattr(vp, &va, 0, sys_cred); 780 error = xfs_getattr(xfs_vtoi(vp), &va, 0);
777 if (error) 781 if (error)
778 return error; 782 return error;
779 783
@@ -807,7 +811,7 @@ xfs_acl_setmode(
807 if (gap && nomask) 811 if (gap && nomask)
808 va.va_mode |= gap->ae_perm << 3; 812 va.va_mode |= gap->ae_perm << 3;
809 813
810 return bhv_vop_setattr(vp, &va, 0, sys_cred); 814 return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred);
811} 815}
812 816
813/* 817/*