btrfs: use bvec_kmap_local in btrfs_csum_one_bio
PATCH 1/1 btrfs: use bvec_kmap_local in btrfs_csum_one_bio
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/btrfs/file-item.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/btrfs/file-item.c +4 -4
@@ -709,12 +709,12 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio, index =0 ; } - data =kmap_atomic (bvec.bv_page); -crypto_shash_digest (shash, data + bvec.bv_offset - + (i * fs_info->sectorsize), + data =bvec_kmap_local (&bvec); +crypto_shash_digest (shash, + data + (i * fs_info->sectorsize), fs_info->sectorsize, sums->sums + index); -kunmap_atomic (data); +kunmap_local (data); index += fs_info->csum_size; offset += fs_info->sectorsize; this_sum_bytes += fs_info->sectorsize;
Signature · 1 line
2.30.2
Quoted 4 lines · Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit.
Signed-off-by Christoph Hellwig <[email protected]>
Reviewed-by Nikolay Borisov <[email protected]>
Quoted 4 lines · Christoph Hellwig
Using local kmaps slightly reduces the chances to stray writes, and the bvec interface cleans up the code a little bit.
Signed-off-by Christoph Hellwig <[email protected]>
Added to misc-next, thanks.