All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Schmidt <list.btrfs@jan-o-sch.net>
To: chris.mason@oracle.com, linux-btrfs@vger.kernel.org
Subject: [PATCH v7 5/8] btrfs: add mirror_num to extent_read_full_page
Date: Fri, 22 Jul 2011 13:12:15 +0200	[thread overview]
Message-ID: <166fdda71455977fae1bb34894cc5b55d72c2c77.1311333004.git.list.btrfs@jan-o-sch.net> (raw)
In-Reply-To: <cover.1311333004.git.list.btrfs@jan-o-sch.net>
In-Reply-To: <cover.1311333004.git.list.btrfs@jan-o-sch.net>

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>
---
 fs/btrfs/disk-io.c   |    2 +-
 fs/btrfs/extent_io.c |    6 +++---
 fs/btrfs/extent_io.h |    2 +-
 fs/btrfs/inode.c     |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 1ac8db5d..b898319 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -874,7 +874,7 @@ static int btree_readpage(struct file *file, struct page *page)
 {
 	struct extent_io_tree *tree;
 	tree = &BTRFS_I(page->mapping->host)->io_tree;
-	return extent_read_full_page(tree, page, btree_get_extent);
+	return extent_read_full_page(tree, page, btree_get_extent, 0);
 }
 
 static 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 b181a94..b78f665 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2111,16 +2111,16 @@ static int __extent_read_full_page(struct extent_io_tree *tree,
 }
 
 int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
-			    get_extent_t *get_extent)
+			    get_extent_t *get_extent, int mirror_num)
 {
 	struct bio *bio = NULL;
 	unsigned long bio_flags = 0;
 	int ret;
 
-	ret = __extent_read_full_page(tree, page, get_extent, &bio, 0,
+	ret = __extent_read_full_page(tree, page, get_extent, &bio, mirror_num,
 				      &bio_flags);
 	if (bio)
-		ret = submit_one_bio(READ, bio, 0, bio_flags);
+		ret = submit_one_bio(READ, bio, mirror_num, bio_flags);
 	return ret;
 }
 
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index a11a92e..22bf366 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -177,7 +177,7 @@ int unlock_extent_cached(struct extent_io_tree *tree, u64 start, u64 end,
 int try_lock_extent(struct extent_io_tree *tree, u64 start, u64 end,
 		    gfp_t mask);
 int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
-			  get_extent_t *get_extent);
+			  get_extent_t *get_extent, int mirror_num);
 int __init extent_io_init(void);
 void extent_io_exit(void);
 
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 4a13730..730ee3d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6250,7 +6250,7 @@ int btrfs_readpage(struct file *file, struct page *page)
 {
 	struct extent_io_tree *tree;
 	tree = &BTRFS_I(page->mapping->host)->io_tree;
-	return extent_read_full_page(tree, page, btrfs_get_extent);
+	return extent_read_full_page(tree, page, btrfs_get_extent, 0);
 }
 
 static int btrfs_writepage(struct page *page, struct writeback_control *wbc)
-- 
1.7.3.4


  parent reply	other threads:[~2011-07-22 11:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 11:12 [PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 1/8] btrfs: added helper functions to iterate backrefs Jan Schmidt
2011-07-27  7:59   ` Li Zefan
2011-07-27  8:06     ` Li Zefan
2011-07-27  8:22       ` Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 2/8] btrfs scrub: added unverified_errors Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 3/8] btrfs scrub: print paths of corrupted files Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 4/8] btrfs scrub: bugfix: mirror_num off by one Jan Schmidt
2011-07-22 11:12 ` Jan Schmidt [this message]
2011-07-22 11:12 ` [PATCH v7 6/8] btrfs scrub: use int for mirror_num, not u64 Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 7/8] btrfs scrub: add fixup code for errors on nodatasum files Jan Schmidt
2011-07-22 11:12 ` [PATCH v7 8/8] btrfs: new ioctls to do logical->inode and inode->path resolving Jan Schmidt
2011-07-23 22:38 ` [PATCH v7 0/8] Btrfs scrub: print path to corrupted files and trigger nodatasum fixup Jan Schubert
2011-07-24 11:36   ` Jan Schmidt
     [not found]     ` <4E2C0E2C.4070606@GMX.li>
     [not found]       ` <4E2C1E9D.1090403@jan-o-sch.net>
     [not found]         ` <4E2C8425.9090601@GMX.li>
2011-07-25  8:34           ` Jan Schmidt
     [not found]             ` <4E2D5C36.306@GMX.li>
2011-07-25 13:15               ` Jan Schmidt
     [not found]                 ` <4E2D9290.6020600@GMX.li>
     [not found]                   ` <4E2E912E.7040109@jan-o-sch.net>
     [not found]                     ` <4E2E92FA.4060008@GMX.li>
2011-07-26 17:36                       ` Jan Schmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=166fdda71455977fae1bb34894cc5b55d72c2c77.1311333004.git.list.btrfs@jan-o-sch.net \
    --to=list.btrfs@jan-o-sch.net \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.