]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
btrfs: only track ref_heads in delayed_ref_updates
authorJosef Bacik <jbacik@fb.com>
Mon, 3 Dec 2018 15:20:32 +0000 (10:20 -0500)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:28 +0000 (14:21 -0300)
commita79f26dfcd0611cc92b86f125a85bbb8aa4e6e6e
treef56559b6bdfc2b01b08f8f96b3d98a93831ba7af
parent9ad636524e51fbb6203ea1da6f2bb93f90d4b5b0
btrfs: only track ref_heads in delayed_ref_updates

BugLink: https://bugs.launchpad.net/bugs/1855787
[ Upstream commit 158ffa364bf723fa1ef128060646d23dc3942994 ]

We use this number to figure out how many delayed refs to run, but
__btrfs_run_delayed_refs really only checks every time we need a new
delayed ref head, so we always run at least one ref head completely no
matter what the number of items on it.  Fix the accounting to only be
adjusted when we add/remove a ref head.

In addition to using this number to limit the number of delayed refs
run, a future patch is also going to use it to calculate the amount of
space required for delayed refs space reservation.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/btrfs/delayed-ref.c