diff options
author | Jie Liu <jeff.liu@oracle.com> | 2013-08-12 06:49:59 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-12 18:47:34 -0400 |
commit | 3d3c8b5222b92447bffaa4127ee18c757f32a460 (patch) | |
tree | 250f3b61679231944b5272d18d17e6ceabfc62d1 /fs/xfs/xfs_trans_resv.c | |
parent | 783cb6d172358892d6af394ebe2876bcbfcc6499 (diff) |
xfs: refactor xfs_trans_reserve() interface
With the new xfs_trans_res structure has been introduced, the log
reservation size, log count as well as log flags are pre-initialized
at mount time. So it's time to refine xfs_trans_reserve() interface
to be more neat.
Also, introduce a new helper M_RES() to return a pointer to the
mp->m_resv structure to simplify the input.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_trans_resv.c')
-rw-r--r-- | fs/xfs/xfs_trans_resv.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c index e9211add5183..24110f36f729 100644 --- a/fs/xfs/xfs_trans_resv.c +++ b/fs/xfs/xfs_trans_resv.c | |||
@@ -547,7 +547,8 @@ xfs_calc_attrsetm_reservation( | |||
547 | * Since the runtime attribute transaction space is dependent on the total | 547 | * Since the runtime attribute transaction space is dependent on the total |
548 | * blocks needed for the 1st bmap, here we calculate out the space unit for | 548 | * blocks needed for the 1st bmap, here we calculate out the space unit for |
549 | * one block so that the caller could figure out the total space according | 549 | * one block so that the caller could figure out the total space according |
550 | * to the attibute extent length in blocks by: ext * XFS_ATTRSETRT_LOG_RES(mp). | 550 | * to the attibute extent length in blocks by: |
551 | * ext * M_RES(mp)->tr_attrsetrt.tr_logres | ||
551 | */ | 552 | */ |
552 | STATIC uint | 553 | STATIC uint |
553 | xfs_calc_attrsetrt_reservation( | 554 | xfs_calc_attrsetrt_reservation( |
@@ -619,14 +620,14 @@ xfs_calc_qm_setqlim_reservation( | |||
619 | 620 | ||
620 | /* | 621 | /* |
621 | * Allocating quota on disk if needed. | 622 | * Allocating quota on disk if needed. |
622 | * the write transaction log space: XFS_WRITE_LOG_RES(mp) | 623 | * the write transaction log space: M_RES(mp)->tr_write.tr_logres |
623 | * the unit of quota allocation: one system block size | 624 | * the unit of quota allocation: one system block size |
624 | */ | 625 | */ |
625 | STATIC uint | 626 | STATIC uint |
626 | xfs_calc_qm_dqalloc_reservation( | 627 | xfs_calc_qm_dqalloc_reservation( |
627 | struct xfs_mount *mp) | 628 | struct xfs_mount *mp) |
628 | { | 629 | { |
629 | return XFS_WRITE_LOG_RES(mp) + | 630 | return M_RES(mp)->tr_write.tr_logres + |
630 | xfs_calc_buf_res(1, | 631 | xfs_calc_buf_res(1, |
631 | XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) - 1); | 632 | XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) - 1); |
632 | } | 633 | } |