diff options
author | Christoph Hellwig <hch@lst.de> | 2009-06-08 09:33:32 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@brick.lst.de> | 2009-06-08 09:33:32 -0400 |
commit | 7d095257e321214e4cf359abd131ba1f09c60cba (patch) | |
tree | 3f71e2650651616f8ba168b64a82ab48aedef14c /fs/xfs/linux-2.6/xfs_super.c | |
parent | 0c5e1ce89f1eacc366ec421c0f5f681159479c28 (diff) |
xfs: kill xfs_qmops
Kill the quota ops function vector and replace it with direct calls or
stubs in the CONFIG_XFS_QUOTA=n case.
Make sure we check XFS_IS_QUOTA_RUNNING in the right spots. We can remove
the number of those checks because the XFS_TRANS_DQ_DIRTY flag can't be set
otherwise.
This brings us back closer to the way this code worked in IRIX and earlier
Linux versions, but we keep a lot of the more useful factoring of common
code.
Eventually we should also kill xfs_qm_bhv.c, but that's left for a later
patch.
Reduces the size of the source code by about 250 lines and the size of
XFS module by about 1.5 kilobytes with quotas enabled:
text data bss dec hex filename
615957 2960 3848 622765 980ad fs/xfs/xfs.o
617231 3152 3848 624231 98667 fs/xfs/xfs.o.old
Fallout:
- xfs_qm_dqattach is split into xfs_qm_dqattach_locked which expects
the inode locked and xfs_qm_dqattach which does the locking around it,
thus removing XFS_QMOPT_ILOCKED.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index bb685269f832..0d9b64b219e0 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -405,6 +405,14 @@ xfs_parseargs( | |||
405 | return EINVAL; | 405 | return EINVAL; |
406 | } | 406 | } |
407 | 407 | ||
408 | #ifndef CONFIG_XFS_QUOTA | ||
409 | if (XFS_IS_QUOTA_RUNNING(mp)) { | ||
410 | cmn_err(CE_WARN, | ||
411 | "XFS: quota support not available in this kernel."); | ||
412 | return EINVAL; | ||
413 | } | ||
414 | #endif | ||
415 | |||
408 | if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && | 416 | if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && |
409 | (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { | 417 | (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { |
410 | cmn_err(CE_WARN, | 418 | cmn_err(CE_WARN, |
@@ -1098,7 +1106,6 @@ xfs_fs_put_super( | |||
1098 | xfs_freesb(mp); | 1106 | xfs_freesb(mp); |
1099 | xfs_icsb_destroy_counters(mp); | 1107 | xfs_icsb_destroy_counters(mp); |
1100 | xfs_close_devices(mp); | 1108 | xfs_close_devices(mp); |
1101 | xfs_qmops_put(mp); | ||
1102 | xfs_dmops_put(mp); | 1109 | xfs_dmops_put(mp); |
1103 | xfs_free_fsname(mp); | 1110 | xfs_free_fsname(mp); |
1104 | kfree(mp); | 1111 | kfree(mp); |
@@ -1168,6 +1175,7 @@ xfs_fs_statfs( | |||
1168 | { | 1175 | { |
1169 | struct xfs_mount *mp = XFS_M(dentry->d_sb); | 1176 | struct xfs_mount *mp = XFS_M(dentry->d_sb); |
1170 | xfs_sb_t *sbp = &mp->m_sb; | 1177 | xfs_sb_t *sbp = &mp->m_sb; |
1178 | struct xfs_inode *ip = XFS_I(dentry->d_inode); | ||
1171 | __uint64_t fakeinos, id; | 1179 | __uint64_t fakeinos, id; |
1172 | xfs_extlen_t lsize; | 1180 | xfs_extlen_t lsize; |
1173 | 1181 | ||
@@ -1196,7 +1204,10 @@ xfs_fs_statfs( | |||
1196 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); | 1204 | statp->f_ffree = statp->f_files - (sbp->sb_icount - sbp->sb_ifree); |
1197 | spin_unlock(&mp->m_sb_lock); | 1205 | spin_unlock(&mp->m_sb_lock); |
1198 | 1206 | ||
1199 | XFS_QM_DQSTATVFS(XFS_I(dentry->d_inode), statp); | 1207 | if ((ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) || |
1208 | ((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))) == | ||
1209 | (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD)) | ||
1210 | xfs_qm_statvfs(ip, statp); | ||
1200 | return 0; | 1211 | return 0; |
1201 | } | 1212 | } |
1202 | 1213 | ||
@@ -1404,16 +1415,13 @@ xfs_fs_fill_super( | |||
1404 | error = xfs_dmops_get(mp); | 1415 | error = xfs_dmops_get(mp); |
1405 | if (error) | 1416 | if (error) |
1406 | goto out_free_fsname; | 1417 | goto out_free_fsname; |
1407 | error = xfs_qmops_get(mp); | ||
1408 | if (error) | ||
1409 | goto out_put_dmops; | ||
1410 | 1418 | ||
1411 | if (silent) | 1419 | if (silent) |
1412 | flags |= XFS_MFSI_QUIET; | 1420 | flags |= XFS_MFSI_QUIET; |
1413 | 1421 | ||
1414 | error = xfs_open_devices(mp); | 1422 | error = xfs_open_devices(mp); |
1415 | if (error) | 1423 | if (error) |
1416 | goto out_put_qmops; | 1424 | goto out_put_dmops; |
1417 | 1425 | ||
1418 | if (xfs_icsb_init_counters(mp)) | 1426 | if (xfs_icsb_init_counters(mp)) |
1419 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; | 1427 | mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; |
@@ -1482,8 +1490,6 @@ xfs_fs_fill_super( | |||
1482 | out_destroy_counters: | 1490 | out_destroy_counters: |
1483 | xfs_icsb_destroy_counters(mp); | 1491 | xfs_icsb_destroy_counters(mp); |
1484 | xfs_close_devices(mp); | 1492 | xfs_close_devices(mp); |
1485 | out_put_qmops: | ||
1486 | xfs_qmops_put(mp); | ||
1487 | out_put_dmops: | 1493 | out_put_dmops: |
1488 | xfs_dmops_put(mp); | 1494 | xfs_dmops_put(mp); |
1489 | out_free_fsname: | 1495 | out_free_fsname: |