Commit 09a7f7a2 authored by Miao Xie's avatar Miao Xie Committed by Chris Mason

Btrfs: remove unnecessary argument of bio_readpage_error()

Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 8507d216
...@@ -2202,8 +2202,7 @@ static int clean_io_failure(u64 start, struct page *page) ...@@ -2202,8 +2202,7 @@ static int clean_io_failure(u64 start, struct page *page)
*/ */
static int bio_readpage_error(struct bio *failed_bio, struct page *page, static int bio_readpage_error(struct bio *failed_bio, struct page *page,
u64 start, u64 end, int failed_mirror, u64 start, u64 end, int failed_mirror)
struct extent_state *state)
{ {
struct io_failure_record *failrec = NULL; struct io_failure_record *failrec = NULL;
u64 private; u64 private;
...@@ -2212,6 +2211,7 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page, ...@@ -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 *failure_tree = &BTRFS_I(inode)->io_failure_tree;
struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree; struct extent_io_tree *tree = &BTRFS_I(inode)->io_tree;
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
struct extent_state *state;
struct bio *bio; struct bio *bio;
int num_copies; int num_copies;
int ret; int ret;
...@@ -2296,22 +2296,18 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page, ...@@ -2296,22 +2296,18 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
* all the retry and error correction code that follows. no * all the retry and error correction code that follows. no
* matter what the error is, it is very likely to persist. * matter what the error is, it is very likely to persist.
*/ */
pr_debug("bio_readpage_error: cannot repair, num_copies == 1. " pr_debug("bio_readpage_error: cannot repair, num_copies=%d, next_mirror %d, failed_mirror %d\n",
"state=%p, num_copies=%d, next_mirror %d, " num_copies, failrec->this_mirror, failed_mirror);
"failed_mirror %d\n", state, num_copies,
failrec->this_mirror, failed_mirror);
free_io_failure(inode, failrec, 0); free_io_failure(inode, failrec, 0);
return -EIO; return -EIO;
} }
if (!state) { spin_lock(&tree->lock);
spin_lock(&tree->lock); state = find_first_extent_bit_state(tree, failrec->start,
state = find_first_extent_bit_state(tree, failrec->start, EXTENT_LOCKED);
EXTENT_LOCKED); if (state && state->start != failrec->start)
if (state && state->start != failrec->start) state = NULL;
state = NULL; spin_unlock(&tree->lock);
spin_unlock(&tree->lock);
}
/* /*
* there are two premises: * there are two premises:
...@@ -2541,7 +2537,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err) ...@@ -2541,7 +2537,7 @@ static void end_bio_extent_readpage(struct bio *bio, int err)
* can't handle the error it will return -EIO and we * can't handle the error it will return -EIO and we
* remain responsible for that page. * 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) { if (ret == 0) {
uptodate = uptodate =
test_bit(BIO_UPTODATE, &bio->bi_flags); test_bit(BIO_UPTODATE, &bio->bi_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment