aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2008-10-30 03:27:48 -0400
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-10-30 03:27:48 -0400
commitea5a3dc8356bf1cf27bab9a5a0da5dfbbb82013d (patch)
tree30af54170d0cb3b06c2ac21bc31bc57fc5eb4d43
parent7ee49acfe54883f16d28d9486b789431a5804d18 (diff)
[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>
-rw-r--r--fs/xfs/linux-2.6/xfs_cred.h8
-rw-r--r--fs/xfs/linux-2.6/xfs_globals.c7
-rw-r--r--fs/xfs/linux-2.6/xfs_globals.h1
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c3
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c6
-rw-r--r--fs/xfs/xfs_acl.c2
-rw-r--r--fs/xfs/xfs_vnodeops.c6
-rw-r--r--fs/xfs/xfs_vnodeops.h6
8 files changed, 9 insertions, 30 deletions
diff --git a/fs/xfs/linux-2.6/xfs_cred.h b/fs/xfs/linux-2.6/xfs_cred.h
index 652721ce0ea5..98da2199bc23 100644
--- a/fs/xfs/linux-2.6/xfs_cred.h
+++ b/fs/xfs/linux-2.6/xfs_cred.h
@@ -27,12 +27,4 @@ typedef struct cred {
27 /* EMPTY */ 27 /* EMPTY */
28} cred_t; 28} cred_t;
29 29
30extern struct cred *sys_cred;
31
32/* this is a hack.. (assumes sys_cred is the only cred_t in the system) */
33static inline int capable_cred(cred_t *cr, int cid)
34{
35 return (cr == sys_cred) ? 1 : capable(cid);
36}
37
38#endif /* __XFS_CRED_H__ */ 30#endif /* __XFS_CRED_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_globals.c b/fs/xfs/linux-2.6/xfs_globals.c
index ef90e64641e6..46e862b004e6 100644
--- a/fs/xfs/linux-2.6/xfs_globals.c
+++ b/fs/xfs/linux-2.6/xfs_globals.c
@@ -43,10 +43,3 @@ xfs_param_t xfs_params = {
43 .inherit_nodfrg = { 0, 1, 1 }, 43 .inherit_nodfrg = { 0, 1, 1 },
44 .fstrm_timer = { 1, 30*100, 3600*100}, 44 .fstrm_timer = { 1, 30*100, 3600*100},
45}; 45};
46
47/*
48 * Global system credential structure.
49 */
50static cred_t sys_cred_val;
51cred_t *sys_cred = &sys_cred_val;
52
diff --git a/fs/xfs/linux-2.6/xfs_globals.h b/fs/xfs/linux-2.6/xfs_globals.h
index 2770b0085ee8..69f71caf061c 100644
--- a/fs/xfs/linux-2.6/xfs_globals.h
+++ b/fs/xfs/linux-2.6/xfs_globals.h
@@ -19,6 +19,5 @@
19#define __XFS_GLOBALS_H__ 19#define __XFS_GLOBALS_H__
20 20
21extern uint64_t xfs_panic_mask; /* set to cause more panics */ 21extern uint64_t xfs_panic_mask; /* set to cause more panics */
22extern struct cred *sys_cred;
23 22
24#endif /* __XFS_GLOBALS_H__ */ 23#endif /* __XFS_GLOBALS_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index d3438c72dcaf..b5ea3f2afdcb 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -691,8 +691,7 @@ xfs_ioc_space(
691 if (ioflags & IO_INVIS) 691 if (ioflags & IO_INVIS)
692 attr_flags |= XFS_ATTR_DMI; 692 attr_flags |= XFS_ATTR_DMI;
693 693
694 error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, 694 error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, attr_flags);
695 NULL, attr_flags);
696 return -error; 695 return -error;
697} 696}
698 697
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index 37bb1012aff1..f78bc2215764 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -601,7 +601,7 @@ xfs_vn_setattr(
601 struct dentry *dentry, 601 struct dentry *dentry,
602 struct iattr *iattr) 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 @@ xfs_vn_fallocate(
642 642
643 xfs_ilock(ip, XFS_IOLOCK_EXCL); 643 xfs_ilock(ip, XFS_IOLOCK_EXCL);
644 error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, 644 error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf,
645 0, NULL, XFS_ATTR_NOLOCK); 645 0, XFS_ATTR_NOLOCK);
646 if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && 646 if (!error && !(mode & FALLOC_FL_KEEP_SIZE) &&
647 offset + len > i_size_read(inode)) 647 offset + len > i_size_read(inode))
648 new_size = offset + len; 648 new_size = offset + len;
@@ -653,7 +653,7 @@ xfs_vn_fallocate(
653 653
654 iattr.ia_valid = ATTR_SIZE; 654 iattr.ia_valid = ATTR_SIZE;
655 iattr.ia_size = new_size; 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 xfs_iunlock(ip, XFS_IOLOCK_EXCL); 659 xfs_iunlock(ip, XFS_IOLOCK_EXCL);
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index b2f639a1416f..8b3d1bdeb44b 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -758,7 +758,7 @@ xfs_acl_setmode(
758 if (gap && nomask) 758 if (gap && nomask)
759 iattr.ia_mode |= gap->ae_perm << 3; 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/*
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 1c890113ab3e..34a1982ed6dc 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -79,8 +79,7 @@ int
79xfs_setattr( 79xfs_setattr(
80 struct xfs_inode *ip, 80 struct xfs_inode *ip,
81 struct iattr *iattr, 81 struct iattr *iattr,
82 int flags, 82 int flags)
83 cred_t *credp)
84{ 83{
85 xfs_mount_t *mp = ip->i_mount; 84 xfs_mount_t *mp = ip->i_mount;
86 struct inode *inode = VFS_I(ip); 85 struct inode *inode = VFS_I(ip);
@@ -3362,7 +3361,6 @@ xfs_change_file_space(
3362 int cmd, 3361 int cmd,
3363 xfs_flock64_t *bf, 3362 xfs_flock64_t *bf,
3364 xfs_off_t offset, 3363 xfs_off_t offset,
3365 cred_t *credp,
3366 int attr_flags) 3364 int attr_flags)
3367{ 3365{
3368 xfs_mount_t *mp = ip->i_mount; 3366 xfs_mount_t *mp = ip->i_mount;
@@ -3450,7 +3448,7 @@ xfs_change_file_space(
3450 iattr.ia_valid = ATTR_SIZE; 3448 iattr.ia_valid = ATTR_SIZE;
3451 iattr.ia_size = startoffset; 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 if (error) 3453 if (error)
3456 return error; 3454 return error;
diff --git a/fs/xfs/xfs_vnodeops.h b/fs/xfs/xfs_vnodeops.h
index e932a96bec54..b1ae8e3f4043 100644
--- a/fs/xfs/xfs_vnodeops.h
+++ b/fs/xfs/xfs_vnodeops.h
@@ -15,8 +15,7 @@ struct xfs_iomap;
15 15
16 16
17int xfs_open(struct xfs_inode *ip); 17int xfs_open(struct xfs_inode *ip);
18int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags, 18int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags);
19 struct cred *credp);
20#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ 19#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */
21#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ 20#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */
22#define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ 21#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);
44int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state); 43int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state);
45int xfs_reclaim(struct xfs_inode *ip); 44int xfs_reclaim(struct xfs_inode *ip);
46int xfs_change_file_space(struct xfs_inode *ip, int cmd, 45int xfs_change_file_space(struct xfs_inode *ip, int cmd,
47 xfs_flock64_t *bf, xfs_off_t offset, 46 xfs_flock64_t *bf, xfs_off_t offset, int attr_flags);
48 struct cred *credp, int attr_flags);
49int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name, 47int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
50 struct xfs_inode *src_ip, struct xfs_inode *target_dp, 48 struct xfs_inode *src_ip, struct xfs_inode *target_dp,
51 struct xfs_name *target_name, struct xfs_inode *target_ip); 49 struct xfs_name *target_name, struct xfs_inode *target_ip);