Commit 0d0a762c authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: rename clean_io_failure and remove extraneous args

This is exported, so rename it to btrfs_clean_io_failure.  Additionally
we are passing in the io tree's and such from the inode, so instead of
doing all that simply pass in the inode itself and get all the
components we need directly inside of btrfs_clean_io_failure.
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 748f553c
...@@ -183,9 +183,8 @@ static void end_compressed_bio_read(struct btrfs_bio *bbio) ...@@ -183,9 +183,8 @@ static void end_compressed_bio_read(struct btrfs_bio *bbio)
if (!status && if (!status &&
(!csum || !btrfs_check_data_csum(inode, bbio, offset, (!csum || !btrfs_check_data_csum(inode, bbio, offset,
bv.bv_page, bv.bv_offset))) { bv.bv_page, bv.bv_offset))) {
clean_io_failure(fs_info, &bi->io_failure_tree, btrfs_clean_io_failure(bi, start, bv.bv_page,
&bi->io_tree, start, bv.bv_page, bv.bv_offset);
btrfs_ino(bi), bv.bv_offset);
} else { } else {
int ret; int ret;
......
...@@ -256,9 +256,7 @@ void btrfs_free_io_failure_record(struct btrfs_inode *inode, u64 start, ...@@ -256,9 +256,7 @@ void btrfs_free_io_failure_record(struct btrfs_inode *inode, u64 start,
int free_io_failure(struct extent_io_tree *failure_tree, int free_io_failure(struct extent_io_tree *failure_tree,
struct extent_io_tree *io_tree, struct extent_io_tree *io_tree,
struct io_failure_record *rec); struct io_failure_record *rec);
int clean_io_failure(struct btrfs_fs_info *fs_info, int btrfs_clean_io_failure(struct btrfs_inode *inode, u64 start,
struct extent_io_tree *failure_tree, struct page *page, unsigned int pg_offset);
struct extent_io_tree *io_tree, u64 start,
struct page *page, u64 ino, unsigned int pg_offset);
#endif /* BTRFS_EXTENT_IO_TREE_H */ #endif /* BTRFS_EXTENT_IO_TREE_H */
...@@ -2431,11 +2431,13 @@ static int prev_mirror(const struct io_failure_record *failrec, int cur_mirror) ...@@ -2431,11 +2431,13 @@ static int prev_mirror(const struct io_failure_record *failrec, int cur_mirror)
* each time an IO finishes, we do a fast check in the IO failure tree * each time an IO finishes, we do a fast check in the IO failure tree
* to see if we need to process or clean up an io_failure_record * to see if we need to process or clean up an io_failure_record
*/ */
int clean_io_failure(struct btrfs_fs_info *fs_info, int btrfs_clean_io_failure(struct btrfs_inode *inode, u64 start,
struct extent_io_tree *failure_tree, struct page *page, unsigned int pg_offset)
struct extent_io_tree *io_tree, u64 start,
struct page *page, u64 ino, unsigned int pg_offset)
{ {
struct btrfs_fs_info *fs_info = inode->root->fs_info;
struct extent_io_tree *failure_tree = &inode->io_failure_tree;
struct extent_io_tree *io_tree = &inode->io_tree;
u64 ino = btrfs_ino(inode);
u64 private; u64 private;
struct io_failure_record *failrec; struct io_failure_record *failrec;
struct extent_state *state; struct extent_state *state;
...@@ -2963,7 +2965,6 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio) ...@@ -2963,7 +2965,6 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio)
{ {
struct bio *bio = &bbio->bio; struct bio *bio = &bbio->bio;
struct bio_vec *bvec; struct bio_vec *bvec;
struct extent_io_tree *tree, *failure_tree;
struct processed_extent processed = { 0 }; struct processed_extent processed = { 0 };
/* /*
* The offset to the beginning of a bio, since one bio can never be * The offset to the beginning of a bio, since one bio can never be
...@@ -2990,8 +2991,6 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio) ...@@ -2990,8 +2991,6 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio)
"end_bio_extent_readpage: bi_sector=%llu, err=%d, mirror=%u", "end_bio_extent_readpage: bi_sector=%llu, err=%d, mirror=%u",
bio->bi_iter.bi_sector, bio->bi_status, bio->bi_iter.bi_sector, bio->bi_status,
bbio->mirror_num); bbio->mirror_num);
tree = &BTRFS_I(inode)->io_tree;
failure_tree = &BTRFS_I(inode)->io_failure_tree;
/* /*
* We always issue full-sector reads, but if some block in a * We always issue full-sector reads, but if some block in a
...@@ -3032,9 +3031,7 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio) ...@@ -3032,9 +3031,7 @@ static void end_bio_extent_readpage(struct btrfs_bio *bbio)
loff_t i_size = i_size_read(inode); loff_t i_size = i_size_read(inode);
pgoff_t end_index = i_size >> PAGE_SHIFT; pgoff_t end_index = i_size >> PAGE_SHIFT;
clean_io_failure(BTRFS_I(inode)->root->fs_info, btrfs_clean_io_failure(BTRFS_I(inode), start, page, 0);
failure_tree, tree, start, page,
btrfs_ino(BTRFS_I(inode)), 0);
/* /*
* Zero out the remaining part if this range straddles * Zero out the remaining part if this range straddles
......
...@@ -7869,8 +7869,6 @@ static blk_status_t btrfs_check_read_dio_bio(struct btrfs_dio_private *dip, ...@@ -7869,8 +7869,6 @@ static blk_status_t btrfs_check_read_dio_bio(struct btrfs_dio_private *dip,
{ {
struct inode *inode = dip->inode; struct inode *inode = dip->inode;
struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info; struct btrfs_fs_info *fs_info = BTRFS_I(inode)->root->fs_info;
struct extent_io_tree *failure_tree = &BTRFS_I(inode)->io_failure_tree;
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM); const bool csum = !(BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM);
blk_status_t err = BLK_STS_OK; blk_status_t err = BLK_STS_OK;
struct bvec_iter iter; struct bvec_iter iter;
...@@ -7883,9 +7881,8 @@ static blk_status_t btrfs_check_read_dio_bio(struct btrfs_dio_private *dip, ...@@ -7883,9 +7881,8 @@ static blk_status_t btrfs_check_read_dio_bio(struct btrfs_dio_private *dip,
if (uptodate && if (uptodate &&
(!csum || !btrfs_check_data_csum(inode, bbio, offset, bv.bv_page, (!csum || !btrfs_check_data_csum(inode, bbio, offset, bv.bv_page,
bv.bv_offset))) { bv.bv_offset))) {
clean_io_failure(fs_info, failure_tree, io_tree, start, btrfs_clean_io_failure(BTRFS_I(inode), start,
bv.bv_page, btrfs_ino(BTRFS_I(inode)), bv.bv_page, bv.bv_offset);
bv.bv_offset);
} else { } else {
int ret; int ret;
......
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