]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: combine device update operations during transaction commit
authorNikolay Borisov <nborisov@suse.com>
Mon, 25 Mar 2019 12:31:22 +0000 (14:31 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:36 +0000 (19:02 +0200)
commit9e84154a5f4ff2e2e3fa0a9bf2c5fc6cdbef3b68
treefeffc8d55f1080c8f1e6e73c988aa6ca0137e7ff
parent899ed7fb8cf02bab8dbd09f297dfc430cfa2dbb3
btrfs: combine device update operations during transaction commit

We currently overload the pending_chunks list to handle updating
btrfs_device->commit_bytes used.  We don't actually care about the
extent mapping or even the device mapping for the chunk - we just need
the device, and we can end up processing it multiple times.  The
fs_devices->resized_list does more or less the same thing, but with the
disk size.  They are called consecutively during commit and have more or
less the same purpose.

We can combine the two lists into a single list that attaches to the
transaction and contains a list of devices that need updating.  Since we
always add the device to a list when we change bytes_used or
disk_total_size, there's no harm in copying both values at once.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h
fs/btrfs/volumes.c
fs/btrfs/volumes.h