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 v4 5/7] btrfs: use q which is already obtained from bdev_get_queue
Date: Thu,  6 Apr 2017 11:22:51 +0800	[thread overview]
Message-ID: <20170406032253.14631-6-anand.jain@oracle.com> (raw)
In-Reply-To: <20170406032253.14631-1-anand.jain@oracle.com>

We have already assigned q from bdev_get_queue() so use it.
And rearrange the code for better view.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
---
v2-4: no change

 fs/btrfs/volumes.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1563ae03079b..4de5b2d549bd 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1008,14 +1008,13 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
 		q = bdev_get_queue(bdev);
 		if (blk_queue_discard(q))
 			device->can_discard = 1;
+		if (!blk_queue_nonrot(q))
+			fs_devices->rotating = 1;
 
 		device->bdev = bdev;
 		device->in_fs_metadata = 0;
 		device->mode = flags;
 
-		if (!blk_queue_nonrot(bdev_get_queue(bdev)))
-			fs_devices->rotating = 1;
-
 		fs_devices->open_devices++;
 		if (device->writeable &&
 		    device->devid != BTRFS_DEV_REPLACE_DEVID) {
@@ -2417,7 +2416,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
 	fs_info->free_chunk_space += device->total_bytes;
 	spin_unlock(&fs_info->free_chunk_lock);
 
-	if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+	if (!blk_queue_nonrot(q))
 		fs_info->fs_devices->rotating = 1;
 
 	tmp = btrfs_super_total_bytes(fs_info->super_copy);
-- 
2.10.0


  parent reply	other threads:[~2017-04-06  3:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06  3:22 [PATCH v4 0/7] Holistic view of device error at commit flush and related cleanup Anand Jain
2017-04-06  3:22 ` [PATCH v4 1/7] btrfs: use blkdev_issue_flush to flush the device cache Anand Jain
2017-04-13 18:41   ` Liu Bo
2017-04-19  4:29     ` Anand Jain
2017-04-18 13:54   ` David Sterba
2017-04-19  4:29     ` Anand Jain
2017-04-25  9:25       ` Anand Jain
2017-04-06  3:22 ` [PATCH v4 2/7] btrfs: cleanup barrier_all_devices() unify dev error count Anand Jain
2017-04-06  3:22 ` [PATCH v4 3/7] btrfs: cleanup barrier_all_devices() to check dev stat flush error Anand Jain
2017-04-06  3:22 ` [PATCH v4 4/7] btrfs: REQ_PREFLUSH does not use btrfs_end_bio() completion callback Anand Jain
2017-04-06  3:22 ` Anand Jain [this message]
2017-04-18 14:01   ` [PATCH v4 5/7] btrfs: use q which is already obtained from bdev_get_queue David Sterba
2017-04-06  3:22 ` [PATCH v4 6/7] btrfs: delete unused member nobarriers Anand Jain
2017-04-18 14:03   ` David Sterba
2017-04-06  3:22 ` [PATCH v4 7/7] btrfs: check if the device is flush capable Anand Jain
2017-04-18 14:04   ` David Sterba
2017-04-13  8:42 ` [PATCH v4 0/7] Holistic view of device error at commit flush and related cleanup Anand Jain
2017-04-13 12:13   ` David Sterba

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=20170406032253.14631-6-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).