diff options
author | Anand Jain <anand.jain@oracle.com> | 2023-03-27 17:53:08 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-04-17 18:01:20 +0200 |
commit | de38a206ff74cc8b2d1e253d8f7b2979d55069de (patch) | |
tree | 47f78760d1bae5e2365d9a9b40be34fb938616b8 /fs/btrfs/disk-io.c | |
parent | bfd3ea946faa8b653025bf56e4bb5428ee6fde05 (diff) |
btrfs: open code check_barrier_error()
check_barrier_error() is almost a single line function, and just calls
btrfs_check_rw_degradable(). Instead, open code it.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 0cb53762474a..bd0e2c595fd6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -4135,13 +4135,6 @@ static blk_status_t wait_dev_flush(struct btrfs_device *device) return bio->bi_status; } -static int check_barrier_error(struct btrfs_fs_info *fs_info) -{ - if (!btrfs_check_rw_degradable(fs_info, NULL)) - return -EIO; - return 0; -} - /* * send an empty flush down to each device in parallel, * then wait for them @@ -4185,14 +4178,13 @@ static int barrier_all_devices(struct btrfs_fs_info *info) errors_wait++; } - if (errors_wait) { - /* - * At some point we need the status of all disks - * to arrive at the volume status. So error checking - * is being pushed to a separate loop. - */ - return check_barrier_error(info); - } + /* + * Checks last_flush_error of disks in order to determine the device + * state. + */ + if (errors_wait && !btrfs_check_rw_degradable(info, NULL)) + return -EIO; + return 0; } |