From: Anand Jain Date: Thu, 9 Nov 2017 15:45:25 +0000 (+0800) Subject: btrfs: move check for device generation to the last X-Git-Tag: v4.16-rc1~180^2~109 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9f050db43e0f671ff558f34479b06aafd5103eab;p=linux.git btrfs: move check for device generation to the last No functional changes. This helps to move the entire section into a new function. Signed-off-by: Anand Jain Signed-off-by: David Sterba --- diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 51445cc496c0..04d205226656 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1044,9 +1044,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; @@ -1073,6 +1070,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: