提交 6ec656bc 编写于 作者: J Josef Bacik 提交者: David Sterba

btrfs: remove inode argument from repair_io_failure

Once we remove the btree_inode we won't have an inode to pass anymore,
just pass the fs_info directly and the inum since we use that to print
out the repair message.
Signed-off-by: NJosef Bacik <jbacik@fb.com>
Reviewed-by: NChandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 c6100a4b
...@@ -1972,11 +1972,10 @@ int free_io_failure(struct btrfs_inode *inode, struct io_failure_record *rec) ...@@ -1972,11 +1972,10 @@ int free_io_failure(struct btrfs_inode *inode, struct io_failure_record *rec)
* currently, there can be no more than two copies of every data bit. thus, * currently, there can be no more than two copies of every data bit. thus,
* exactly one rewrite is required. * exactly one rewrite is required.
*/ */
int repair_io_failure(struct btrfs_inode *inode, u64 start, u64 length, int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start,
u64 logical, struct page *page, u64 length, u64 logical, struct page *page,
unsigned int pg_offset, int mirror_num) unsigned int pg_offset, int mirror_num)
{ {
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct bio *bio; struct bio *bio;
struct btrfs_device *dev; struct btrfs_device *dev;
u64 map_length = 0; u64 map_length = 0;
...@@ -2048,7 +2047,7 @@ int repair_io_failure(struct btrfs_inode *inode, u64 start, u64 length, ...@@ -2048,7 +2047,7 @@ int repair_io_failure(struct btrfs_inode *inode, u64 start, u64 length,
btrfs_info_rl_in_rcu(fs_info, btrfs_info_rl_in_rcu(fs_info,
"read error corrected: ino %llu off %llu (dev %s sector %llu)", "read error corrected: ino %llu off %llu (dev %s sector %llu)",
btrfs_ino(inode), start, ino, start,
rcu_str_deref(dev->name), sector); rcu_str_deref(dev->name), sector);
btrfs_bio_counter_dec(fs_info); btrfs_bio_counter_dec(fs_info);
bio_put(bio); bio_put(bio);
...@@ -2068,8 +2067,7 @@ int repair_eb_io_failure(struct btrfs_fs_info *fs_info, ...@@ -2068,8 +2067,7 @@ int repair_eb_io_failure(struct btrfs_fs_info *fs_info,
for (i = 0; i < num_pages; i++) { for (i = 0; i < num_pages; i++) {
struct page *p = eb->pages[i]; struct page *p = eb->pages[i];
ret = repair_io_failure(BTRFS_I(fs_info->btree_inode), start, ret = repair_io_failure(fs_info, 0, start, PAGE_SIZE, start, p,
PAGE_SIZE, start, p,
start - page_offset(p), mirror_num); start - page_offset(p), mirror_num);
if (ret) if (ret)
break; break;
...@@ -2127,8 +2125,8 @@ int clean_io_failure(struct btrfs_inode *inode, u64 start, struct page *page, ...@@ -2127,8 +2125,8 @@ int clean_io_failure(struct btrfs_inode *inode, u64 start, struct page *page,
num_copies = btrfs_num_copies(fs_info, failrec->logical, num_copies = btrfs_num_copies(fs_info, failrec->logical,
failrec->len); failrec->len);
if (num_copies > 1) { if (num_copies > 1) {
repair_io_failure(inode, start, failrec->len, repair_io_failure(fs_info, btrfs_ino(inode), start,
failrec->logical, page, failrec->len, failrec->logical, page,
pg_offset, failrec->failed_mirror); pg_offset, failrec->failed_mirror);
} }
} }
......
...@@ -471,9 +471,9 @@ struct bio *btrfs_bio_clone(struct bio *bio, gfp_t gfp_mask); ...@@ -471,9 +471,9 @@ struct bio *btrfs_bio_clone(struct bio *bio, gfp_t gfp_mask);
struct btrfs_fs_info; struct btrfs_fs_info;
struct btrfs_inode; struct btrfs_inode;
int repair_io_failure(struct btrfs_inode *inode, u64 start, u64 length, int repair_io_failure(struct btrfs_fs_info *fs_info, u64 ino, u64 start,
u64 logical, struct page *page, u64 length, u64 logical, struct page *page,
unsigned int pg_offset, int mirror_num); unsigned int pg_offset, int mirror_num);
int clean_io_failure(struct btrfs_inode *inode, u64 start, int clean_io_failure(struct btrfs_inode *inode, u64 start,
struct page *page, unsigned int pg_offset); struct page *page, unsigned int pg_offset);
void end_extent_writepage(struct page *page, int err, u64 start, u64 end); void end_extent_writepage(struct page *page, int err, u64 start, u64 end);
......
...@@ -954,7 +954,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx) ...@@ -954,7 +954,7 @@ static int scrub_fixup_readpage(u64 inum, u64 offset, u64 root, void *fixup_ctx)
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
ret = repair_io_failure(BTRFS_I(inode), offset, PAGE_SIZE, ret = repair_io_failure(fs_info, inum, offset, PAGE_SIZE,
fixup->logical, page, fixup->logical, page,
offset - page_offset(page), offset - page_offset(page),
fixup->mirror_num); fixup->mirror_num);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册