Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2fb8b502 authored by Jie Liu's avatar Jie Liu Committed by Ben Myers
Browse files

xfs: Remove two dead transaction log reservaion macros



Upstream commit 5b292ae3
	xfs: make use of xfs_calc_buf_res() in xfs_trans.c

Beginning from above commit, neither XFS_ALLOCFREE_LOG_RES() nor
XFS_DIROP_LOG_RES() is used by those routines for calculating
transaction space reservations, so it's safe to remove them now.

Also, with a slightly update for the relevant comments to reflect
the ideas of why those log count numbers should be.

Signed-off-by: default avatarJie Liu <jeff.liu@oracle.com>
Reviewed-by: default avatarBen Myers <bpm@sgi.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent 635c4d0b
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -210,23 +210,18 @@ struct xfs_log_item_desc {
/*
/*
 * Per-extent log reservation for the allocation btree changes
 * Per-extent log reservation for the allocation btree changes
 * involved in freeing or allocating an extent.
 * involved in freeing or allocating an extent.
 * 2 trees * (2 blocks/level * max depth - 1) * block size
 * 2 trees * (2 blocks/level * max depth - 1)
 */
 */
#define	XFS_ALLOCFREE_LOG_RES(mp,nx) \
	((nx) * (2 * XFS_FSB_TO_B((mp), 2 * XFS_AG_MAXLEVELS(mp) - 1)))
#define	XFS_ALLOCFREE_LOG_COUNT(mp,nx) \
#define	XFS_ALLOCFREE_LOG_COUNT(mp,nx) \
	((nx) * (2 * (2 * XFS_AG_MAXLEVELS(mp) - 1)))
	((nx) * (2 * (2 * XFS_AG_MAXLEVELS(mp) - 1)))


/*
/*
 * Per-directory log reservation for any directory change.
 * Per-directory log reservation for any directory change.
 * dir blocks: (1 btree block per level + data block + free block) * dblock size
 * dir blocks: (1 btree block per level + data block + free block)
 * bmap btree: (levels + 2) * max depth * block size
 * bmap btree: (levels + 2) * max depth
 * v2 directory blocks can be fragmented below the dirblksize down to the fsb
 * v2 directory blocks can be fragmented below the dirblksize down to the fsb
 * size, so account for that in the DAENTER macros.
 * size, so account for that in the DAENTER macros.
 */
 */
#define	XFS_DIROP_LOG_RES(mp)	\
	(XFS_FSB_TO_B(mp, XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK)) + \
	 (XFS_FSB_TO_B(mp, XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)))
#define	XFS_DIROP_LOG_COUNT(mp)	\
#define	XFS_DIROP_LOG_COUNT(mp)	\
	(XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \
	(XFS_DAENTER_BLOCKS(mp, XFS_DATA_FORK) + \
	 XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)
	 XFS_DAENTER_BMAPS(mp, XFS_DATA_FORK) + 1)