btrfs: Use btrfs_get_io_geometry appropriately
authorNikolay Borisov <nborisov@suse.com>
Mon, 3 Jun 2019 09:05:05 +0000 (12:05 +0300)
committerDavid Sterba <dsterba@suse.com>
Tue, 2 Jul 2019 10:30:50 +0000 (12:30 +0200)
commit89b798ad1b42b1de10d64feda241e35e90c7b102
tree72fb10fd056b1e3113f8fe18b0e45aa3062dcc0a
parent5f1411265e16b257a945a5c9044aecbc7bb99443
btrfs: Use btrfs_get_io_geometry appropriately

Presently btrfs_map_block is used not only to do everything necessary to
map a bio to the underlying allocation profile but it's also used to
identify how much data could be written based on btrfs' stripe logic
without actually submitting anything. This is achieved by passing NULL
for 'bbio_ret' parameter.

This patch refactors all callers that require just the mapping length
by switching them to using btrfs_io_geometry instead of calling
btrfs_map_block with a special NULL value for 'bbio_ret'. No functional
change.

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/inode.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h