]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Factor out loop processing all refs of a head
authorNikolay Borisov <nborisov@suse.com>
Wed, 15 Aug 2018 07:39:55 +0000 (10:39 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 15 Oct 2018 15:23:35 +0000 (17:23 +0200)
commit2ba9a64899f9c915854d156f52a74d172a64154f
tree2d6b061c0b7d45ba69527bc68dd874a4f3502646
parent8ff974f4762e2dba98db32429827bec7fed016d0
btrfs: Factor out loop processing all refs of a head

This patch introduces a new helper encompassing the implicit inner loop
in __btrfs_run_delayed_refs which processes all the refs for a given
head. The code is mostly copy/paste, the only difference is that if we
detect a newer reference then -EAGAIN is returned so that callers can
react correctly.

Also, at the end of the loop the head is relocked and
btrfs_merge_delayed_refs is run again to retain the pre-refactoring
semantics.

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/extent-tree.c