btrfs: tree-log: factor out a clean_log_buffer helper
authorChristoph Hellwig <hch@lst.de>
Mon, 3 Apr 2023 14:03:55 +0000 (16:03 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:22 +0000 (18:01 +0200)
commite6b430f817ca7c44a083deab8c54ab8d56e99d54
tree4cc63a2304e196435a010d111febe5d414ff1a00
parent2c275afeb61dab732353aae2c7de01b6a87dcefc
btrfs: tree-log: factor out a clean_log_buffer helper

The tree-log code has three almost identical copies for the accounting on
an extent_buffer that doesn't need to be written any more.  The only
difference is that walk_down_log_tree passed the bytenr used to find the
buffer instead of extent_buffer.start and calculates the length using the
nodesize, while the other two callers look at the extent_buffer.len
field that must always be equivalent to the nodesize.

Factor the code into a common helper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/tree-log.c