aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iomap.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_iomap.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_iomap.c')
-rw-r--r--fs/xfs/xfs_iomap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 5aaa2d7ec155..feb30a92549b 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -385,7 +385,7 @@ xfs_iomap_write_direct(
385 * Make sure that the dquots are there. This doesn't hold 385 * Make sure that the dquots are there. This doesn't hold
386 * the ilock across a disk read. 386 * the ilock across a disk read.
387 */ 387 */
388 error = XFS_QM_DQATTACH(ip->i_mount, ip, XFS_QMOPT_ILOCKED); 388 error = xfs_qm_dqattach_locked(ip, 0);
389 if (error) 389 if (error)
390 return XFS_ERROR(error); 390 return XFS_ERROR(error);
391 391
@@ -444,8 +444,7 @@ xfs_iomap_write_direct(
444 if (error) 444 if (error)
445 goto error_out; 445 goto error_out;
446 446
447 error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, 447 error = xfs_trans_reserve_quota_nblks(tp, ip, qblocks, 0, quota_flag);
448 qblocks, 0, quota_flag);
449 if (error) 448 if (error)
450 goto error1; 449 goto error1;
451 450
@@ -495,7 +494,7 @@ xfs_iomap_write_direct(
495 494
496error0: /* Cancel bmap, unlock inode, unreserve quota blocks, cancel trans */ 495error0: /* Cancel bmap, unlock inode, unreserve quota blocks, cancel trans */
497 xfs_bmap_cancel(&free_list); 496 xfs_bmap_cancel(&free_list);
498 XFS_TRANS_UNRESERVE_QUOTA_NBLKS(mp, tp, ip, qblocks, 0, quota_flag); 497 xfs_trans_unreserve_quota_nblks(tp, ip, qblocks, 0, quota_flag);
499 498
500error1: /* Just cancel transaction */ 499error1: /* Just cancel transaction */
501 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); 500 xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT);
@@ -582,7 +581,7 @@ xfs_iomap_write_delay(
582 * Make sure that the dquots are there. This doesn't hold 581 * Make sure that the dquots are there. This doesn't hold
583 * the ilock across a disk read. 582 * the ilock across a disk read.
584 */ 583 */
585 error = XFS_QM_DQATTACH(mp, ip, XFS_QMOPT_ILOCKED); 584 error = xfs_qm_dqattach_locked(ip, 0);
586 if (error) 585 if (error)
587 return XFS_ERROR(error); 586 return XFS_ERROR(error);
588 587
@@ -684,7 +683,8 @@ xfs_iomap_write_allocate(
684 /* 683 /*
685 * Make sure that the dquots are there. 684 * Make sure that the dquots are there.
686 */ 685 */
687 if ((error = XFS_QM_DQATTACH(mp, ip, 0))) 686 error = xfs_qm_dqattach(ip, 0);
687 if (error)
688 return XFS_ERROR(error); 688 return XFS_ERROR(error);
689 689
690 offset_fsb = XFS_B_TO_FSBT(mp, offset); 690 offset_fsb = XFS_B_TO_FSBT(mp, offset);