aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-06-08 09:33:32 -0400
committerChristoph Hellwig <hch@brick.lst.de>2009-06-08 09:33:32 -0400
commit7d095257e321214e4cf359abd131ba1f09c60cba (patch)
tree3f71e2650651616f8ba168b64a82ab48aedef14c /fs/xfs/xfs_trans.c
parent0c5e1ce89f1eacc366ec421c0f5f681159479c28 (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/xfs_trans.c')
-rw-r--r--fs/xfs/xfs_trans.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 8570b826fedd..fffabc0aefcb 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -297,7 +297,7 @@ xfs_trans_dup(
297 tp->t_rtx_res = tp->t_rtx_res_used; 297 tp->t_rtx_res = tp->t_rtx_res_used;
298 ntp->t_pflags = tp->t_pflags; 298 ntp->t_pflags = tp->t_pflags;
299 299
300 XFS_TRANS_DUP_DQINFO(tp->t_mountp, tp, ntp); 300 xfs_trans_dup_dqinfo(tp, ntp);
301 301
302 atomic_inc(&tp->t_mountp->m_active_trans); 302 atomic_inc(&tp->t_mountp->m_active_trans);
303 return ntp; 303 return ntp;
@@ -831,7 +831,7 @@ shut_us_down:
831 * means is that we have some (non-persistent) quota 831 * means is that we have some (non-persistent) quota
832 * reservations that need to be unreserved. 832 * reservations that need to be unreserved.
833 */ 833 */
834 XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp); 834 xfs_trans_unreserve_and_mod_dquots(tp);
835 if (tp->t_ticket) { 835 if (tp->t_ticket) {
836 commit_lsn = xfs_log_done(mp, tp->t_ticket, 836 commit_lsn = xfs_log_done(mp, tp->t_ticket,
837 NULL, log_flags); 837 NULL, log_flags);
@@ -850,10 +850,9 @@ shut_us_down:
850 /* 850 /*
851 * If we need to update the superblock, then do it now. 851 * If we need to update the superblock, then do it now.
852 */ 852 */
853 if (tp->t_flags & XFS_TRANS_SB_DIRTY) { 853 if (tp->t_flags & XFS_TRANS_SB_DIRTY)
854 xfs_trans_apply_sb_deltas(tp); 854 xfs_trans_apply_sb_deltas(tp);
855 } 855 xfs_trans_apply_dquot_deltas(tp);
856 XFS_TRANS_APPLY_DQUOT_DELTAS(mp, tp);
857 856
858 /* 857 /*
859 * Ask each log item how many log_vector entries it will 858 * Ask each log item how many log_vector entries it will
@@ -1058,7 +1057,7 @@ xfs_trans_uncommit(
1058 } 1057 }
1059 1058
1060 xfs_trans_unreserve_and_mod_sb(tp); 1059 xfs_trans_unreserve_and_mod_sb(tp);
1061 XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(tp->t_mountp, tp); 1060 xfs_trans_unreserve_and_mod_dquots(tp);
1062 1061
1063 xfs_trans_free_items(tp, flags); 1062 xfs_trans_free_items(tp, flags);
1064 xfs_trans_free_busy(tp); 1063 xfs_trans_free_busy(tp);
@@ -1183,7 +1182,7 @@ xfs_trans_cancel(
1183 } 1182 }
1184#endif 1183#endif
1185 xfs_trans_unreserve_and_mod_sb(tp); 1184 xfs_trans_unreserve_and_mod_sb(tp);
1186 XFS_TRANS_UNRESERVE_AND_MOD_DQUOTS(mp, tp); 1185 xfs_trans_unreserve_and_mod_dquots(tp);
1187 1186
1188 if (tp->t_ticket) { 1187 if (tp->t_ticket) {
1189 if (flags & XFS_TRANS_RELEASE_LOG_RES) { 1188 if (flags & XFS_TRANS_RELEASE_LOG_RES) {
@@ -1213,7 +1212,7 @@ xfs_trans_free(
1213 xfs_trans_t *tp) 1212 xfs_trans_t *tp)
1214{ 1213{
1215 atomic_dec(&tp->t_mountp->m_active_trans); 1214 atomic_dec(&tp->t_mountp->m_active_trans);
1216 XFS_TRANS_FREE_DQINFO(tp->t_mountp, tp); 1215 xfs_trans_free_dqinfo(tp);
1217 kmem_zone_free(xfs_trans_zone, tp); 1216 kmem_zone_free(xfs_trans_zone, tp);
1218} 1217}
1219 1218