linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Btrfs: remove unnecessary argument of bio_readpage_error()
@ 2013-07-11  5:25 Miao Xie
  2013-07-11  5:25 ` [PATCH 2/5] Btrfs: add branch prediction hints in the read page end IO function Miao Xie
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Miao Xie @ 2013-07-11  5:25 UTC (permalink / raw)
  To: linux-btrfs

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
---
 fs/btrfs/extent_io.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f8586a9..4bfbcc5 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2202,8 +2202,7 @@ out:
  */
 
 static int bio_readpage_error(struct bio *failed_bio, struct page *page,
-				u64 start, u64 end, int failed_mirror,
-				struct extent_state *state)
+				u64 start, u64 end, int failed_mirror)
 {
 	struct io_failure_record *failrec = NULL;
 	u64 private;
@@ -2212,6 +2211,7 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
 	struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree;
 	struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
 	struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
+	struct extent_state *state;
 	struct bio *bio;
 	int num_copies;
 	int ret;
@@ -2297,21 +2297,18 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
 		 * matter what the error is, it is very likely to persist.
 		 */
 		pr_debug("bio_readpage_error: cannot repair, num_copies == 1. "
-			 "state=%p, num_copies=%d, next_mirror %d, "
-			 "failed_mirror %d\n", state, num_copies,
-			 failrec->this_mirror, failed_mirror);
+			 "num_copies=%d, next_mirror %d, failed_mirror %d\n", 
+			 num_copies, failrec->this_mirror, failed_mirror);
 		free_io_failure(inode, failrec, 0);
 		return -EIO;
 	}
 
-	if (!state) {
-		spin_lock(&tree->lock);
-		state = find_first_extent_bit_state(tree, failrec->start,
-						    EXTENT_LOCKED);
-		if (state && state->start != failrec->start)
-			state = NULL;
-		spin_unlock(&tree->lock);
-	}
+	spin_lock(&tree->lock);
+	state = find_first_extent_bit_state(tree, failrec->start,
+					    EXTENT_LOCKED);
+	if (state && state->start != failrec->start)
+		state = NULL;
+	spin_unlock(&tree->lock);
 
 	/*
 	 * there are two premises:
@@ -2541,7 +2538,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
 			 * can't handle the error it will return -EIO and we
 			 * remain responsible for that page.
 			 */
-			ret = bio_readpage_error(bio, page, start, end, mirror, NULL);
+			ret = bio_readpage_error(bio, page, start, end, mirror);
 			if (ret == 0) {
 				uptodate =
 					test_bit(BIO_UPTODATE, &bio->bi_flags);
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-07-12 22:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-11  5:25 [PATCH 1/5] Btrfs: remove unnecessary argument of bio_readpage_error() Miao Xie
2013-07-11  5:25 ` [PATCH 2/5] Btrfs: add branch prediction hints in the read page end IO function Miao Xie
2013-07-11 14:31   ` Chris Mason
2013-07-12 22:19     ` David Sterba
2013-07-11  5:25 ` [PATCH 3/5] Btrfs: don't cache the csum value into the extent state tree Miao Xie
2013-07-11 14:29   ` Chris Mason
2013-07-11  5:25 ` [PATCH 4/5] Btrfs: batch the extent state operation in the end io handle of the read page Miao Xie
2013-07-11 18:56   ` Josef Bacik
2013-07-11  8:05 ` [PATCH 1/5] Btrfs: remove unnecessary argument of bio_readpage_error() Miao Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).