[Top] [All Lists]

Re: [PATCH v3 13/13] xfs: refactor space log reservation for XFS_TRANS_A

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH v3 13/13] xfs: refactor space log reservation for XFS_TRANS_ATTR_SET
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Thu, 24 Jan 2013 15:58:55 -0600
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <51011743.4060805@xxxxxxxxxx>
References: <51011743.4060805@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 01/24/13 05:13, Jeff Liu wrote:
Currently, we calculate the attribute set transaction log space reservation at 
runtime in
two parts:
1)  XFS_ATTRSET_LOG_RES() which is calculated out at mount time.

2) ((ext * (mp)->m_sb.sb_sectsize) + \
     (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \
     (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))))
which is calculated out at runtime since it depend on the extent length in 

This patch change the XFS_ATTRSET_LOG_RES(mp) to XFS_ATTRSETM_LOG_RES(mp) that 
it is still
figured out at mount time, and introduce a new XFS_ATTRSETRT_LOG_RES(mp) which 
would be used
to calculate out the unit of the log space reservation for one block.  Then we 
can get the
runtime spaces via: XFS_ATTRSETM_LOG_RES(mp) + XFS_ATTRSETRT_LOG_RES(mp) * ext, 
so that
we don't need to export the xfs_calc_buf_res() function.

Signed-off-by: Jie Liu<jeff.liu@xxxxxxxxxx>
  fs/xfs/xfs_attr.c  |    9 ++++++---
  fs/xfs/xfs_mount.h |    3 ++-
  fs/xfs/xfs_trans.c |   28 ++++++++++++++++++++++++----
  fs/xfs/xfs_trans.h |   11 ++++-------
  4 files changed, 36 insertions(+), 15 deletions(-)

Looks good.

Reviewed-by: Mark Tinguely <tinguely@xxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>