scsi: bsg-lib: pass the release callback through bsg_setup_queue
authorChristoph Hellwig <hch@lst.de>
Fri, 25 Aug 2017 15:37:38 +0000 (17:37 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 30 Aug 2017 01:51:43 +0000 (21:51 -0400)
The SAS code will need it.  Also mark the name argument const to match
bsg_register_queue.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
block/bsg-lib.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/scsi_transport_iscsi.c
include/linux/bsg-lib.h

index c4513b23f57a6438af6ae38367c072931edf138c..4752dbc3dc4966ece9c30f25b949245cea2bcff9 100644 (file)
@@ -226,8 +226,9 @@ static void bsg_request_fn(struct request_queue *q)
  * @job_fn: bsg job handler
  * @dd_job_size: size of LLD data needed for each job
  */
-struct request_queue *bsg_setup_queue(struct device *dev, char *name,
-               bsg_job_fn *job_fn, int dd_job_size)
+struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
+               bsg_job_fn *job_fn, int dd_job_size,
+               void (*release)(struct device *))
 {
        struct request_queue *q;
        int ret;
@@ -250,7 +251,7 @@ struct request_queue *bsg_setup_queue(struct device *dev, char *name,
        blk_queue_softirq_done(q, bsg_softirq_done);
        blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT);
 
-       ret = bsg_register_queue(q, dev, name, NULL);
+       ret = bsg_register_queue(q, dev, name, release);
        if (ret) {
                printk(KERN_ERR "%s: bsg interface failed to "
                       "initialize - register queue\n", dev->kobj.name);
index 1118aa5f88cd8bd2432862f1d0e6f2b3d754a427..3c6bc0081fcbe34afcfc5c398a5637a2d31ae3ab 100644 (file)
@@ -3784,7 +3784,8 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
        snprintf(bsg_name, sizeof(bsg_name),
                 "fc_host%d", shost->host_no);
 
-       q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, i->f->dd_bsg_size);
+       q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, i->f->dd_bsg_size,
+                       NULL);
        if (IS_ERR(q)) {
                dev_err(dev,
                        "fc_host%d: bsg interface failed to initialize - setup queue\n",
@@ -3829,7 +3830,8 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport)
        if (!i->f->bsg_request)
                return -ENOTSUPP;
 
-       q = bsg_setup_queue(dev, NULL, fc_bsg_dispatch, i->f->dd_bsg_size);
+       q = bsg_setup_queue(dev, NULL, fc_bsg_dispatch, i->f->dd_bsg_size,
+                       NULL);
        if (IS_ERR(q)) {
                dev_err(dev, "failed to setup bsg queue\n");
                return PTR_ERR(q);
index b9513f82ec53e28bb4db7c5782bb94dbe9091fe4..8934f19bce8ea815d696189e7bb075c43cffaa5c 100644 (file)
@@ -1542,7 +1542,7 @@ iscsi_bsg_host_add(struct Scsi_Host *shost, struct iscsi_cls_host *ihost)
                return -ENOTSUPP;
 
        snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no);
-       q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, 0);
+       q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, 0, NULL);
        if (IS_ERR(q)) {
                shost_printk(KERN_ERR, shost, "bsg interface failed to "
                             "initialize - no request queue\n");
index e34dde2da0ef57c3692ce7001fa66fe37c4dc578..1062f08e1a553077bba5cf1cdf68987ad3d27707 100644 (file)
@@ -66,8 +66,9 @@ struct bsg_job {
 
 void bsg_job_done(struct bsg_job *job, int result,
                  unsigned int reply_payload_rcv_len);
-struct request_queue *bsg_setup_queue(struct device *dev, char *name,
-               bsg_job_fn *job_fn, int dd_job_size);
+struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
+               bsg_job_fn *job_fn, int dd_job_size,
+               void (*release)(struct device *));
 void bsg_job_put(struct bsg_job *job);
 int __must_check bsg_job_get(struct bsg_job *job);