Commit 23220fe2 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong
Browse files

xfs: always pass a valid hdr to xfs_dir3_leaf_check_int



Move the code for extracting the incore header to the only caller that
didn't already do that.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent ae42976d
Loading
Loading
Loading
Loading
+13 −18
Original line number Diff line number Diff line
@@ -141,16 +141,10 @@ xfs_dir3_leaf_check_int(
	struct xfs_dir3_icleaf_hdr	*hdr,
	struct xfs_dir2_leaf		*leaf)
{
	struct xfs_da_geometry		*geo = mp->m_dir_geo;
	xfs_dir2_leaf_tail_t		*ltp;
	int				stale;
	int				i;
	struct xfs_dir3_icleaf_hdr leafhdr;
	struct xfs_da_geometry	*geo = mp->m_dir_geo;

	if (!hdr) {
		xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
		hdr = &leafhdr;
	}

	ltp = xfs_dir2_leaf_tail_p(geo, leaf);

@@ -193,14 +187,15 @@ xfs_dir3_leaf_verify(
	struct xfs_buf			*bp)
{
	struct xfs_mount		*mp = bp->b_mount;
	struct xfs_dir2_leaf	*leaf = bp->b_addr;
	struct xfs_dir3_icleaf_hdr	leafhdr;
	xfs_failaddr_t			fa;

	fa = xfs_da3_blkinfo_verify(bp, bp->b_addr);
	if (fa)
		return fa;

	return xfs_dir3_leaf_check_int(mp, NULL, leaf);
	xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, bp->b_addr);
	return xfs_dir3_leaf_check_int(mp, &leafhdr, bp->b_addr);
}

static void