Commit ea5a3dc8356bf1cf27bab9a5a0da5dfbbb82013d

Authored by Christoph Hellwig
Committed by Lachlan McIlroy
1 parent 7ee49acfe5

[XFS] kill sys_cred

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>

Showing 8 changed files with 9 additions and 30 deletions Side-by-side Diff

fs/xfs/linux-2.6/xfs_cred.h
... ... @@ -27,13 +27,5 @@
27 27 /* EMPTY */
28 28 } cred_t;
29 29  
30   -extern struct cred *sys_cred;
31   -
32   -/* this is a hack.. (assumes sys_cred is the only cred_t in the system) */
33   -static inline int capable_cred(cred_t *cr, int cid)
34   -{
35   - return (cr == sys_cred) ? 1 : capable(cid);
36   -}
37   -
38 30 #endif /* __XFS_CRED_H__ */
fs/xfs/linux-2.6/xfs_globals.c
... ... @@ -43,10 +43,4 @@
43 43 .inherit_nodfrg = { 0, 1, 1 },
44 44 .fstrm_timer = { 1, 30*100, 3600*100},
45 45 };
46   -
47   -/*
48   - * Global system credential structure.
49   - */
50   -static cred_t sys_cred_val;
51   -cred_t *sys_cred = &sys_cred_val;
fs/xfs/linux-2.6/xfs_globals.h
... ... @@ -19,7 +19,6 @@
19 19 #define __XFS_GLOBALS_H__
20 20  
21 21 extern uint64_t xfs_panic_mask; /* set to cause more panics */
22   -extern struct cred *sys_cred;
23 22  
24 23 #endif /* __XFS_GLOBALS_H__ */
fs/xfs/linux-2.6/xfs_ioctl.c
... ... @@ -691,8 +691,7 @@
691 691 if (ioflags & IO_INVIS)
692 692 attr_flags |= XFS_ATTR_DMI;
693 693  
694   - error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos,
695   - NULL, attr_flags);
  694 + error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, attr_flags);
696 695 return -error;
697 696 }
698 697  
fs/xfs/linux-2.6/xfs_iops.c
... ... @@ -601,7 +601,7 @@
601 601 struct dentry *dentry,
602 602 struct iattr *iattr)
603 603 {
604   - return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL);
  604 + return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0);
605 605 }
606 606  
607 607 /*
... ... @@ -642,7 +642,7 @@
642 642  
643 643 xfs_ilock(ip, XFS_IOLOCK_EXCL);
644 644 error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
645   - 0, NULL, XFS_ATTR_NOLOCK);
  645 + 0, XFS_ATTR_NOLOCK);
646 646 if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
647 647 offset + len > i_size_read(inode))
648 648 new_size = offset + len;
... ... @@ -653,7 +653,7 @@
653 653  
654 654 iattr.ia_valid = ATTR_SIZE;
655 655 iattr.ia_size = new_size;
656   - error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL);
  656 + error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK);
657 657 }
658 658  
659 659 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
... ... @@ -758,7 +758,7 @@
758 758 if (gap && nomask)
759 759 iattr.ia_mode |= gap->ae_perm << 3;
760 760  
761   - return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred);
  761 + return xfs_setattr(XFS_I(vp), &iattr, 0);
762 762 }
763 763  
764 764 /*
fs/xfs/xfs_vnodeops.c
... ... @@ -79,8 +79,7 @@
79 79 xfs_setattr(
80 80 struct xfs_inode *ip,
81 81 struct iattr *iattr,
82   - int flags,
83   - cred_t *credp)
  82 + int flags)
84 83 {
85 84 xfs_mount_t *mp = ip->i_mount;
86 85 struct inode *inode = VFS_I(ip);
... ... @@ -3362,7 +3361,6 @@
3362 3361 int cmd,
3363 3362 xfs_flock64_t *bf,
3364 3363 xfs_off_t offset,
3365   - cred_t *credp,
3366 3364 int attr_flags)
3367 3365 {
3368 3366 xfs_mount_t *mp = ip->i_mount;
... ... @@ -3450,7 +3448,7 @@
3450 3448 iattr.ia_valid = ATTR_SIZE;
3451 3449 iattr.ia_size = startoffset;
3452 3450  
3453   - error = xfs_setattr(ip, &iattr, attr_flags, credp);
  3451 + error = xfs_setattr(ip, &iattr, attr_flags);
3454 3452  
3455 3453 if (error)
3456 3454 return error;
fs/xfs/xfs_vnodeops.h
... ... @@ -15,8 +15,7 @@
15 15  
16 16  
17 17 int xfs_open(struct xfs_inode *ip);
18   -int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags,
19   - struct cred *credp);
  18 +int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags);
20 19 #define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */
21 20 #define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */
22 21 #define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */
... ... @@ -44,8 +43,7 @@
44 43 int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state);
45 44 int xfs_reclaim(struct xfs_inode *ip);
46 45 int xfs_change_file_space(struct xfs_inode *ip, int cmd,
47   - xfs_flock64_t *bf, xfs_off_t offset,
48   - struct cred *credp, int attr_flags);
  46 + xfs_flock64_t *bf, xfs_off_t offset, int attr_flags);
49 47 int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
50 48 struct xfs_inode *src_ip, struct xfs_inode *target_dp,
51 49 struct xfs_name *target_name, struct xfs_inode *target_ip);