diff options
author | Mike Snitzer <snitzer@redhat.com> | 2016-01-31 17:38:28 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2016-02-22 22:34:39 -0500 |
commit | 78ce23b51802f5e917d89e8fc9a56dec6cc2fd5b (patch) | |
tree | 9c0e4139ce06b366f089d28e7236fe0ff3953d34 /drivers/md | |
parent | 2eff1924e1d3f90a5e40cf4bcc18bf05d57c7c15 (diff) |
dm mpath: use blk_mq_alloc_request() and blk_mq_free_request() directly
There isn't any need to support both old .request_fn and blk-mq paths
in the blk-mq specific portion of __multipath_map(). Call
blk_mq_alloc_request() directly rather than use blk_get_request().
Similarly, call blk_mq_free_request(), rather than blk_put_request(), in
multipath_release_clone().
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-mpath.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 2f7c6a550a2d..d31fce508f8f 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <scsi/scsi_dh.h> | 24 | #include <scsi/scsi_dh.h> |
25 | #include <linux/atomic.h> | 25 | #include <linux/atomic.h> |
26 | #include <linux/blk-mq.h> | ||
26 | 27 | ||
27 | #define DM_MSG_PREFIX "multipath" | 28 | #define DM_MSG_PREFIX "multipath" |
28 | #define DM_PG_INIT_DELAY_MSECS 2000 | 29 | #define DM_PG_INIT_DELAY_MSECS 2000 |
@@ -452,8 +453,8 @@ static int __multipath_map(struct dm_target *ti, struct request *clone, | |||
452 | * .request_fn stacked on blk-mq path(s) and | 453 | * .request_fn stacked on blk-mq path(s) and |
453 | * blk-mq stacked on blk-mq path(s). | 454 | * blk-mq stacked on blk-mq path(s). |
454 | */ | 455 | */ |
455 | *__clone = blk_get_request(bdev_get_queue(bdev), | 456 | *__clone = blk_mq_alloc_request(bdev_get_queue(bdev), |
456 | rq_data_dir(rq), GFP_ATOMIC); | 457 | rq_data_dir(rq), BLK_MQ_REQ_NOWAIT); |
457 | if (IS_ERR(*__clone)) { | 458 | if (IS_ERR(*__clone)) { |
458 | /* ENOMEM, requeue */ | 459 | /* ENOMEM, requeue */ |
459 | clear_request_fn_mpio(m, map_context); | 460 | clear_request_fn_mpio(m, map_context); |
@@ -491,7 +492,7 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, | |||
491 | 492 | ||
492 | static void multipath_release_clone(struct request *clone) | 493 | static void multipath_release_clone(struct request *clone) |
493 | { | 494 | { |
494 | blk_put_request(clone); | 495 | blk_mq_free_request(clone); |
495 | } | 496 | } |
496 | 497 | ||
497 | /* | 498 | /* |