Skip to content

Commit 79e7230

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
xfs: factor out a __xfs_btree_check_lblock_hdr helper
This will allow sharing code with the in-memory block checking helper. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
1 parent 5ef819c commit 79e7230

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

fs/xfs/libxfs/xfs_btree.c

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,14 @@ xfs_btree_check_agblock_siblings(
9494
return NULL;
9595
}
9696

97-
/*
98-
* Check a long btree block header. Return the address of the failing check,
99-
* or NULL if everything is ok.
100-
*/
10197
static xfs_failaddr_t
102-
__xfs_btree_check_fsblock(
98+
__xfs_btree_check_lblock_hdr(
10399
struct xfs_btree_cur *cur,
104100
struct xfs_btree_block *block,
105101
int level,
106102
struct xfs_buf *bp)
107103
{
108104
struct xfs_mount *mp = cur->bc_mp;
109-
xfs_failaddr_t fa;
110-
xfs_fsblock_t fsb;
111105

112106
if (xfs_has_crc(mp)) {
113107
if (!uuid_equal(&block->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid))
@@ -127,6 +121,28 @@ __xfs_btree_check_fsblock(
127121
cur->bc_ops->get_maxrecs(cur, level))
128122
return __this_address;
129123

124+
return NULL;
125+
}
126+
127+
/*
128+
* Check a long btree block header. Return the address of the failing check,
129+
* or NULL if everything is ok.
130+
*/
131+
static xfs_failaddr_t
132+
__xfs_btree_check_fsblock(
133+
struct xfs_btree_cur *cur,
134+
struct xfs_btree_block *block,
135+
int level,
136+
struct xfs_buf *bp)
137+
{
138+
struct xfs_mount *mp = cur->bc_mp;
139+
xfs_failaddr_t fa;
140+
xfs_fsblock_t fsb;
141+
142+
fa = __xfs_btree_check_lblock_hdr(cur, block, level, bp);
143+
if (fa)
144+
return fa;
145+
130146
/*
131147
* For inode-rooted btrees, the root block sits in the inode fork. In
132148
* that case bp is NULL, and the block must not have any siblings.

0 commit comments

Comments
 (0)