Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78ce23b5 authored by Mike Snitzer's avatar Mike Snitzer
Browse files

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: default avatarMike Snitzer <snitzer@redhat.com>
parent 2eff1924
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/delay.h>
#include <linux/delay.h>
#include <scsi/scsi_dh.h>
#include <scsi/scsi_dh.h>
#include <linux/atomic.h>
#include <linux/atomic.h>
#include <linux/blk-mq.h>


#define DM_MSG_PREFIX "multipath"
#define DM_MSG_PREFIX "multipath"
#define DM_PG_INIT_DELAY_MSECS 2000
#define DM_PG_INIT_DELAY_MSECS 2000
@@ -452,8 +453,8 @@ static int __multipath_map(struct dm_target *ti, struct request *clone,
		 * .request_fn stacked on blk-mq path(s) and
		 * .request_fn stacked on blk-mq path(s) and
		 * blk-mq stacked on blk-mq path(s).
		 * blk-mq stacked on blk-mq path(s).
		 */
		 */
		*__clone = blk_get_request(bdev_get_queue(bdev),
		*__clone = blk_mq_alloc_request(bdev_get_queue(bdev),
					   rq_data_dir(rq), GFP_ATOMIC);
						rq_data_dir(rq), BLK_MQ_REQ_NOWAIT);
		if (IS_ERR(*__clone)) {
		if (IS_ERR(*__clone)) {
			/* ENOMEM, requeue */
			/* ENOMEM, requeue */
			clear_request_fn_mpio(m, map_context);
			clear_request_fn_mpio(m, map_context);
@@ -491,7 +492,7 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq,


static void multipath_release_clone(struct request *clone)
static void multipath_release_clone(struct request *clone)
{
{
	blk_put_request(clone);
	blk_mq_free_request(clone);
}
}


/*
/*