linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 2/3 v2] btrfs: remove redundant null bdev counting during flush submit
Date: Tue, 13 Jun 2017 17:05:40 +0800	[thread overview]
Message-ID: <1497344741-1135-2-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1497344741-1135-1-git-send-email-anand.jain@oracle.com>

There is no extra benefit to count null bdev during submit loop,
as these null devices will be anyway checked during command
completion device loop just after the submit loop, and as 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>
---
v2: . The tile of this patch is changed from 
      [PATCH 2/2] btrfs: flush error also accounts for its send error
      also added commit log.
    . The submit_flush_error is removed in patch 1/3 but it was here
      before.
    . Dropped the comments.

 fs/btrfs/disk-io.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 9fbcfa9ccab7..a9f1c48519dd 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3565,7 +3565,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;
 
@@ -3574,10 +3573,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;
 
@@ -3603,7 +3600,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
-- 
2.7.0


  reply	other threads:[~2017-06-13  8:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  9:05 [PATCH 1/3 v2] btrfs: write_dev_flush does not return ENOMEM anymore Anand Jain
2017-06-13  9:05 ` Anand Jain [this message]
2017-06-13  9:05 ` [PATCH 3/3 v2] btrfs: wait part of the write_dev_flush() can be separated out Anand Jain
2017-06-13  9:32 ` [PATCH 1/3 v2.1] btrfs: write_dev_flush does not return ENOMEM anymore Anand Jain
2017-06-13 15:23   ` David Sterba
2017-06-14  9:01     ` Anand Jain
2017-06-15 16:27       ` David Sterba
2017-06-15 20:29         ` Anand Jain
2017-06-14 10:12   ` [PATCH 3/3 v2.2] btrfs: wait part of the write_dev_flush() can be separated out Anand Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497344741-1135-2-git-send-email-anand.jain@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).