[PATCH v3 13/13] xfs: refactor space log reservation for XFS_TRANS_ATTR_SET
Mark Tinguely
tinguely at sgi.com
Thu Jan 24 15:58:55 CST 2013
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 blocks.
>
> 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 at oracle.com>
> ---
> 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 at sgi.com>
More information about the xfs
mailing list