OSDN Git Service

btrfs: move all ref head cleanup to the helper function
authorJosef Bacik <josef@toxicpanda.com>
Fri, 29 Sep 2017 19:43:56 +0000 (15:43 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 30 Oct 2017 11:28:00 +0000 (12:28 +0100)
commitc1103f7a5d7a544dfdaca6102de68792909dc834
treed2a1305a69deda2a95f8fcdce39df555ceaf9367
parent1ce7a5ec44c8b148c4600e25c696a135319734db
btrfs: move all ref head cleanup to the helper function

We do a couple different cleanup operations on the ref head.  We adjust
counters, we'll free any reserved space if we didn't end up using the
ref, and we clear the pending csum bytes.  Move all these disparate
things into cleanup_ref_head and clean up the logic in
__btrfs_run_delayed_refs so that it handles the !ref case a lot cleaner,
as well as making run_one_delayed_ref() only deal with real refs and not
the ref head.

Signed-off-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c