diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2023-09-18 18:33:29 +0300 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2023-10-07 02:09:25 +0300 |
commit | f1445032173d4a49eb8b4a0808db499966897d9a (patch) | |
tree | a6d1d00afab88cece6d22d4caf63c06b08227689 /drivers/md/dm.c | |
parent | 3da5d2de92387a8322965c7fb1365f7cae690e5a (diff) | |
download | linux-f1445032173d4a49eb8b4a0808db499966897d9a.tar.xz |
dm: shortcut the calls to linear_map and stripe_map
Shortcut the calls to linear_map and stripe_map, so that they don't suffer
the overhead of retpolines used for indirect calls.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r-- | drivers/md/dm.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 64a1f306c96c..ab7dd8ab51d1 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1424,9 +1424,16 @@ static void __map_bio(struct bio *clone) if (unlikely(dm_emulate_zone_append(md))) r = dm_zone_map_bio(tio); else + goto do_map; + } else { +do_map: + if (likely(ti->type->map == linear_map)) + r = linear_map(ti, clone); + else if (ti->type->map == stripe_map) + r = stripe_map(ti, clone); + else r = ti->type->map(ti, clone); - } else - r = ti->type->map(ti, clone); + } switch (r) { case DM_MAPIO_SUBMITTED: |