]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
scsi: remove __scsi_alloc_queue
authorChristoph Hellwig <hch@lst.de>
Mon, 2 Jan 2017 18:52:10 +0000 (21:52 +0300)
committerJens Axboe <axboe@fb.com>
Fri, 27 Jan 2017 22:08:35 +0000 (15:08 -0700)
Instead do an internal export of __scsi_init_queue for the transport
classes that export BSG nodes.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_transport_fc.c
drivers/scsi/scsi_transport_iscsi.c
include/scsi/scsi_host.h
include/scsi/scsi_transport.h

index 3d6b364a8d8292897f9dbe00fad25b51cd0401a9..79505169e740655c8598eb952d81b03476373091 100644 (file)
@@ -2082,7 +2082,7 @@ static u64 scsi_calculate_bounce_limit(struct Scsi_Host *shost)
        return bounce_limit;
 }
 
-static void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
+void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
 {
        struct device *dev = shost->dma_dev;
 
@@ -2117,28 +2117,17 @@ static void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q)
         */
        blk_queue_dma_alignment(q, 0x03);
 }
-
-struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
-                                        request_fn_proc *request_fn)
-{
-       struct request_queue *q;
-
-       q = blk_init_queue(request_fn, NULL);
-       if (!q)
-               return NULL;
-       __scsi_init_queue(shost, q);
-       return q;
-}
-EXPORT_SYMBOL(__scsi_alloc_queue);
+EXPORT_SYMBOL_GPL(__scsi_init_queue);
 
 struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
 {
        struct request_queue *q;
 
-       q = __scsi_alloc_queue(sdev->host, scsi_request_fn);
+       q = blk_init_queue(scsi_request_fn, NULL);
        if (!q)
                return NULL;
 
+       __scsi_init_queue(sdev->host, q);
        blk_queue_prep_rq(q, scsi_prep_fn);
        blk_queue_unprep_rq(q, scsi_unprep_fn);
        blk_queue_softirq_done(q, scsi_softirq_done);
index 03577bde6ac56b91e92f8e631d98907a19dfb273..afcedec58d171f6c0d6b91bcc61fd8aacc14ce81 100644 (file)
@@ -3776,7 +3776,7 @@ 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 = __scsi_alloc_queue(shost, bsg_request_fn);
+       q = blk_init_queue(bsg_request_fn, NULL);
        if (!q) {
                dev_err(dev,
                        "fc_host%d: bsg interface failed to initialize - no request queue\n",
@@ -3784,6 +3784,7 @@ fc_bsg_hostadd(struct Scsi_Host *shost, struct fc_host_attrs *fc_host)
                return -ENOMEM;
        }
 
+       __scsi_init_queue(shost, q);
        err = bsg_setup_queue(dev, q, bsg_name, fc_bsg_dispatch,
                                 i->f->dd_bsg_size);
        if (err) {
@@ -3831,12 +3832,13 @@ fc_bsg_rportadd(struct Scsi_Host *shost, struct fc_rport *rport)
        if (!i->f->bsg_request)
                return -ENOTSUPP;
 
-       q = __scsi_alloc_queue(shost, bsg_request_fn);
+       q = blk_init_queue(bsg_request_fn, NULL);
        if (!q) {
                dev_err(dev, "bsg interface failed to initialize - no request queue\n");
                return -ENOMEM;
        }
 
+       __scsi_init_queue(shost, q);
        err = bsg_setup_queue(dev, q, NULL, fc_bsg_dispatch, i->f->dd_bsg_size);
        if (err) {
                dev_err(dev, "failed to setup bsg queue\n");
index 42bca619f8545746f60802ad0b33e15529e57f1c..04ebe6e65b831c3b5b79ffb46aee5d09ed133b6c 100644 (file)
@@ -1544,10 +1544,11 @@ iscsi_bsg_host_add(struct Scsi_Host *shost, struct iscsi_cls_host *ihost)
 
        snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no);
 
-       q = __scsi_alloc_queue(shost, bsg_request_fn);
+       q = blk_init_queue(bsg_request_fn, NULL);
        if (!q)
                return -ENOMEM;
 
+       __scsi_init_queue(shost, q);
        ret = bsg_setup_queue(dev, q, bsg_name, iscsi_bsg_host_dispatch, 0);
        if (ret) {
                shost_printk(KERN_ERR, shost, "bsg interface failed to "
index 36680f13270d7c02eea5fc2028f4f37df9808f1f..f4964d7db3131f324867f1b6520effff52c6f29e 100644 (file)
@@ -826,8 +826,6 @@ extern void scsi_block_requests(struct Scsi_Host *);
 
 struct class_container;
 
-extern struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
-                                               void (*) (struct request_queue *));
 /*
  * These two functions are used to allocate and free a pseudo device
  * which will connect to the host adapter itself rather than any
index 81292392adbcdf9142de2a97a83b14b44f335cfe..b6e07b56d013f1d40e5a7c055c2d391d5466fc18 100644 (file)
@@ -119,4 +119,6 @@ scsi_transport_device_data(struct scsi_device *sdev)
                + shost->transportt->device_private_offset;
 }
 
+void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q);
+
 #endif /* SCSI_TRANSPORT_H */