aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2012-11-05 09:46:42 -0500
committerJosef Bacik <jbacik@fusionio.com>2012-12-12 17:15:34 -0500
commit3ec706c831d4c96905c287013c8228b21619a1d9 (patch)
treeb5f8ac6333bd0d54b87f4d367aaf3d6101eeef5b /fs/btrfs/inode.c
parent5d9640517d92d05843711ea982cbeff42d7ed32d (diff)
Btrfs: pass fs_info to btrfs_map_block() instead of mapping_tree
This is required for the device replace procedure in a later step. Two calling functions also had to be changed to have the fs_info pointer: repair_io_failure() and scrub_setup_recheck_block(). Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index aabf747d056e..5d1675a8c9e2 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1549,7 +1549,6 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
1549 unsigned long bio_flags) 1549 unsigned long bio_flags)
1550{ 1550{
1551 struct btrfs_root *root = BTRFS_I(page->mapping->host)->root; 1551 struct btrfs_root *root = BTRFS_I(page->mapping->host)->root;
1552 struct btrfs_mapping_tree *map_tree;
1553 u64 logical = (u64)bio->bi_sector << 9; 1552 u64 logical = (u64)bio->bi_sector << 9;
1554 u64 length = 0; 1553 u64 length = 0;
1555 u64 map_length; 1554 u64 map_length;
@@ -1559,11 +1558,10 @@ int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
1559 return 0; 1558 return 0;
1560 1559
1561 length = bio->bi_size; 1560 length = bio->bi_size;
1562 map_tree = &root->fs_info->mapping_tree;
1563 map_length = length; 1561 map_length = length;
1564 ret = btrfs_map_block(map_tree, READ, logical, 1562 ret = btrfs_map_block(root->fs_info, READ, logical,
1565 &map_length, NULL, 0); 1563 &map_length, NULL, 0);
1566 /* Will always return 0 or 1 with map_multi == NULL */ 1564 /* Will always return 0 with map_multi == NULL */
1567 BUG_ON(ret < 0); 1565 BUG_ON(ret < 0);
1568 if (map_length < length + size) 1566 if (map_length < length + size)
1569 return 1; 1567 return 1;
@@ -6364,7 +6362,6 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
6364{ 6362{
6365 struct inode *inode = dip->inode; 6363 struct inode *inode = dip->inode;
6366 struct btrfs_root *root = BTRFS_I(inode)->root; 6364 struct btrfs_root *root = BTRFS_I(inode)->root;
6367 struct btrfs_mapping_tree *map_tree = &root->fs_info->mapping_tree;
6368 struct bio *bio; 6365 struct bio *bio;
6369 struct bio *orig_bio = dip->orig_bio; 6366 struct bio *orig_bio = dip->orig_bio;
6370 struct bio_vec *bvec = orig_bio->bi_io_vec; 6367 struct bio_vec *bvec = orig_bio->bi_io_vec;
@@ -6377,7 +6374,7 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
6377 int async_submit = 0; 6374 int async_submit = 0;
6378 6375
6379 map_length = orig_bio->bi_size; 6376 map_length = orig_bio->bi_size;
6380 ret = btrfs_map_block(map_tree, READ, start_sector << 9, 6377 ret = btrfs_map_block(root->fs_info, READ, start_sector << 9,
6381 &map_length, NULL, 0); 6378 &map_length, NULL, 0);
6382 if (ret) { 6379 if (ret) {
6383 bio_put(orig_bio); 6380 bio_put(orig_bio);
@@ -6431,7 +6428,8 @@ static int btrfs_submit_direct_hook(int rw, struct btrfs_dio_private *dip,
6431 bio->bi_end_io = btrfs_end_dio_bio; 6428 bio->bi_end_io = btrfs_end_dio_bio;
6432 6429
6433 map_length = orig_bio->bi_size; 6430 map_length = orig_bio->bi_size;
6434 ret = btrfs_map_block(map_tree, READ, start_sector << 9, 6431 ret = btrfs_map_block(root->fs_info, READ,
6432 start_sector << 9,
6435 &map_length, NULL, 0); 6433 &map_length, NULL, 0);
6436 if (ret) { 6434 if (ret) {
6437 bio_put(bio); 6435 bio_put(bio);