summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
authorDavid Sterba2017-06-02 18:35:36 +0200
committerDavid Sterba2017-06-19 18:26:03 +0200
commitc821e7f3daa4d02d6303f4f97a3243ea8a6f9411 (patch)
tree9a71df1d81adba11439e8496d227592434ae1f29 /fs/btrfs/extent_io.c
parentbtrfs: opencode trivial compressed_bio_alloc, simplify error handling (diff)
downloadkernel-qcow2-linux-c821e7f3daa4d02d6303f4f97a3243ea8a6f9411.tar.gz
kernel-qcow2-linux-c821e7f3daa4d02d6303f4f97a3243ea8a6f9411.tar.xz
kernel-qcow2-linux-c821e7f3daa4d02d6303f4f97a3243ea8a6f9411.zip
btrfs: pass bytes to btrfs_bio_alloc
Most callers of btrfs_bio_alloc convert from bytes to sectors. Hide that in the helper and simplify the logic in the callsers. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 3d84d6f288cc..5037fd918f43 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2658,14 +2658,14 @@ readpage_ok:
* never fail. We're returning a bio right now but you can call btrfs_io_bio
* for the appropriate container_of magic
*/
-struct bio *btrfs_bio_alloc(struct block_device *bdev, u64 first_sector)
+struct bio *btrfs_bio_alloc(struct block_device *bdev, u64 first_byte)
{
struct btrfs_io_bio *btrfs_bio;
struct bio *bio;
bio = bio_alloc_bioset(GFP_NOFS, BIO_MAX_PAGES, btrfs_bioset);
bio->bi_bdev = bdev;
- bio->bi_iter.bi_sector = first_sector;
+ bio->bi_iter.bi_sector = first_byte >> 9;
btrfs_bio = btrfs_io_bio(bio);
btrfs_bio->csum = NULL;
btrfs_bio->csum_allocated = NULL;
@@ -2799,7 +2799,7 @@ static int submit_extent_page(int op, int op_flags, struct extent_io_tree *tree,
}
}
- bio = btrfs_bio_alloc(bdev, sector);
+ bio = btrfs_bio_alloc(bdev, sector << 9);
bio_add_page(bio, page, page_size, offset);
bio->bi_end_io = end_io_func;
bio->bi_private = tree;