]> www.infradead.org Git - nvme.git/commit
btrfs: qgroup: preallocate memory before adding a relation
authorDavid Sterba <dsterba@suse.com>
Wed, 22 May 2024 16:17:05 +0000 (18:17 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:27 +0000 (15:33 +0200)
commit4addc1ffd67ad34394674dc91379dc04cfdd2537
treeef514cdb77b3706d43b5159db3a5ba7214aa9053
parent7733b8dd189a9e525c2d53bdd4efb26e04a8d737
btrfs: qgroup: preallocate memory before adding a relation

There's a transaction joined in the qgroup relation add/remove ioctl and
any error will lead to abort/error. We could lift the allocation from
btrfs_add_qgroup_relation() and move it outside of the transaction
context. The relation deletion does not need that.

The ownership of the structure is moved to the add relation handler.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h