]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: reloc: use btrfs_backref_iter infrastructure
authorQu Wenruo <wqu@suse.com>
Fri, 14 Feb 2020 05:48:20 +0000 (13:48 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:16 +0000 (11:25 +0200)
commit124c8f2f6c32e33d9370664838754ec7aaea6cad
treeddbb219772a762ac10ea112662877ef631ba56bb
parent0dfa5443703e4944d19c9ad1eed3cd3e227b3843
btrfs: reloc: use btrfs_backref_iter infrastructure

In the core function of relocation, build_backref_tree, it needs to
iterate all backref items of one tree block.

Use btrfs_backref_iter infrastructure to do the loop and make the code
more readable.

The backref items look would be much more easier to read:

ret = btrfs_backref_iter_start(iter, cur->bytenr);
for (; ret == 0; ret = btrfs_backref_iter_next(iter)) {
/* The really important work */
}

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c