]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd8a3aa15a1fcf6b8b66a523f8ca16ce648e06d7d
tree72fb10fd056b1e3113f8fe18b0e45aa3062dcc0a
parentc7f36c5cf27c157b6f53787d4e101e712f24b8bd
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