aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_super.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-02-09 02:47:34 -0500
committerChristoph Hellwig <hch@brick.lst.de>2009-02-09 02:47:34 -0500
commitfcafb71b57a039f2113b0321b3b5535fea3a0aca (patch)
treeba092276254f40cecb55764b7b4038eccdc6a296 /fs/xfs/linux-2.6/xfs_super.c
parentc9a192dcf906a33f59c555924e7796a4b9454217 (diff)
xfs: get rid of indirections in the quotaops implementation
Currently we call from the nicely abstracted linux quotaops into a ugly multiplexer just to split the calls out at the same boundary again. Rewrite the quota ops handling to remove that obfucation. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_super.c62
1 files changed, 2 insertions, 60 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 712fa2950875..bc1e64708e2b 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
@@ -68,7 +68,6 @@
68#include <linux/freezer.h> 68#include <linux/freezer.h>
69#include <linux/parser.h> 69#include <linux/parser.h>
70 70
71static struct quotactl_ops xfs_quotactl_operations;
72static struct super_operations xfs_super_operations; 71static struct super_operations xfs_super_operations;
73static kmem_zone_t *xfs_ioend_zone; 72static kmem_zone_t *xfs_ioend_zone;
74mempool_t *xfs_ioend_pool; 73mempool_t *xfs_ioend_pool;
@@ -1333,57 +1332,6 @@ xfs_fs_show_options(
1333 return -xfs_showargs(XFS_M(mnt->mnt_sb), m); 1332 return -xfs_showargs(XFS_M(mnt->mnt_sb), m);
1334} 1333}
1335 1334
1336STATIC int
1337xfs_fs_quotasync(
1338 struct super_block *sb,
1339 int type)
1340{
1341 return -XFS_QM_QUOTACTL(XFS_M(sb), Q_XQUOTASYNC, 0, NULL);
1342}
1343
1344STATIC int
1345xfs_fs_getxstate(
1346 struct super_block *sb,
1347 struct fs_quota_stat *fqs)
1348{
1349 return -XFS_QM_QUOTACTL(XFS_M(sb), Q_XGETQSTAT, 0, (caddr_t)fqs);
1350}
1351
1352STATIC int
1353xfs_fs_setxstate(
1354 struct super_block *sb,
1355 unsigned int flags,
1356 int op)
1357{
1358 return -XFS_QM_QUOTACTL(XFS_M(sb), op, 0, (caddr_t)&flags);
1359}
1360
1361STATIC int
1362xfs_fs_getxquota(
1363 struct super_block *sb,
1364 int type,
1365 qid_t id,
1366 struct fs_disk_quota *fdq)
1367{
1368 return -XFS_QM_QUOTACTL(XFS_M(sb),
1369 (type == USRQUOTA) ? Q_XGETQUOTA :
1370 ((type == GRPQUOTA) ? Q_XGETGQUOTA :
1371 Q_XGETPQUOTA), id, (caddr_t)fdq);
1372}
1373
1374STATIC int
1375xfs_fs_setxquota(
1376 struct super_block *sb,
1377 int type,
1378 qid_t id,
1379 struct fs_disk_quota *fdq)
1380{
1381 return -XFS_QM_QUOTACTL(XFS_M(sb),
1382 (type == USRQUOTA) ? Q_XSETQLIM :
1383 ((type == GRPQUOTA) ? Q_XSETGQLIM :
1384 Q_XSETPQLIM), id, (caddr_t)fdq);
1385}
1386
1387/* 1335/*
1388 * This function fills in xfs_mount_t fields based on mount args. 1336 * This function fills in xfs_mount_t fields based on mount args.
1389 * Note: the superblock _has_ now been read in. 1337 * Note: the superblock _has_ now been read in.
@@ -1466,7 +1414,9 @@ xfs_fs_fill_super(
1466 sb_min_blocksize(sb, BBSIZE); 1414 sb_min_blocksize(sb, BBSIZE);
1467 sb->s_xattr = xfs_xattr_handlers; 1415 sb->s_xattr = xfs_xattr_handlers;
1468 sb->s_export_op = &xfs_export_operations; 1416 sb->s_export_op = &xfs_export_operations;
1417#ifdef CONFIG_XFS_QUOTA
1469 sb->s_qcop = &xfs_quotactl_operations; 1418 sb->s_qcop = &xfs_quotactl_operations;
1419#endif
1470 sb->s_op = &xfs_super_operations; 1420 sb->s_op = &xfs_super_operations;
1471 1421
1472 error = xfs_dmops_get(mp); 1422 error = xfs_dmops_get(mp);
@@ -1609,14 +1559,6 @@ static struct super_operations xfs_super_operations = {
1609 .show_options = xfs_fs_show_options, 1559 .show_options = xfs_fs_show_options,
1610}; 1560};
1611 1561
1612static struct quotactl_ops xfs_quotactl_operations = {
1613 .quota_sync = xfs_fs_quotasync,
1614 .get_xstate = xfs_fs_getxstate,
1615 .set_xstate = xfs_fs_setxstate,
1616 .get_xquota = xfs_fs_getxquota,
1617 .set_xquota = xfs_fs_setxquota,
1618};
1619
1620static struct file_system_type xfs_fs_type = { 1562static struct file_system_type xfs_fs_type = {
1621 .owner = THIS_MODULE, 1563 .owner = THIS_MODULE,
1622 .name = "xfs", 1564 .name = "xfs",