diff options
author | Anand Jain <anand.jain@oracle.com> | 2023-04-15 13:32:38 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-06-19 13:59:23 +0200 |
commit | adbe7e388e4239d9c1754d475aea791136927137 (patch) | |
tree | 5982561946cd7bb905be3b1fcc156455f330a917 /fs/btrfs/file-item.c | |
parent | btrfs: use SECTOR_SHIFT to convert physical offset to LBA (diff) | |
download | linux-adbe7e388e4239d9c1754d475aea791136927137.tar.xz linux-adbe7e388e4239d9c1754d475aea791136927137.zip |
btrfs: use SECTOR_SHIFT to convert LBA to physical offset
Using SECTOR_SHIFT to convert LBA to physical address makes it more
readable.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index d1cd0a692f8e..e74b9804bcde 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -749,7 +749,7 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_bio *bbio) sums->len = bio->bi_iter.bi_size; INIT_LIST_HEAD(&sums->list); - sums->bytenr = bio->bi_iter.bi_sector << 9; + sums->bytenr = bio->bi_iter.bi_sector << SECTOR_SHIFT; index = 0; shash->tfm = fs_info->csum_shash; @@ -799,7 +799,7 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_bio *bbio) ordered = btrfs_lookup_ordered_extent(inode, offset); ASSERT(ordered); /* Logic error */ - sums->bytenr = (bio->bi_iter.bi_sector << 9) + sums->bytenr = (bio->bi_iter.bi_sector << SECTOR_SHIFT) + total_bytes; index = 0; } |