diff options
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index eac6784e43d7..f5cdeb4b5538 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -172,7 +172,8 @@ static void end_compressed_bio_read(struct bio *bio, int err) | |||
172 | goto out; | 172 | goto out; |
173 | 173 | ||
174 | inode = cb->inode; | 174 | inode = cb->inode; |
175 | ret = check_compressed_csum(inode, cb, (u64)bio->bi_sector << 9); | 175 | ret = check_compressed_csum(inode, cb, |
176 | (u64)bio->bi_iter.bi_sector << 9); | ||
176 | if (ret) | 177 | if (ret) |
177 | goto csum_failed; | 178 | goto csum_failed; |
178 | 179 | ||
@@ -370,7 +371,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
370 | for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { | 371 | for (pg_index = 0; pg_index < cb->nr_pages; pg_index++) { |
371 | page = compressed_pages[pg_index]; | 372 | page = compressed_pages[pg_index]; |
372 | page->mapping = inode->i_mapping; | 373 | page->mapping = inode->i_mapping; |
373 | if (bio->bi_size) | 374 | if (bio->bi_iter.bi_size) |
374 | ret = io_tree->ops->merge_bio_hook(WRITE, page, 0, | 375 | ret = io_tree->ops->merge_bio_hook(WRITE, page, 0, |
375 | PAGE_CACHE_SIZE, | 376 | PAGE_CACHE_SIZE, |
376 | bio, 0); | 377 | bio, 0); |
@@ -504,7 +505,7 @@ static noinline int add_ra_bio_pages(struct inode *inode, | |||
504 | 505 | ||
505 | if (!em || last_offset < em->start || | 506 | if (!em || last_offset < em->start || |
506 | (last_offset + PAGE_CACHE_SIZE > extent_map_end(em)) || | 507 | (last_offset + PAGE_CACHE_SIZE > extent_map_end(em)) || |
507 | (em->block_start >> 9) != cb->orig_bio->bi_sector) { | 508 | (em->block_start >> 9) != cb->orig_bio->bi_iter.bi_sector) { |
508 | free_extent_map(em); | 509 | free_extent_map(em); |
509 | unlock_extent(tree, last_offset, end); | 510 | unlock_extent(tree, last_offset, end); |
510 | unlock_page(page); | 511 | unlock_page(page); |
@@ -550,7 +551,7 @@ next: | |||
550 | * in it. We don't actually do IO on those pages but allocate new ones | 551 | * in it. We don't actually do IO on those pages but allocate new ones |
551 | * to hold the compressed pages on disk. | 552 | * to hold the compressed pages on disk. |
552 | * | 553 | * |
553 | * bio->bi_sector points to the compressed extent on disk | 554 | * bio->bi_iter.bi_sector points to the compressed extent on disk |
554 | * bio->bi_io_vec points to all of the inode pages | 555 | * bio->bi_io_vec points to all of the inode pages |
555 | * bio->bi_vcnt is a count of pages | 556 | * bio->bi_vcnt is a count of pages |
556 | * | 557 | * |
@@ -571,7 +572,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
571 | struct page *page; | 572 | struct page *page; |
572 | struct block_device *bdev; | 573 | struct block_device *bdev; |
573 | struct bio *comp_bio; | 574 | struct bio *comp_bio; |
574 | u64 cur_disk_byte = (u64)bio->bi_sector << 9; | 575 | u64 cur_disk_byte = (u64)bio->bi_iter.bi_sector << 9; |
575 | u64 em_len; | 576 | u64 em_len; |
576 | u64 em_start; | 577 | u64 em_start; |
577 | struct extent_map *em; | 578 | struct extent_map *em; |
@@ -657,7 +658,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
657 | page->mapping = inode->i_mapping; | 658 | page->mapping = inode->i_mapping; |
658 | page->index = em_start >> PAGE_CACHE_SHIFT; | 659 | page->index = em_start >> PAGE_CACHE_SHIFT; |
659 | 660 | ||
660 | if (comp_bio->bi_size) | 661 | if (comp_bio->bi_iter.bi_size) |
661 | ret = tree->ops->merge_bio_hook(READ, page, 0, | 662 | ret = tree->ops->merge_bio_hook(READ, page, 0, |
662 | PAGE_CACHE_SIZE, | 663 | PAGE_CACHE_SIZE, |
663 | comp_bio, 0); | 664 | comp_bio, 0); |
@@ -685,8 +686,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
685 | comp_bio, sums); | 686 | comp_bio, sums); |
686 | BUG_ON(ret); /* -ENOMEM */ | 687 | BUG_ON(ret); /* -ENOMEM */ |
687 | } | 688 | } |
688 | sums += (comp_bio->bi_size + root->sectorsize - 1) / | 689 | sums += (comp_bio->bi_iter.bi_size + |
689 | root->sectorsize; | 690 | root->sectorsize - 1) / root->sectorsize; |
690 | 691 | ||
691 | ret = btrfs_map_bio(root, READ, comp_bio, | 692 | ret = btrfs_map_bio(root, READ, comp_bio, |
692 | mirror_num, 0); | 693 | mirror_num, 0); |