From 3d3c8b5222b92447bffaa4127ee18c757f32a460 Mon Sep 17 00:00:00 2001 From: Jie Liu Date: Mon, 12 Aug 2013 20:49:59 +1000 Subject: 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 Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_trans_resv.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fs/xfs/xfs_trans_resv.c') diff --git a/fs/xfs/xfs_trans_resv.c b/fs/xfs/xfs_trans_resv.c index e9211add518..24110f36f72 100644 --- a/fs/xfs/xfs_trans_resv.c +++ b/fs/xfs/xfs_trans_resv.c @@ -547,7 +547,8 @@ xfs_calc_attrsetm_reservation( * Since the runtime attribute transaction space is dependent on the total * blocks needed for the 1st bmap, here we calculate out the space unit for * one block so that the caller could figure out the total space according - * to the attibute extent length in blocks by: ext * XFS_ATTRSETRT_LOG_RES(mp). + * to the attibute extent length in blocks by: + * ext * M_RES(mp)->tr_attrsetrt.tr_logres */ STATIC uint xfs_calc_attrsetrt_reservation( @@ -619,14 +620,14 @@ xfs_calc_qm_setqlim_reservation( /* * Allocating quota on disk if needed. - * the write transaction log space: XFS_WRITE_LOG_RES(mp) + * the write transaction log space: M_RES(mp)->tr_write.tr_logres * the unit of quota allocation: one system block size */ STATIC uint xfs_calc_qm_dqalloc_reservation( struct xfs_mount *mp) { - return XFS_WRITE_LOG_RES(mp) + + return M_RES(mp)->tr_write.tr_logres + xfs_calc_buf_res(1, XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) - 1); } -- cgit v1.2.3-70-g09d2