Skip to content

Commit

Permalink
btrfs: remove redundant null bdev counting during flush submission
Browse files Browse the repository at this point in the history
There is no extra benefit to count null bdev during the submit loop,
as these null devices will be anyway checked during command
completion device loop just after the submit loop. We are holding the
device_list_mutex, the device->bdev status won't change in between.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Anand Jain authored and David Sterba committed Jun 19, 2017
1 parent 12b9bf0 commit cea7c8b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3564,7 +3564,6 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
{
struct list_head *head;
struct btrfs_device *dev;
int errors_send = 0;
int errors_wait = 0;
int ret;

Expand All @@ -3573,10 +3572,8 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
list_for_each_entry_rcu(dev, head, dev_list) {
if (dev->missing)
continue;
if (!dev->bdev) {
errors_send++;
if (!dev->bdev)
continue;
}
if (!dev->in_fs_metadata || !dev->writeable)
continue;

Expand All @@ -3602,7 +3599,7 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
}
}

if (errors_send || errors_wait) {
if (errors_wait) {
/*
* At some point we need the status of all disks
* to arrive at the volume status. So error checking
Expand Down

0 comments on commit cea7c8b

Please sign in to comment.