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

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

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: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 71f8a8d2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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: