Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cea7c8bf authored by Anand Jain's avatar Anand Jain Committed by David Sterba
Browse files

btrfs: remove redundant null bdev counting during flush submission



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: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 12b9bf0b
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -3564,7 +3564,6 @@ static int barrier_all_devices(struct btrfs_fs_info *info)
{
{
	struct list_head *head;
	struct list_head *head;
	struct btrfs_device *dev;
	struct btrfs_device *dev;
	int errors_send = 0;
	int errors_wait = 0;
	int errors_wait = 0;
	int ret;
	int ret;


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


@@ -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
		 * At some point we need the status of all disks
		 * to arrive at the volume status. So error checking
		 * to arrive at the volume status. So error checking