diff options
author | Mike Snitzer <snitzer@kernel.org> | 2022-03-30 19:52:10 +0200 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2022-05-05 23:31:35 +0200 |
commit | e86f2b005a51437d2887eec5ee659d0287d370ad (patch) | |
tree | ae524bcfe2ae9d84aca33a86285dee242bc9ee02 /drivers/md/dm-linear.c | |
parent | dm: conditionally enable branching for less used features (diff) | |
download | linux-e86f2b005a51437d2887eec5ee659d0287d370ad.tar.xz linux-e86f2b005a51437d2887eec5ee659d0287d370ad.zip |
dm: simplify basic targets
Remove needless factoring and remap bi_sector regardless of
bio_sectors() being non-zero.
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r-- | drivers/md/dm-linear.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c index 76b486e4d2be..0a6abbbe3745 100644 --- a/drivers/md/dm-linear.c +++ b/drivers/md/dm-linear.c @@ -84,19 +84,12 @@ static sector_t linear_map_sector(struct dm_target *ti, sector_t bi_sector) return lc->start + dm_target_offset(ti, bi_sector); } -static void linear_map_bio(struct dm_target *ti, struct bio *bio) +static int linear_map(struct dm_target *ti, struct bio *bio) { struct linear_c *lc = ti->private; bio_set_dev(bio, lc->dev->bdev); - if (bio_sectors(bio) || op_is_zone_mgmt(bio_op(bio))) - bio->bi_iter.bi_sector = - linear_map_sector(ti, bio->bi_iter.bi_sector); -} - -static int linear_map(struct dm_target *ti, struct bio *bio) -{ - linear_map_bio(ti, bio); + bio->bi_iter.bi_sector = linear_map_sector(ti, bio->bi_iter.bi_sector); return DM_MAPIO_REMAPPED; } |