Commit f1cc16e1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

xfs: don't use xfs_trans_reserve in xfs_trans_reserve_more



xfs_trans_reserve_more just tries to allocate additional blocks and/or
rtextents and is otherwise unrelated to the transaction reservation
logic.  Open code the block and rtextent reservation in
xfs_trans_reserve_more to prepare for simplifying xfs_trans_reserve.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 736b576d
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1146,9 +1146,18 @@ xfs_trans_reserve_more(
	unsigned int		blocks,
	unsigned int		rtextents)
{
	struct xfs_trans_res	resv = { };
	bool			rsvd = tp->t_flags & XFS_TRANS_RESERVE;

	return xfs_trans_reserve(tp, &resv, blocks, rtextents);
	if (blocks && xfs_dec_fdblocks(tp->t_mountp, blocks, rsvd))
		return -ENOSPC;
	if (rtextents && xfs_dec_frextents(tp->t_mountp, rtextents)) {
		if (blocks)
			xfs_add_fdblocks(tp->t_mountp, blocks);
		return -ENOSPC;
	}
	tp->t_blk_res += blocks;
	tp->t_rtx_res += rtextents;
	return 0;
}

/*