Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: bsg-lib: pass the release callback through bsg_setup_queue

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>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
c1225f01 ccf1e004

+12 -8
+4 -3
block/bsg-lib.c
··· 226 226 * @job_fn: bsg job handler 227 227 * @dd_job_size: size of LLD data needed for each job 228 228 */ 229 - struct request_queue *bsg_setup_queue(struct device *dev, char *name, 230 - bsg_job_fn *job_fn, int dd_job_size) 229 + struct request_queue *bsg_setup_queue(struct device *dev, const char *name, 230 + bsg_job_fn *job_fn, int dd_job_size, 231 + void (*release)(struct device *)) 231 232 { 232 233 struct request_queue *q; 233 234 int ret; ··· 251 250 blk_queue_softirq_done(q, bsg_softirq_done); 252 251 blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT); 253 252 254 - ret = bsg_register_queue(q, dev, name, NULL); 253 + ret = bsg_register_queue(q, dev, name, release); 255 254 if (ret) { 256 255 printk(KERN_ERR "%s: bsg interface failed to " 257 256 "initialize - register queue\n", dev->kobj.name);
+4 -2
drivers/scsi/scsi_transport_fc.c
··· 3784 3784 snprintf(bsg_name, sizeof(bsg_name), 3785 3785 "fc_host%d", shost->host_no); 3786 3786 3787 - q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, i->f->dd_bsg_size); 3787 + q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, i->f->dd_bsg_size, 3788 + NULL); 3788 3789 if (IS_ERR(q)) { 3789 3790 dev_err(dev, 3790 3791 "fc_host%d: bsg interface failed to initialize - setup queue\n", ··· 3830 3829 if (!i->f->bsg_request) 3831 3830 return -ENOTSUPP; 3832 3831 3833 - q = bsg_setup_queue(dev, NULL, fc_bsg_dispatch, i->f->dd_bsg_size); 3832 + q = bsg_setup_queue(dev, NULL, fc_bsg_dispatch, i->f->dd_bsg_size, 3833 + NULL); 3834 3834 if (IS_ERR(q)) { 3835 3835 dev_err(dev, "failed to setup bsg queue\n"); 3836 3836 return PTR_ERR(q);
+1 -1
drivers/scsi/scsi_transport_iscsi.c
··· 1542 1542 return -ENOTSUPP; 1543 1543 1544 1544 snprintf(bsg_name, sizeof(bsg_name), "iscsi_host%d", shost->host_no); 1545 - q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, 0); 1545 + q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, 0, NULL); 1546 1546 if (IS_ERR(q)) { 1547 1547 shost_printk(KERN_ERR, shost, "bsg interface failed to " 1548 1548 "initialize - no request queue\n");
+3 -2
include/linux/bsg-lib.h
··· 66 66 67 67 void bsg_job_done(struct bsg_job *job, int result, 68 68 unsigned int reply_payload_rcv_len); 69 - struct request_queue *bsg_setup_queue(struct device *dev, char *name, 70 - bsg_job_fn *job_fn, int dd_job_size); 69 + struct request_queue *bsg_setup_queue(struct device *dev, const char *name, 70 + bsg_job_fn *job_fn, int dd_job_size, 71 + void (*release)(struct device *)); 71 72 void bsg_job_put(struct bsg_job *job); 72 73 int __must_check bsg_job_get(struct bsg_job *job); 73 74