summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-02-10 08:48:36 +0100
committerDavid Sterba <dsterba@suse.com>2023-04-17 18:01:14 +0200
commite7aff33e31610729f0c9c487f0e262cf96e98ebb (patch)
tree0a47428ce156d38fef36853f9d5131e0de64cd00 /fs/btrfs/compression.c
parent798c9fc74d034fca49031efb195e07e59bb926df (diff)
btrfs: use the bbio file offset in btrfs_submit_compressed_read
struct btrfs_bio now has a file_offset field set up by all submitters. Use that in btrfs_submit_compressed_read instead of recalculating the value. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 6fd9c6efe387..f7b6c0baae80 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -533,7 +533,7 @@ void btrfs_submit_compressed_read(struct bio *bio, int mirror_num)
struct bio *comp_bio;
const u64 disk_bytenr = bio->bi_iter.bi_sector << SECTOR_SHIFT;
u64 cur_disk_byte = disk_bytenr;
- u64 file_offset;
+ u64 file_offset = btrfs_bio(bio)->file_offset;
u64 em_len;
u64 em_start;
struct extent_map *em;
@@ -542,9 +542,6 @@ void btrfs_submit_compressed_read(struct bio *bio, int mirror_num)
blk_status_t ret;
int ret2;
- file_offset = bio_first_bvec_all(bio)->bv_offset +
- page_offset(bio_first_page_all(bio));
-
/* we need the actual starting offset of this extent in the file */
read_lock(&em_tree->lock);
em = lookup_extent_mapping(em_tree, file_offset, fs_info->sectorsize);