aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2007-08-30 03:19:57 -0400
committerTim Shimmin <tes@chook.melbourne.sgi.com>2007-10-15 21:43:26 -0400
commitb09cc77109dbf33463480952de10511a2b67bba6 (patch)
tree722ed205af03de0f33b955aeb3a573565242497a /fs/xfs/linux-2.6
parent293688ec420f1160ed93ea4c7948ed5baf8bafa7 (diff)
[XFS] remove dependency of the quota module on behaviors
Mount options are now parsed by the main XFS module and rejected if quota support is not available, and there are some new quota operation for the quotactl syscall and calls to quote in the mount, unmount and sync callchains. SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29503a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c10
-rw-r--r--fs/xfs/linux-2.6/xfs_super.h3
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.c15
-rw-r--r--fs/xfs/linux-2.6/xfs_vfs.h5
4 files changed, 8 insertions, 25 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 24073f8a292b..103add6eccb6 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -729,7 +729,7 @@ xfs_fs_quotasync(
729 struct super_block *sb, 729 struct super_block *sb,
730 int type) 730 int type)
731{ 731{
732 return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XQUOTASYNC, 0, NULL); 732 return -XFS_QM_QUOTACTL(XFS_M(sb), Q_XQUOTASYNC, 0, NULL);
733} 733}
734 734
735STATIC int 735STATIC int
@@ -737,7 +737,7 @@ xfs_fs_getxstate(
737 struct super_block *sb, 737 struct super_block *sb,
738 struct fs_quota_stat *fqs) 738 struct fs_quota_stat *fqs)
739{ 739{
740 return -bhv_vfs_quotactl(vfs_from_sb(sb), Q_XGETQSTAT, 0, (caddr_t)fqs); 740 return -XFS_QM_QUOTACTL(XFS_M(sb), Q_XGETQSTAT, 0, (caddr_t)fqs);
741} 741}
742 742
743STATIC int 743STATIC int
@@ -746,7 +746,7 @@ xfs_fs_setxstate(
746 unsigned int flags, 746 unsigned int flags,
747 int op) 747 int op)
748{ 748{
749 return -bhv_vfs_quotactl(vfs_from_sb(sb), op, 0, (caddr_t)&flags); 749 return -XFS_QM_QUOTACTL(XFS_M(sb), op, 0, (caddr_t)&flags);
750} 750}
751 751
752STATIC int 752STATIC int
@@ -756,7 +756,7 @@ xfs_fs_getxquota(
756 qid_t id, 756 qid_t id,
757 struct fs_disk_quota *fdq) 757 struct fs_disk_quota *fdq)
758{ 758{
759 return -bhv_vfs_quotactl(vfs_from_sb(sb), 759 return -XFS_QM_QUOTACTL(XFS_M(sb),
760 (type == USRQUOTA) ? Q_XGETQUOTA : 760 (type == USRQUOTA) ? Q_XGETQUOTA :
761 ((type == GRPQUOTA) ? Q_XGETGQUOTA : 761 ((type == GRPQUOTA) ? Q_XGETGQUOTA :
762 Q_XGETPQUOTA), id, (caddr_t)fdq); 762 Q_XGETPQUOTA), id, (caddr_t)fdq);
@@ -769,7 +769,7 @@ xfs_fs_setxquota(
769 qid_t id, 769 qid_t id,
770 struct fs_disk_quota *fdq) 770 struct fs_disk_quota *fdq)
771{ 771{
772 return -bhv_vfs_quotactl(vfs_from_sb(sb), 772 return -XFS_QM_QUOTACTL(XFS_M(sb),
773 (type == USRQUOTA) ? Q_XSETQLIM : 773 (type == USRQUOTA) ? Q_XSETQLIM :
774 ((type == GRPQUOTA) ? Q_XSETGQLIM : 774 ((type == GRPQUOTA) ? Q_XSETGQLIM :
775 Q_XSETPQLIM), id, (caddr_t)fdq); 775 Q_XSETPQLIM), id, (caddr_t)fdq);
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h
index ea2ee5a92637..4bbf985a7de7 100644
--- a/fs/xfs/linux-2.6/xfs_super.h
+++ b/fs/xfs/linux-2.6/xfs_super.h
@@ -119,4 +119,7 @@ extern void xfs_blkdev_issue_flush(struct xfs_buftarg *);
119 119
120extern struct export_operations xfs_export_operations; 120extern struct export_operations xfs_export_operations;
121 121
122#define XFS_M(sb) \
123 XFS_VFSTOM(vfs_from_sb(sb))
124
122#endif /* __XFS_SUPER_H__ */ 125#endif /* __XFS_SUPER_H__ */
diff --git a/fs/xfs/linux-2.6/xfs_vfs.c b/fs/xfs/linux-2.6/xfs_vfs.c
index 1ce15706458a..5f616ccaea8d 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.c
+++ b/fs/xfs/linux-2.6/xfs_vfs.c
@@ -155,21 +155,6 @@ vfs_vget(
155 return ((*bhvtovfsops(next)->vfs_vget)(next, vpp, fidp)); 155 return ((*bhvtovfsops(next)->vfs_vget)(next, vpp, fidp));
156} 156}
157 157
158int
159vfs_quotactl(
160 struct bhv_desc *bdp,
161 int cmd,
162 int id,
163 caddr_t addr)
164{
165 struct bhv_desc *next = bdp;
166
167 ASSERT(next);
168 while (! (bhvtovfsops(next))->vfs_quotactl)
169 next = BHV_NEXT(next);
170 return ((*bhvtovfsops(next)->vfs_quotactl)(next, cmd, id, addr));
171}
172
173void 158void
174vfs_init_vnode( 159vfs_init_vnode(
175 struct bhv_desc *bdp, 160 struct bhv_desc *bdp,
diff --git a/fs/xfs/linux-2.6/xfs_vfs.h b/fs/xfs/linux-2.6/xfs_vfs.h
index e63dbdbfd8a0..e63b2d012f0c 100644
--- a/fs/xfs/linux-2.6/xfs_vfs.h
+++ b/fs/xfs/linux-2.6/xfs_vfs.h
@@ -127,7 +127,6 @@ typedef int (*vfs_statvfs_t)(bhv_desc_t *, bhv_statvfs_t *,
127 struct inode *); 127 struct inode *);
128typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *); 128typedef int (*vfs_sync_t)(bhv_desc_t *, int, struct cred *);
129typedef int (*vfs_vget_t)(bhv_desc_t *, struct inode **, struct fid *); 129typedef int (*vfs_vget_t)(bhv_desc_t *, struct inode **, struct fid *);
130typedef int (*vfs_quotactl_t)(bhv_desc_t *, int, int, caddr_t);
131typedef void (*vfs_init_vnode_t)(bhv_desc_t *, 130typedef void (*vfs_init_vnode_t)(bhv_desc_t *,
132 struct inode *, struct xfs_inode *, int); 131 struct inode *, struct xfs_inode *, int);
133typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int); 132typedef void (*vfs_force_shutdown_t)(bhv_desc_t *, int, char *, int);
@@ -144,7 +143,6 @@ typedef struct bhv_vfsops {
144 vfs_statvfs_t vfs_statvfs; /* file system statistics */ 143 vfs_statvfs_t vfs_statvfs; /* file system statistics */
145 vfs_sync_t vfs_sync; /* flush files */ 144 vfs_sync_t vfs_sync; /* flush files */
146 vfs_vget_t vfs_vget; /* get vnode from fid */ 145 vfs_vget_t vfs_vget; /* get vnode from fid */
147 vfs_quotactl_t vfs_quotactl; /* disk quota */
148 vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */ 146 vfs_init_vnode_t vfs_init_vnode; /* initialize a new vnode */
149 vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */ 147 vfs_force_shutdown_t vfs_force_shutdown; /* crash and burn */
150 vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */ 148 vfs_freeze_t vfs_freeze; /* freeze fs for snapshot */
@@ -163,7 +161,6 @@ typedef struct bhv_vfsops {
163#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VFSHEAD(v), sp,vp) 161#define bhv_vfs_statvfs(v, sp,vp) vfs_statvfs(VFSHEAD(v), sp,vp)
164#define bhv_vfs_sync(v, flag,cr) vfs_sync(VFSHEAD(v), flag,cr) 162#define bhv_vfs_sync(v, flag,cr) vfs_sync(VFSHEAD(v), flag,cr)
165#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VFSHEAD(v), vpp,fidp) 163#define bhv_vfs_vget(v, vpp,fidp) vfs_vget(VFSHEAD(v), vpp,fidp)
166#define bhv_vfs_quotactl(v, c,id,p) vfs_quotactl(VFSHEAD(v), c,id,p)
167#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VFSHEAD(v), vp,b,ul) 164#define bhv_vfs_init_vnode(v, vp,b,ul) vfs_init_vnode(VFSHEAD(v), vp,b,ul)
168#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VFSHEAD(v), u,f,l) 165#define bhv_vfs_force_shutdown(v,u,f,l) vfs_force_shutdown(VFSHEAD(v), u,f,l)
169#define bhv_vfs_freeze(v) vfs_freeze(VFSHEAD(v)) 166#define bhv_vfs_freeze(v) vfs_freeze(VFSHEAD(v))
@@ -180,7 +177,6 @@ typedef struct bhv_vfsops {
180#define bhv_next_vfs_statvfs(b, sp,vp) vfs_statvfs(b, sp,vp) 177#define bhv_next_vfs_statvfs(b, sp,vp) vfs_statvfs(b, sp,vp)
181#define bhv_next_vfs_sync(b, flag,cr) vfs_sync(b, flag,cr) 178#define bhv_next_vfs_sync(b, flag,cr) vfs_sync(b, flag,cr)
182#define bhv_next_vfs_vget(b, vpp,fidp) vfs_vget(b, vpp,fidp) 179#define bhv_next_vfs_vget(b, vpp,fidp) vfs_vget(b, vpp,fidp)
183#define bhv_next_vfs_quotactl(b, c,id,p) vfs_quotactl(b, c,id,p)
184#define bhv_next_vfs_init_vnode(b, vp,b2,ul) vfs_init_vnode(b, vp,b2,ul) 180#define bhv_next_vfs_init_vnode(b, vp,b2,ul) vfs_init_vnode(b, vp,b2,ul)
185#define bhv_next_force_shutdown(b, fl,f,l) vfs_force_shutdown(b, fl,f,l) 181#define bhv_next_force_shutdown(b, fl,f,l) vfs_force_shutdown(b, fl,f,l)
186#define bhv_next_vfs_freeze(b) vfs_freeze(b) 182#define bhv_next_vfs_freeze(b) vfs_freeze(b)
@@ -194,7 +190,6 @@ extern int vfs_root(bhv_desc_t *, struct inode **);
194extern int vfs_statvfs(bhv_desc_t *, bhv_statvfs_t *, struct inode *); 190extern int vfs_statvfs(bhv_desc_t *, bhv_statvfs_t *, struct inode *);
195extern int vfs_sync(bhv_desc_t *, int, struct cred *); 191extern int vfs_sync(bhv_desc_t *, int, struct cred *);
196extern int vfs_vget(bhv_desc_t *, struct inode **, struct fid *); 192extern int vfs_vget(bhv_desc_t *, struct inode **, struct fid *);
197extern int vfs_quotactl(bhv_desc_t *, int, int, caddr_t);
198extern void vfs_init_vnode(bhv_desc_t *, struct inode *, struct xfs_inode *, int); 193extern void vfs_init_vnode(bhv_desc_t *, struct inode *, struct xfs_inode *, int);
199extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int); 194extern void vfs_force_shutdown(bhv_desc_t *, int, char *, int);
200extern void vfs_freeze(bhv_desc_t *); 195extern void vfs_freeze(bhv_desc_t *);