diff options
author | David Sterba <dsterba@suse.com> | 2022-10-27 02:02:32 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-12-05 18:00:51 +0100 |
commit | 19af6a7d345acc885f970d57577fa80ca4ad3d98 (patch) | |
tree | f7f25d7ec1d1a30e6e54b0f860d7f4f318920990 /fs/btrfs/inode.c | |
parent | btrfs: convert btrfs_block_group::seq_zone to runtime flag (diff) | |
download | linux-19af6a7d345acc885f970d57577fa80ca4ad3d98.tar.xz linux-19af6a7d345acc885f970d57577fa80ca4ad3d98.zip |
btrfs: change how repair action is passed to btrfs_repair_one_sector
There's a function pointer passed to btrfs_repair_one_sector that will
submit the right bio for repair. However there are only two callbacks,
for buffered and for direct IO. This can be simplified to a bool-based
switch and call either function, indirect calls in this case is an
unnecessary abstraction. This allows to remove the submit_bio_hook_t
typedef.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1422f072a7b8..8cc1283fb347 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7923,9 +7923,9 @@ static void btrfs_dio_private_put(struct btrfs_dio_private *dip) bio_endio(&dip->bio); } -static void submit_dio_repair_bio(struct inode *inode, struct bio *bio, - int mirror_num, - enum btrfs_compression_type compress_type) +void btrfs_submit_dio_repair_bio(struct inode *inode, struct bio *bio, + int mirror_num, + enum btrfs_compression_type compress_type) { struct btrfs_dio_private *dip = btrfs_bio(bio)->private; struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); @@ -7960,8 +7960,7 @@ static blk_status_t btrfs_check_read_dio_bio(struct btrfs_dio_private *dip, int ret; ret = btrfs_repair_one_sector(inode, bbio, offset, - bv.bv_page, bv.bv_offset, - submit_dio_repair_bio); + bv.bv_page, bv.bv_offset, false); if (ret) err = errno_to_blk_status(ret); } |