mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
btrfs: set written super flag once in write_all_supers()
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>
This commit is contained in:
parent
8f3fc2d897
commit
1f3f98e42d
|
|
@ -4037,7 +4037,6 @@ int write_all_supers(struct btrfs_trans_handle *trans)
|
|||
int do_barriers;
|
||||
int max_errors;
|
||||
int total_errors = 0;
|
||||
u64 flags;
|
||||
|
||||
do_barriers = !btrfs_test_opt(fs_info, NOBARRIER);
|
||||
|
||||
|
|
@ -4070,6 +4069,8 @@ int write_all_supers(struct btrfs_trans_handle *trans)
|
|||
}
|
||||
}
|
||||
|
||||
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++;
|
||||
|
|
@ -4093,9 +4094,6 @@ int write_all_supers(struct btrfs_trans_handle *trans)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user