dm: add support for REQ_NOWAIT to various targets
authorJeffle Xu <jefflexu@linux.alibaba.com>
Fri, 13 Nov 2020 02:05:51 +0000 (10:05 +0800)
committerMike Snitzer <snitzer@redhat.com>
Fri, 4 Dec 2020 23:04:35 +0000 (18:04 -0500)
commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") added a new queue
flag QUEUE_FLAG_NOWAIT to advertise if the bdev supports handling of
REQ_NOWAIT or not. DM core supports stacking QUEUE_FLAG_NOWAIT since
commit 6abc49468eea ("dm: add support for REQ_NOWAIT and enable it for
linear target"), in which only dm-linear enabled it.

Update others DM targets, which just do simple remapping, to enable
support for REQ_NOWAIT.

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-stripe.c
drivers/md/dm-switch.c
drivers/md/dm-unstripe.c
drivers/md/dm-zero.c

index 151d022b032d4096e0df7353dfe8fa5ce04d2b21..df359d33cda89195edc444f66b4e163844ab45c5 100644 (file)
@@ -496,7 +496,7 @@ static void stripe_io_hints(struct dm_target *ti,
 static struct target_type stripe_target = {
        .name   = "striped",
        .version = {1, 6, 0},
-       .features = DM_TARGET_PASSES_INTEGRITY,
+       .features = DM_TARGET_PASSES_INTEGRITY | DM_TARGET_NOWAIT,
        .module = THIS_MODULE,
        .ctr    = stripe_ctr,
        .dtr    = stripe_dtr,
index bff4c7fa1cd2181f2f2244e919623751dcda553e..262e2b0fd97502c1358c653da1b6ed8974a1f76e 100644 (file)
@@ -550,6 +550,7 @@ static int switch_iterate_devices(struct dm_target *ti,
 static struct target_type switch_target = {
        .name = "switch",
        .version = {1, 1, 0},
+       .features = DM_TARGET_NOWAIT,
        .module = THIS_MODULE,
        .ctr = switch_ctr,
        .dtr = switch_dtr,
index e673dacf6418191854689e4a4337f40927b89e5a..7357c1bd58631d6ed80e249856cce41a1d5316b3 100644 (file)
@@ -178,6 +178,7 @@ static void unstripe_io_hints(struct dm_target *ti,
 static struct target_type unstripe_target = {
        .name = "unstriped",
        .version = {1, 1, 0},
+       .features = DM_TARGET_NOWAIT,
        .module = THIS_MODULE,
        .ctr = unstripe_ctr,
        .dtr = unstripe_dtr,
index b65ca8dcfbdc7f51ab4004ee3b8cb43a36dc8f97..faa1dbffc8b4a0f4b31cf07588a5a8b932ffb742 100644 (file)
@@ -59,6 +59,7 @@ static int zero_map(struct dm_target *ti, struct bio *bio)
 static struct target_type zero_target = {
        .name   = "zero",
        .version = {1, 1, 0},
+       .features = DM_TARGET_NOWAIT,
        .module = THIS_MODULE,
        .ctr    = zero_ctr,
        .map    = zero_map,