btrfs: drop casts of bio bi_sector
Since commit 72deb455b5
("block: remove CONFIG_LBDAF") (5.2) the
sector_t type is u64 on all arches and configs so we don't need to
typecast it. It used to be unsigned long and the result of sector size
shifts were not guaranteed to fit in the type.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@ -315,7 +315,7 @@ blk_status_t btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
|
||||
path->skip_locking = 1;
|
||||
}
|
||||
|
||||
disk_bytenr = (u64)bio->bi_iter.bi_sector << 9;
|
||||
disk_bytenr = bio->bi_iter.bi_sector << 9;
|
||||
|
||||
bio_for_each_segment(bvec, bio, iter) {
|
||||
page_bytes_left = bvec.bv_len;
|
||||
@ -560,7 +560,7 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio,
|
||||
else
|
||||
offset = 0; /* shut up gcc */
|
||||
|
||||
sums->bytenr = (u64)bio->bi_iter.bi_sector << 9;
|
||||
sums->bytenr = bio->bi_iter.bi_sector << 9;
|
||||
index = 0;
|
||||
|
||||
shash->tfm = fs_info->csum_shash;
|
||||
@ -599,7 +599,7 @@ blk_status_t btrfs_csum_one_bio(struct btrfs_inode *inode, struct bio *bio,
|
||||
ordered = btrfs_lookup_ordered_extent(inode,
|
||||
offset);
|
||||
ASSERT(ordered); /* Logic error */
|
||||
sums->bytenr = ((u64)bio->bi_iter.bi_sector << 9)
|
||||
sums->bytenr = (bio->bi_iter.bi_sector << 9)
|
||||
+ total_bytes;
|
||||
index = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user