btrfs: Refactor btrfs_rmap_block to improve readability
authorNikolay Borisov <nborisov@suse.com>
Tue, 19 Nov 2019 12:05:53 +0000 (14:05 +0200)
committerDavid Sterba <dsterba@suse.com>
Thu, 23 Jan 2020 16:24:35 +0000 (17:24 +0100)
commit1776ad172e1ff09d4aa57daac74c56b4e1b0c636
tree4c8dcce97a318dc47ed420bd9c491a19fc48c817
parentbf2e2eb060fa29dd892fa42dd0a03f130815acf0
btrfs: Refactor btrfs_rmap_block to improve readability

Move variables to appropriate scope. Remove last BUG_ON in the function
and rework error handling accordingly. Make the duplicate detection code
more straightforward. Use in_range macro. And give variables more
descriptive name by explicitly distinguishing between IO stripe size
(size recorded in the chunk item) and data stripe size (the size of
an actual stripe, constituting a logical chunk/block group).

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/block-group.c