diff options
author | Anand Jain <anand.jain@oracle.com> | 2017-11-09 23:45:23 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-01-22 16:08:13 +0100 |
commit | 71f8a8d2c1ee65589b3f0ec5f2306723ea76c1ee (patch) | |
tree | e46ee2e754a09e933b77e55228788e5f9b7d7c6f /fs/btrfs/volumes.c | |
parent | 02cfe779ccaec421cd4ed53a574c8a6354efa7fe (diff) | |
download | linux-71f8a8d2c1ee65589b3f0ec5f2306723ea76c1ee.tar.bz2 |
btrfs: set fs_devices->seed directly
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>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 96c6c0fa1531..51445cc496c0 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -1019,7 +1019,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; @@ -1051,9 +1050,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); @@ -1085,7 +1084,6 @@ error_brelse: 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; |