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>
        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
                        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;
 }