xfs: add helper for updating checksums on xfs_bufs
Many/most callers of xfs_update_cksum() pass bp->b_addr and BBTOB(bp->b_length) as the first 2 args. Add a helper which can just accept the bp and the crc offset, and work it out on its own, for brevity. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
5158217058
commit
f1dbcd7e38
@@ -234,8 +234,7 @@ xfs_btree_lblock_calc_crc(
|
||||
return;
|
||||
if (bip)
|
||||
block->bb_u.l.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn);
|
||||
xfs_update_cksum(bp->b_addr, BBTOB(bp->b_length),
|
||||
XFS_BTREE_LBLOCK_CRC_OFF);
|
||||
xfs_buf_update_cksum(bp, XFS_BTREE_LBLOCK_CRC_OFF);
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -267,8 +266,7 @@ xfs_btree_sblock_calc_crc(
|
||||
return;
|
||||
if (bip)
|
||||
block->bb_u.s.bb_lsn = cpu_to_be64(bip->bli_item.li_lsn);
|
||||
xfs_update_cksum(bp->b_addr, BBTOB(bp->b_length),
|
||||
XFS_BTREE_SBLOCK_CRC_OFF);
|
||||
xfs_buf_update_cksum(bp, XFS_BTREE_SBLOCK_CRC_OFF);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user