remove leftovers of shared read-only support
[safe/jmp/linux-2.6] / fs / xfs / xfs_acl.c
index fdeca54..a8cdd73 100644 (file)
 #include <linux/capability.h>
 #include <linux/posix_acl_xattr.h>
 
-STATIC int     xfs_acl_setmode(bhv_vnode_t *, xfs_acl_t *, int *);
+STATIC int     xfs_acl_setmode(struct inode *, xfs_acl_t *, int *);
 STATIC void     xfs_acl_filter_mode(mode_t, xfs_acl_t *);
 STATIC void    xfs_acl_get_endian(xfs_acl_t *);
 STATIC int     xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *);
 STATIC int     xfs_acl_invalid(xfs_acl_t *);
 STATIC void    xfs_acl_sync_mode(mode_t, xfs_acl_t *);
-STATIC void    xfs_acl_get_attr(bhv_vnode_t *, xfs_acl_t *, int, int, int *);
-STATIC void    xfs_acl_set_attr(bhv_vnode_t *, xfs_acl_t *, int, int *);
-STATIC int     xfs_acl_allow_set(bhv_vnode_t *, int);
+STATIC void    xfs_acl_get_attr(struct inode *, xfs_acl_t *, int, int, int *);
+STATIC void    xfs_acl_set_attr(struct inode *, xfs_acl_t *, int, int *);
+STATIC int     xfs_acl_allow_set(struct inode *, int);
 
 kmem_zone_t *xfs_acl_zone;
 
@@ -55,7 +55,7 @@ kmem_zone_t *xfs_acl_zone;
  */
 int
 xfs_acl_vhasacl_access(
-       bhv_vnode_t     *vp)
+       struct inode    *vp)
 {
        int             error;
 
@@ -68,7 +68,7 @@ xfs_acl_vhasacl_access(
  */
 int
 xfs_acl_vhasacl_default(
-       bhv_vnode_t     *vp)
+       struct inode    *vp)
 {
        int             error;
 
@@ -207,7 +207,7 @@ posix_acl_xfs_to_xattr(
 
 int
 xfs_acl_vget(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        void            *acl,
        size_t          size,
        int             kind)
@@ -217,7 +217,6 @@ xfs_acl_vget(
        posix_acl_xattr_header  *ext_acl = acl;
        int                     flags = 0;
 
-       VN_HOLD(vp);
        if(size) {
                if (!(_ACL_ALLOC(xfs_acl))) {
                        error = ENOMEM;
@@ -243,7 +242,6 @@ xfs_acl_vget(
                error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size);
        }
 out:
-       VN_RELE(vp);
        if(xfs_acl)
                _ACL_FREE(xfs_acl);
        return -error;
@@ -251,12 +249,11 @@ out:
 
 int
 xfs_acl_vremove(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        int             kind)
 {
        int             error;
 
-       VN_HOLD(vp);
        error = xfs_acl_allow_set(vp, kind);
        if (!error) {
                error = xfs_attr_remove(XFS_I(vp),
@@ -266,13 +263,12 @@ xfs_acl_vremove(
                if (error == ENOATTR)
                        error = 0;      /* 'scool */
        }
-       VN_RELE(vp);
        return -error;
 }
 
 int
 xfs_acl_vset(
-       bhv_vnode_t             *vp,
+       struct inode            *vp,
        void                    *acl,
        size_t                  size,
        int                     kind)
@@ -298,7 +294,6 @@ xfs_acl_vset(
                return 0;
        }
 
-       VN_HOLD(vp);
        error = xfs_acl_allow_set(vp, kind);
 
        /* Incoming ACL exists, set file mode based on its value */
@@ -321,7 +316,6 @@ xfs_acl_vset(
        }
 
 out:
-       VN_RELE(vp);
        _ACL_FREE(xfs_acl);
        return -error;
 }
@@ -363,7 +357,7 @@ xfs_acl_iaccess(
 
 STATIC int
 xfs_acl_allow_set(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        int             kind)
 {
        if (vp->i_flags & (S_IMMUTABLE|S_APPEND))
@@ -372,7 +366,7 @@ xfs_acl_allow_set(
                return ENOTDIR;
        if (vp->i_sb->s_flags & MS_RDONLY)
                return EROFS;
-       if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER))
+       if (XFS_I(vp)->i_d.di_uid != current_fsuid() && !capable(CAP_FOWNER))
                return EPERM;
        return 0;
 }
@@ -419,13 +413,13 @@ xfs_acl_access(
                switch (fap->acl_entry[i].ae_tag) {
                case ACL_USER_OBJ:
                        seen_userobj = 1;
-                       if (fuid != current->fsuid)
+                       if (fuid != current_fsuid())
                                continue;
                        matched.ae_tag = ACL_USER_OBJ;
                        matched.ae_perm = allows;
                        break;
                case ACL_USER:
-                       if (fap->acl_entry[i].ae_id != current->fsuid)
+                       if (fap->acl_entry[i].ae_id != current_fsuid())
                                continue;
                        matched.ae_tag = ACL_USER;
                        matched.ae_perm = allows;
@@ -566,7 +560,7 @@ xfs_acl_get_endian(
  */
 STATIC void
 xfs_acl_get_attr(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        xfs_acl_t       *aclp,
        int             kind,
        int             flags,
@@ -590,7 +584,7 @@ xfs_acl_get_attr(
  */
 STATIC void
 xfs_acl_set_attr(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        xfs_acl_t       *aclp,
        int             kind,
        int             *error)
@@ -624,7 +618,7 @@ xfs_acl_set_attr(
 
 int
 xfs_acl_vtoacl(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        xfs_acl_t       *access_acl,
        xfs_acl_t       *default_acl)
 {
@@ -656,7 +650,7 @@ xfs_acl_vtoacl(
  */
 int
 xfs_acl_inherit(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        mode_t          mode,
        xfs_acl_t       *pdaclp)
 {
@@ -715,7 +709,7 @@ out_error:
  */
 STATIC int
 xfs_acl_setmode(
-       bhv_vnode_t     *vp,
+       struct inode    *vp,
        xfs_acl_t       *acl,
        int             *basicperms)
 {
@@ -764,7 +758,7 @@ xfs_acl_setmode(
        if (gap && nomask)
                iattr.ia_mode |= gap->ae_perm << 3;
 
-       return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred);
+       return xfs_setattr(XFS_I(vp), &iattr, 0);
 }
 
 /*