summaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-02-22 12:40:55 -0800
committerDarrick J. Wong <djwong@kernel.org>2024-02-22 12:40:55 -0800
commit43be09192ce1f3cf9c3d2073e822a1d0a42fe5b2 (patch)
treecaa0ebf5e17418d44288b75725061b5e3c5464af /fs/xfs
parent57982d6c835a71da5c66e6090680de1adf6e736a (diff)
downloadlinux-stable-43be09192ce1f3cf9c3d2073e822a1d0a42fe5b2.tar.gz
linux-stable-43be09192ce1f3cf9c3d2073e822a1d0a42fe5b2.tar.bz2
linux-stable-43be09192ce1f3cf9c3d2073e822a1d0a42fe5b2.zip
xfs: misc cleanups for __xfs_btree_check_sblock
Remove the local crc variable that is only used once and remove the bp NULL checking as it can't ever be NULL for short form blocks. 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>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_btree.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 1a0816aa5009..255d5437b6e2 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -173,15 +173,13 @@ __xfs_btree_check_sblock(
{
struct xfs_mount *mp = cur->bc_mp;
struct xfs_perag *pag = cur->bc_ag.pag;
- bool crc = xfs_has_crc(mp);
xfs_failaddr_t fa;
- xfs_agblock_t agbno = NULLAGBLOCK;
+ xfs_agblock_t agbno;
- if (crc) {
+ if (xfs_has_crc(mp)) {
if (!uuid_equal(&block->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid))
return __this_address;
- if (block->bb_u.s.bb_blkno !=
- cpu_to_be64(bp ? xfs_buf_daddr(bp) : XFS_BUF_DADDR_NULL))
+ if (block->bb_u.s.bb_blkno != cpu_to_be64(xfs_buf_daddr(bp)))
return __this_address;
}
@@ -193,9 +191,7 @@ __xfs_btree_check_sblock(
cur->bc_ops->get_maxrecs(cur, level))
return __this_address;
- if (bp)
- agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(bp));
-
+ agbno = xfs_daddr_to_agbno(mp, xfs_buf_daddr(bp));
fa = xfs_btree_check_sblock_siblings(pag, agbno,
block->bb_u.s.bb_leftsib);
if (!fa)