aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2011-06-13 14:02:58 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2011-09-29 06:54:28 -0400
commit8ddc7d9cd0a00062247c732b96386ec2462bdbc7 (patch)
treeea855863b3f6429002bfe31a3e522b4370d59d55 /fs
parent193ea74b2729e6ddc08fb6bde6e15a3bd4d94071 (diff)
btrfs: add mirror_num to extent_read_full_page
Currently, extent_read_full_page always assumes we are trying to read mirror 0, which generally is the best we can do. To add flexibility, pass it as a parameter. This will be needed by scrub fixup code. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/disk-io.c2
-rw-r--r--fs/btrfs/extent_io.c6
-rw-r--r--fs/btrfs/extent_io.h2
-rw-r--r--fs/btrfs/inode.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 07b3ac662e19..dc0343802535 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -908,7 +908,7 @@ static int btree_readpage(struct file *file, struct page *page)
908{ 908{
909 struct extent_io_tree *tree; 909 struct extent_io_tree *tree;
910 tree = &BTRFS_I(page->mapping->host)->io_tree; 910 tree = &BTRFS_I(page->mapping->host)->io_tree;
911 return extent_read_full_page(tree, page, btree_get_extent); 911 return extent_read_full_page(tree, page, btree_get_extent, 0);
912} 912}
913 913
914static int btree_releasepage(struct page *page, gfp_t gfp_flags) 914static int btree_releasepage(struct page *page, gfp_t gfp_flags)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index d418164a35f1..afebb95e3490 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2076,16 +2076,16 @@ out:
2076} 2076}
2077 2077
2078int extent_read_full_page(struct extent_io_tree *tree, struct page *page, 2078int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
2079 get_extent_t *get_extent) 2079 get_extent_t *get_extent, int mirror_num)
2080{ 2080{
2081 struct bio *bio = NULL; 2081 struct bio *bio = NULL;
2082 unsigned long bio_flags = 0; 2082 unsigned long bio_flags = 0;
2083 int ret; 2083 int ret;
2084 2084
2085 ret = __extent_read_full_page(tree, page, get_extent, &bio, 0, 2085 ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num,
2086 &bio_flags); 2086 &bio_flags);
2087 if (bio) 2087 if (bio)
2088 ret = submit_one_bio(READ, bio, 0, bio_flags); 2088 ret = submit_one_bio(READ, bio, mirror_num, bio_flags);
2089 return ret; 2089 return ret;
2090} 2090}
2091 2091
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 7b2f0c3e7929..a9dd994bf826 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -185,7 +185,7 @@ int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end,
185int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end, 185int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
186 gfp_t mask); 186 gfp_t mask);
187int extent_read_full_page(struct extent_io_tree *tree, struct page *page, 187int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
188 get_extent_t *get_extent); 188 get_extent_t *get_extent, int mirror_num);
189int __init extent_io_init(void); 189int __init extent_io_init(void);
190void extent_io_exit(void); 190void extent_io_exit(void);
191 191
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b2d004ad66a0..efee8c7cfa45 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6289,7 +6289,7 @@ int btrfs_readpage(struct file *file, struct page *page)
6289{ 6289{
6290 struct extent_io_tree *tree; 6290 struct extent_io_tree *tree;
6291 tree = &BTRFS_I(page->mapping->host)->io_tree; 6291 tree = &BTRFS_I(page->mapping->host)->io_tree;
6292 return extent_read_full_page(tree, page, btrfs_get_extent); 6292 return extent_read_full_page(tree, page, btrfs_get_extent, 0);
6293} 6293}
6294 6294
6295static int btrfs_writepage(struct page *page, struct writeback_control *wbc) 6295static int btrfs_writepage(struct page *page, struct writeback_control *wbc)