In case we have multiple devices, there is no point in setting the written
flag in the super block on every iteration over the device list. Just do
it once before the loop.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
int do_barriers;
int max_errors;
int total_errors = 0;
- u64 flags;
do_barriers = !btrfs_test_opt(fs_info, NOBARRIER);
}
}
+ btrfs_set_super_flags(sb, btrfs_super_flags(sb) | BTRFS_HEADER_FLAG_WRITTEN);
+
list_for_each_entry(dev, head, dev_list) {
if (unlikely(!dev->bdev)) {
total_errors++;
memcpy(dev_item->fsid, dev->fs_devices->metadata_uuid,
BTRFS_FSID_SIZE);
- flags = btrfs_super_flags(sb);
- btrfs_set_super_flags(sb, flags | BTRFS_HEADER_FLAG_WRITTEN);
-
ret = btrfs_validate_write_super(fs_info, sb);
if (unlikely(ret < 0)) {
mutex_unlock(&fs_info->fs_devices->device_list_mutex);