@@ -2740,13 +2740,16 @@ static void end_page_read(struct page *page, bool uptodate, u64 start, u32 len)
static blk_status_t submit_data_read_repair(struct inode *inode,
struct bio *failed_bio,
- u32 bio_offset, struct page *page,
- unsigned int pgoff,
- u64 start, u64 end,
+ u32 bio_offset,
+ const struct bio_vec *bvec,
int failed_mirror,
unsigned int error_bitmap)
{
+ const unsigned int pgoff = bvec->bv_offset;
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
+ struct page *page = bvec->bv_page;
+ const u64 start = page_offset(bvec->bv_page) + bvec->bv_offset;
+ const u64 end = start + bvec->bv_len - 1;
const u32 sectorsize = fs_info->sectorsize;
const int nr_bits = (end + 1 - start) >> fs_info->sectorsize_bits;
int error = 0;
@@ -3106,10 +3109,8 @@ static void end_bio_extent_readpage(struct bio *bio)
* submit_data_read_repair() will handle all the good
* and bad sectors, we just continue to the next bvec.
*/
- submit_data_read_repair(inode, bio, bio_offset, page,
- start - page_offset(page),
- start, end, mirror,
- error_bitmap);
+ submit_data_read_repair(inode, bio, bio_offset, bvec,
+ mirror, error_bitmap);
ASSERT(bio_offset + len > bio_offset);
bio_offset += len;