On 17.02.20 г. 8:31 ч., Qu Wenruo wrote:
> In the core function of relocation, build_backref_tree, it needs to
> iterate all backref items of one tree block.
>
> We don't really want to spend our code and reviewers' time to going
> through tons of supportive code just for the backref walk.
>
> Use btrfs_backref_iterator infrastructure to do the loop.
>
> The backref items look would be much more easier to read:
>
> ret = btrfs_backref_iterator_start(iterator, cur->bytenr);
> for (; ret == 0; ret = btrfs_backref_iterator_next(iterator)) {
> /* The really important work */
> }
>
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
Just some general observations:
1. You can name the iterator variable as iter, there is no loss of
meaning and less to type
2. The same applies to naming the function - you can shorten their name
by simply contracting iterator to iter.