All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <axboe@fb.com>
Cc: Mike Snitzer <snitzer@redhat.com>,
	linux-block@vger.kernel.org, linux-scsi@vger.kernel.org,
	dm-devel@redhat.com
Subject: [PATCH 12/16] scsi: remove __scsi_alloc_queue
Date: Mon, 23 Jan 2017 16:29:17 +0100	[thread overview]
Message-ID: <1485185361-29786-13-git-send-email-hch@lst.de> (raw)
In-Reply-To: <1485185361-29786-1-git-send-email-hch@lst.de>

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>
---
 drivers/scsi/scsi_lib.c             | 19 ++++---------------
 drivers/scsi/scsi_transport_fc.c    |  6 ++++--
 drivers/scsi/scsi_transport_iscsi.c |  3 ++-
 include/scsi/scsi_host.h            |  2 --
 include/scsi/scsi_transport.h       |  2 ++
 5 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3d6b364..7950516 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -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);
diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 03577bd..afcedec 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -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");
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 42bca61..04ebe6e 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -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 "
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 36680f1..f4964d7 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -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
diff --git a/include/scsi/scsi_transport.h b/include/scsi/scsi_transport.h
index 8129239..b6e07b5 100644
--- a/include/scsi/scsi_transport.h
+++ b/include/scsi/scsi_transport.h
@@ -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 */
-- 
2.1.4


  parent reply	other threads:[~2017-01-23 15:30 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 15:29 split scsi passthrough fields out of struct request Christoph Hellwig
2017-01-23 15:29 ` [PATCH 01/16] block: fix elevator init check Christoph Hellwig
2017-01-24  7:02   ` Hannes Reinecke
2017-01-24  7:02     ` Hannes Reinecke
2017-01-24 15:06   ` Jens Axboe
2017-01-24 15:06     ` Jens Axboe
2017-01-24 15:10     ` Christoph Hellwig
2017-01-23 15:29 ` [PATCH 02/16] block: simplify blk_init_allocated_queue Christoph Hellwig
2017-01-24  7:37   ` Hannes Reinecke
2017-01-24  7:37     ` Hannes Reinecke
2017-01-23 15:29 ` [PATCH 03/16] block: allow specifying size for extra command data Christoph Hellwig
2017-01-24  8:10   ` Hannes Reinecke
2017-01-24  8:10     ` Hannes Reinecke
2017-01-23 15:29 ` [PATCH 04/16] dm: remove incomple BLOCK_PC support Christoph Hellwig
2017-01-24  8:22   ` Hannes Reinecke
2017-01-24  8:22     ` Hannes Reinecke
2017-01-23 15:29 ` [PATCH 05/16] dm: always defer request allocation to the owner of the request_queue Christoph Hellwig
2017-01-24  8:29   ` Hannes Reinecke
2017-01-24  8:29     ` Hannes Reinecke
2017-01-24 10:05   ` Mike Snitzer
2017-01-24 14:20     ` Christoph Hellwig
2017-01-24 16:39       ` Mike Snitzer
2017-01-24 19:52         ` Christoph Hellwig
2017-01-26  4:23         ` Junichi Nomura
2017-01-26  4:23           ` Junichi Nomura
2017-01-23 15:29 ` [PATCH 06/16] scsi_dh_rdac: switch to scsi_execute_req_flags() Christoph Hellwig
2017-01-23 15:29 ` [PATCH 07/16] scsi_dh_emc: " Christoph Hellwig
2017-01-23 15:29 ` [PATCH 08/16] scsi_dh_hp_sw: " Christoph Hellwig
2017-01-23 15:29 ` [PATCH 09/16] scsi: remove gfp_flags member in scsi_host_cmd_pool Christoph Hellwig
2017-01-24  8:31   ` Hannes Reinecke
2017-01-24 12:08   ` Johannes Thumshirn
2017-01-24 12:08     ` Johannes Thumshirn
2017-01-23 15:29 ` [PATCH 10/16] scsi: respect unchecked_isa_dma for blk-mq Christoph Hellwig
2017-01-24 11:06   ` Hannes Reinecke
2017-01-24 11:06     ` Hannes Reinecke
2017-01-23 15:29 ` [PATCH 11/16] scsi: remove scsi_cmd_dma_pool Christoph Hellwig
2017-01-24 11:07   ` Hannes Reinecke
2017-01-24 11:07     ` Hannes Reinecke
2017-01-23 15:29 ` Christoph Hellwig [this message]
2017-01-24 11:08   ` [PATCH 12/16] scsi: remove __scsi_alloc_queue Hannes Reinecke
2017-01-24 11:08     ` Hannes Reinecke
2017-01-24 11:24   ` Johannes Thumshirn
2017-01-24 11:24     ` Johannes Thumshirn
2017-01-23 15:29 ` [PATCH 13/16] scsi: allocate scsi_cmnd structures as part of struct request Christoph Hellwig
2017-01-24 12:57   ` Hannes Reinecke
2017-01-23 15:29 ` [PATCH 14/16] block/bsg: move queue creation into bsg_setup_queue Christoph Hellwig
2017-01-23 15:29 ` [PATCH 15/16] block: split scsi_request out of struct request Christoph Hellwig
2017-01-24  0:33   ` Bart Van Assche
2017-01-24  0:33     ` Bart Van Assche
2017-01-24  8:09     ` hch
2017-01-24 16:31       ` Bart Van Assche
2017-01-24 16:31         ` Bart Van Assche
2017-01-24 13:21   ` Hannes Reinecke
2017-01-24 13:21     ` Hannes Reinecke
2017-01-26 19:12   ` Bart Van Assche
2017-01-26 19:12     ` Bart Van Assche
2017-01-26 19:37     ` Christoph Hellwig
2017-01-26 19:37       ` Christoph Hellwig
2017-01-26 19:42       ` Jens Axboe
2017-01-26 19:42         ` Jens Axboe
2017-01-23 15:29 ` [PATCH 16/16] block: don't assign cmd_flags in __blk_rq_prep_clone Christoph Hellwig
2017-01-24 13:22   ` Hannes Reinecke
2017-01-24 13:22     ` Hannes Reinecke
2017-01-23 15:39 ` split scsi passthrough fields out of struct request Jens Axboe
2017-01-23 15:46   ` Christoph Hellwig
2017-01-24  0:30 ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1485185361-29786-13-git-send-email-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@fb.com \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.