]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: qgroup: Commit transaction in advance to reduce early EDQUOT
authorQu Wenruo <wqu@suse.com>
Fri, 22 Dec 2017 08:06:39 +0000 (16:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Wed, 18 Apr 2018 14:46:47 +0000 (16:46 +0200)
commit900567f09fa62db02e17184e6e626cd75c81172a
tree17476c6edb8409e6c46a976382fd1b0bb6ae698e
parentaca3296dfb6db60e5ff34abbb71b43ed3722054f
btrfs: qgroup: Commit transaction in advance to reduce early EDQUOT

Unlike previous method that tries to commit transaction inside
qgroup_reserve(), this time we will try to commit transaction using
fs_info->transaction_kthread to avoid nested transaction and no need to
worry about locking context.

Since it's an asynchronous function call and we won't wait for
transaction commit, unlike previous method, we must call it before we
hit the qgroup limit.

So this patch will use the ratio and size of qgroup meta_pertrans
reservation as indicator to check if we should trigger a transaction
commit.  (meta_prealloc won't be cleaned in transaction committ, it's
useless anyway)

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/qgroup.c
fs/btrfs/transaction.c
fs/btrfs/transaction.h