mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-02-10 11:35:21 +07:00
btrfs: move mapping of block for discard to its caller
There's a simple forwarded call based on the operation that would better fit the caller btrfs_map_block that's until now a trivial wrapper. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ee787f9550
commit
75fb2e9e49
@ -5878,10 +5878,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
|
|||||||
struct btrfs_io_geometry geom;
|
struct btrfs_io_geometry geom;
|
||||||
|
|
||||||
ASSERT(bbio_ret);
|
ASSERT(bbio_ret);
|
||||||
|
ASSERT(op != BTRFS_MAP_DISCARD);
|
||||||
if (op == BTRFS_MAP_DISCARD)
|
|
||||||
return __btrfs_map_block_for_discard(fs_info, logical,
|
|
||||||
length, bbio_ret);
|
|
||||||
|
|
||||||
ret = btrfs_get_io_geometry(fs_info, op, logical, *length, &geom);
|
ret = btrfs_get_io_geometry(fs_info, op, logical, *length, &geom);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
@ -6111,6 +6108,10 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
|
|||||||
u64 logical, u64 *length,
|
u64 logical, u64 *length,
|
||||||
struct btrfs_bio **bbio_ret, int mirror_num)
|
struct btrfs_bio **bbio_ret, int mirror_num)
|
||||||
{
|
{
|
||||||
|
if (op == BTRFS_MAP_DISCARD)
|
||||||
|
return __btrfs_map_block_for_discard(fs_info, logical,
|
||||||
|
length, bbio_ret);
|
||||||
|
|
||||||
return __btrfs_map_block(fs_info, op, logical, length, bbio_ret,
|
return __btrfs_map_block(fs_info, op, logical, length, bbio_ret,
|
||||||
mirror_num, 0);
|
mirror_num, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user