[XFS] kill sys_cred
authorChristoph Hellwig <hch@infradead.org>
Thu, 30 Oct 2008 07:27:48 +0000 (18:27 +1100)
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>
Thu, 30 Oct 2008 07:27:48 +0000 (18:27 +1100)
capable_cred has been unused for a while so we can kill it and sys_cred.
That also means the cred argument to xfs_setattr and xfs_change_file_space
can be removed now.

SGI-PV: 988918

SGI-Modid: xfs-linux-melb:xfs-kern:32412a

Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
fs/xfs/linux-2.6/xfs_cred.h
fs/xfs/linux-2.6/xfs_globals.c
fs/xfs/linux-2.6/xfs_globals.h
fs/xfs/linux-2.6/xfs_ioctl.c
fs/xfs/linux-2.6/xfs_iops.c
fs/xfs/xfs_acl.c
fs/xfs/xfs_vnodeops.c
fs/xfs/xfs_vnodeops.h

index 652721ce0ea5ecd0bb19d53c519facf9a62026a6..98da2199bc23b78247dee5b9e407ec10443a8a4f 100644 (file)
@@ -27,12 +27,4 @@ typedef struct cred {
        /* EMPTY */
 } cred_t;
 
-extern struct cred *sys_cred;
-
-/* this is a hack.. (assumes sys_cred is the only cred_t in the system) */
-static inline int capable_cred(cred_t *cr, int cid)
-{
-       return (cr == sys_cred) ? 1 : capable(cid);
-}
-
 #endif  /* __XFS_CRED_H__ */
index ef90e64641e6a662b0478d74fc0918246c9a2e95..46e862b004e6a0bdf2d85eeb8486012f1b02b5cb 100644 (file)
@@ -43,10 +43,3 @@ xfs_param_t xfs_params = {
        .inherit_nodfrg = {     0,              1,              1       },
        .fstrm_timer    = {     1,              30*100,         3600*100},
 };
-
-/*
- * Global system credential structure.
- */
-static cred_t sys_cred_val;
-cred_t *sys_cred = &sys_cred_val;
-
index 2770b0085ee869bedac0def84d8cdf3e37964c6f..69f71caf061cf037075f015af0425af294343409 100644 (file)
@@ -19,6 +19,5 @@
 #define __XFS_GLOBALS_H__
 
 extern uint64_t        xfs_panic_mask;         /* set to cause more panics */
-extern struct cred *sys_cred;
 
 #endif /* __XFS_GLOBALS_H__ */
index d3438c72dcaf555b8d18174a00d1b6eab264615f..b5ea3f2afdcb6a46b592a7ff9321c2475770833a 100644 (file)
@@ -691,8 +691,7 @@ xfs_ioc_space(
        if (ioflags & IO_INVIS)
                attr_flags |= XFS_ATTR_DMI;
 
-       error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos,
-                                             NULL, attr_flags);
+       error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, attr_flags);
        return -error;
 }
 
index 37bb1012aff13d365ae06c672d9230db763bec02..f78bc221576411d36ba2c0878a17487cb2c97039 100644 (file)
@@ -601,7 +601,7 @@ xfs_vn_setattr(
        struct dentry   *dentry,
        struct iattr    *iattr)
 {
-       return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL);
+       return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0);
 }
 
 /*
@@ -642,7 +642,7 @@ xfs_vn_fallocate(
 
        xfs_ilock(ip, XFS_IOLOCK_EXCL);
        error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
-                                     0, NULL, XFS_ATTR_NOLOCK);
+                                     0, XFS_ATTR_NOLOCK);
        if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
            offset + len > i_size_read(inode))
                new_size = offset + len;
@@ -653,7 +653,7 @@ xfs_vn_fallocate(
 
                iattr.ia_valid = ATTR_SIZE;
                iattr.ia_size = new_size;
-               error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL);
+               error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
        }
 
        xfs_iunlock(ip, XFS_IOLOCK_EXCL);
index b2f639a1416f0ecd1c0b91e4958584de823c3a46..8b3d1bdeb44bb4c74576b4e2b80094d4d8e85aac 100644 (file)
@@ -758,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);
 }
 
 /*
index 1c890113ab3e95164bc0e3b426047545e81a6a35..34a1982ed6dc658337bd20a64e565185b5a88a01 100644 (file)
@@ -79,8 +79,7 @@ int
 xfs_setattr(
        struct xfs_inode        *ip,
        struct iattr            *iattr,
-       int                     flags,
-       cred_t                  *credp)
+       int                     flags)
 {
        xfs_mount_t             *mp = ip->i_mount;
        struct inode            *inode = VFS_I(ip);
@@ -3362,7 +3361,6 @@ xfs_change_file_space(
        int             cmd,
        xfs_flock64_t   *bf,
        xfs_off_t       offset,
-       cred_t          *credp,
        int             attr_flags)
 {
        xfs_mount_t     *mp = ip->i_mount;
@@ -3450,7 +3448,7 @@ xfs_change_file_space(
                iattr.ia_valid = ATTR_SIZE;
                iattr.ia_size = startoffset;
 
-               error = xfs_setattr(ip, &iattr, attr_flags, credp);
+               error = xfs_setattr(ip, &iattr, attr_flags);
 
                if (error)
                        return error;
index e932a96bec54994615819245a277fb7ca4cfe8fb..b1ae8e3f4043b1b88cf771990518c6bb5f251d96 100644 (file)
@@ -15,8 +15,7 @@ struct xfs_iomap;
 
 
 int xfs_open(struct xfs_inode *ip);
-int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags,
-               struct cred *credp);
+int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags);
 #define        XFS_ATTR_DMI            0x01    /* invocation from a DMI function */
 #define        XFS_ATTR_NONBLOCK       0x02    /* return EAGAIN if operation would block */
 #define XFS_ATTR_NOLOCK                0x04    /* Don't grab any conflicting locks */
@@ -44,8 +43,7 @@ int xfs_inode_flush(struct xfs_inode *ip, int flags);
 int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state);
 int xfs_reclaim(struct xfs_inode *ip);
 int xfs_change_file_space(struct xfs_inode *ip, int cmd,
-               xfs_flock64_t *bf, xfs_off_t offset,
-               struct cred *credp, int attr_flags);
+               xfs_flock64_t *bf, xfs_off_t offset, int attr_flags);
 int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
                struct xfs_inode *src_ip, struct xfs_inode *target_dp,
                struct xfs_name *target_name, struct xfs_inode *target_ip);
This page took 0.030936 seconds and 5 git commands to generate.