From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 3/4] btrfs: move check for device generation to the last
Date: Thu, 9 Nov 2017 23:45:25 +0800 [thread overview]
Message-ID: <20171109154526.23181-4-anand.jain@oracle.com> (raw)
In-Reply-To: <20171109154526.23181-1-anand.jain@oracle.com>
No functional changes. This helps to move the entire section into
a new function.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
fs/btrfs/volumes.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ea6e542cb09d..0857b580014d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1004,9 +1004,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
goto error_brelse;
device->generation = btrfs_super_generation(disk_super);
- if (!latest_dev ||
- device->generation > latest_dev->generation)
- latest_dev = device;
if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_SEEDING) {
device->writeable = 0;
@@ -1033,6 +1030,11 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
&fs_devices->alloc_list);
}
brelse(bh);
+
+ if (!latest_dev ||
+ device->generation > latest_dev->generation)
+ latest_dev = device;
+
continue;
error_brelse:
--
2.13.1
next prev parent reply other threads:[~2017-11-09 15:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-09 15:45 [PATCH 0/4] factor __btrfs_open_devices() Anand Jain
2017-11-09 15:45 ` [PATCH 1/4] btrfs: set fs_devices->seed directly Anand Jain
2017-11-09 15:45 ` [PATCH 2/4] btrfs: let variable required be declared inside the loop Anand Jain
2017-11-09 15:53 ` Nikolay Borisov
2017-11-15 17:01 ` David Sterba
2017-11-09 15:45 ` Anand Jain [this message]
2017-11-09 15:45 ` [PATCH 4/4] btrfs: factor __btrfs_open_devices() to create btrfs_open_one_device() Anand Jain
2017-11-27 6:47 ` Lakshmipathi.G
2017-11-27 11:47 ` Anand Jain
2017-11-29 16:02 ` Lakshmipathi.G
2017-11-27 14:00 ` [PATCH] btrfs: ignore return from btrfs_open_one_device() Anand Jain
2017-11-15 17:03 ` [PATCH 0/4] factor __btrfs_open_devices() David Sterba
2017-11-16 4:08 ` 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=20171109154526.23181-4-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--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).