]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: remove boilerplate around xfs_btree_init_block
authorEric Sandeen <sandeen@sandeen.net>
Tue, 4 Apr 2017 20:37:43 +0000 (15:37 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 4 Apr 2017 20:37:43 +0000 (15:37 -0500)
commite394a4b1eada8dad23997081418b2c55d468aef7
tree83369adfccd83cb9e3452fed4ddd11476a625093
parent4c6b32771e7d09253c021827e0a52e882b25cf8a
xfs: remove boilerplate around xfs_btree_init_block

Source kernel commit: b6f41e448277ff080fea734b93121e6cd7513f0c
(minimal changes made to mkfs & repair code for merge)

Now that xfs_btree_init_block_int is able to determine crc
status from the passed-in mp, we can determine the proper
magic as well if we are given a btree number, rather than
an explicit magic value.

Change xfs_btree_init_block[_int] callers to pass in the
btree number, and let xfs_btree_init_block_int use the
xfs_magics array via the xfs_btree_magic macro to determine
which magic value is needed.  This makes all of the
if (crc) / else stanzas identical, and the if/else can be
removed, leading to a single, common init_block call.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_bmap.c
libxfs/xfs_bmap_btree.c
libxfs/xfs_btree.c
libxfs/xfs_btree.h
mkfs/xfs_mkfs.c
repair/phase5.c