|
@@ -22,7 +22,6 @@
|
|
#include <linux/time.h>
|
|
#include <linux/time.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/delay.h>
|
|
-#include <scsi/scsi_device.h>
|
|
|
|
#include <scsi/scsi_dh.h>
|
|
#include <scsi/scsi_dh.h>
|
|
#include <linux/atomic.h>
|
|
#include <linux/atomic.h>
|
|
#include <linux/blk-mq.h>
|
|
#include <linux/blk-mq.h>
|
|
@@ -805,15 +804,14 @@ static int parse_path_selector(struct dm_arg_set *as, struct priority_group *pg,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int setup_scsi_dh(struct block_device *bdev, struct multipath *m, char **error)
|
|
|
|
|
|
+static int setup_scsi_dh(struct block_device *bdev, struct multipath *m,
|
|
|
|
+ const char *attached_handler_name, char **error)
|
|
{
|
|
{
|
|
struct request_queue *q = bdev_get_queue(bdev);
|
|
struct request_queue *q = bdev_get_queue(bdev);
|
|
- const char *attached_handler_name;
|
|
|
|
int r;
|
|
int r;
|
|
|
|
|
|
if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags)) {
|
|
if (test_bit(MPATHF_RETAIN_ATTACHED_HW_HANDLER, &m->flags)) {
|
|
retain:
|
|
retain:
|
|
- attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL);
|
|
|
|
if (attached_handler_name) {
|
|
if (attached_handler_name) {
|
|
/*
|
|
/*
|
|
* Clear any hw_handler_params associated with a
|
|
* Clear any hw_handler_params associated with a
|
|
@@ -867,7 +865,8 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
|
|
int r;
|
|
int r;
|
|
struct pgpath *p;
|
|
struct pgpath *p;
|
|
struct multipath *m = ti->private;
|
|
struct multipath *m = ti->private;
|
|
- struct scsi_device *sdev;
|
|
|
|
|
|
+ struct request_queue *q;
|
|
|
|
+ const char *attached_handler_name;
|
|
|
|
|
|
/* we need at least a path arg */
|
|
/* we need at least a path arg */
|
|
if (as->argc < 1) {
|
|
if (as->argc < 1) {
|
|
@@ -886,11 +885,11 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
|
|
goto bad;
|
|
goto bad;
|
|
}
|
|
}
|
|
|
|
|
|
- sdev = scsi_device_from_queue(bdev_get_queue(p->path.dev->bdev));
|
|
|
|
- if (sdev) {
|
|
|
|
- put_device(&sdev->sdev_gendev);
|
|
|
|
|
|
+ q = bdev_get_queue(p->path.dev->bdev);
|
|
|
|
+ attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL);
|
|
|
|
+ if (attached_handler_name) {
|
|
INIT_DELAYED_WORK(&p->activate_path, activate_path_work);
|
|
INIT_DELAYED_WORK(&p->activate_path, activate_path_work);
|
|
- r = setup_scsi_dh(p->path.dev->bdev, m, &ti->error);
|
|
|
|
|
|
+ r = setup_scsi_dh(p->path.dev->bdev, m, attached_handler_name, &ti->error);
|
|
if (r) {
|
|
if (r) {
|
|
dm_put_device(ti, p->path.dev);
|
|
dm_put_device(ti, p->path.dev);
|
|
goto bad;
|
|
goto bad;
|