@@ -978,7 +978,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
struct buffer_head *bh;
struct btrfs_super_block *disk_super;
u64 devid;
- int seeding = 1;
int ret = 0;
flags |= FMODE_EXCL;
@@ -1010,9 +1009,9 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_SEEDING) {
device->writeable = 0;
+ fs_devices->seeding = 1;
} else {
device->writeable = !bdev_read_only(bdev);
- seeding = 0;
}
q = bdev_get_queue(bdev);
@@ -1044,7 +1043,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
ret = -EINVAL;
goto out;
}
- fs_devices->seeding = seeding;
fs_devices->opened = 1;
fs_devices->latest_bdev = latest_dev->bdev;
fs_devices->total_rw_bytes = 0;
This is in preparation to move a section of code in __btrfs_open_devices() into a new function so that it can be reused. As we set seeding if any of the device is having SB flag BTRFS_SUPER_FLAG_SEEDING, so do it in the device list loop itself. No functional changes. Signed-off-by: Anand Jain <anand.jain@oracle.com> --- fs/btrfs/volumes.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)