Commit e65bb55d authored by Long Li's avatar Long Li Committed by Carlos Maiolino
Browse files

xfs: factor out xfs_attr3_leaf_init



Factor out wrapper xfs_attr3_leaf_init function, which exported for
external use.

Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent ce4e789c
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -1415,6 +1415,28 @@ xfs_attr3_leaf_create(
	return 0;
}

/*
 * Reinitialize an existing attr fork block as an empty leaf, and attach
 * the buffer to tp.
 */
int
xfs_attr3_leaf_init(
	struct xfs_trans	*tp,
	struct xfs_inode	*dp,
	xfs_dablk_t		blkno)
{
	struct xfs_buf		*bp = NULL;
	struct xfs_da_args	args = {
		.trans		= tp,
		.dp		= dp,
		.owner		= dp->i_ino,
		.geo		= dp->i_mount->m_attr_geo,
	};

	ASSERT(tp != NULL);

	return xfs_attr3_leaf_create(&args, blkno, &bp);
}
/*
 * Split the leaf node, rebalance, then add the new entry.
 *
+3 −0
Original line number Diff line number Diff line
@@ -87,6 +87,9 @@ int xfs_attr3_leaf_list_int(struct xfs_buf *bp,
/*
 * Routines used for shrinking the Btree.
 */

int	xfs_attr3_leaf_init(struct xfs_trans *tp, struct xfs_inode *dp,
				xfs_dablk_t blkno);
int	xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval);
void	xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
				       struct xfs_da_state_blk *drop_blk,