aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
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 /fs/xfs/linux-2.6
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>
Diffstat (limited to 'fs/xfs/linux-2.6')
-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
5 files changed, 4 insertions, 21 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);