提交 71f8a8d2 编写于 作者: A Anand Jain 提交者: David Sterba

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: NAnand Jain <anand.jain@oracle.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 02cfe779
...@@ -1019,7 +1019,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, ...@@ -1019,7 +1019,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
struct buffer_head *bh; struct buffer_head *bh;
struct btrfs_super_block *disk_super; struct btrfs_super_block *disk_super;
u64 devid; u64 devid;
int seeding = 1;
int ret = 0; int ret = 0;
flags |= FMODE_EXCL; flags |= FMODE_EXCL;
...@@ -1051,9 +1050,9 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, ...@@ -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) { if (btrfs_super_flags(disk_super) & BTRFS_SUPER_FLAG_SEEDING) {
device->writeable = 0; device->writeable = 0;
fs_devices->seeding = 1;
} else { } else {
device->writeable = !bdev_read_only(bdev); device->writeable = !bdev_read_only(bdev);
seeding = 0;
} }
q = bdev_get_queue(bdev); q = bdev_get_queue(bdev);
...@@ -1085,7 +1084,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, ...@@ -1085,7 +1084,6 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
ret = -EINVAL; ret = -EINVAL;
goto out; goto out;
} }
fs_devices->seeding = seeding;
fs_devices->opened = 1; fs_devices->opened = 1;
fs_devices->latest_bdev = latest_dev->bdev; fs_devices->latest_bdev = latest_dev->bdev;
fs_devices->total_rw_bytes = 0; fs_devices->total_rw_bytes = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册