Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * BSG helper library |
| 3 | * |
| 4 | * Copyright (C) 2008 James Smart, Emulex Corporation |
| 5 | * Copyright (C) 2011 Red Hat, Inc. All rights reserved. |
| 6 | * Copyright (C) 2011 Mike Christie |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 | * |
| 22 | */ |
| 23 | #include <linux/slab.h> |
| 24 | #include <linux/blkdev.h> |
| 25 | #include <linux/delay.h> |
| 26 | #include <linux/scatterlist.h> |
| 27 | #include <linux/bsg-lib.h> |
Paul Gortmaker | 6adb123 | 2011-09-28 18:26:05 -0400 | [diff] [blame] | 28 | #include <linux/export.h> |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 29 | #include <scsi/scsi_cmnd.h> |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 30 | #include <scsi/sg.h> |
| 31 | |
| 32 | #define uptr64(val) ((void __user *)(uintptr_t)(val)) |
| 33 | |
| 34 | static int bsg_transport_check_proto(struct sg_io_v4 *hdr) |
| 35 | { |
| 36 | if (hdr->protocol != BSG_PROTOCOL_SCSI || |
| 37 | hdr->subprotocol != BSG_SUB_PROTOCOL_SCSI_TRANSPORT) |
| 38 | return -EINVAL; |
| 39 | if (!capable(CAP_SYS_RAWIO)) |
| 40 | return -EPERM; |
| 41 | return 0; |
| 42 | } |
| 43 | |
| 44 | static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr, |
| 45 | fmode_t mode) |
| 46 | { |
| 47 | struct bsg_job *job = blk_mq_rq_to_pdu(rq); |
| 48 | |
| 49 | job->request_len = hdr->request_len; |
| 50 | job->request = memdup_user(uptr64(hdr->request), hdr->request_len); |
| 51 | if (IS_ERR(job->request)) |
| 52 | return PTR_ERR(job->request); |
| 53 | return 0; |
| 54 | } |
| 55 | |
| 56 | static int bsg_transport_complete_rq(struct request *rq, struct sg_io_v4 *hdr) |
| 57 | { |
| 58 | struct bsg_job *job = blk_mq_rq_to_pdu(rq); |
| 59 | int ret = 0; |
| 60 | |
| 61 | /* |
| 62 | * The assignments below don't make much sense, but are kept for |
| 63 | * bug by bug backwards compatibility: |
| 64 | */ |
| 65 | hdr->device_status = job->result & 0xff; |
| 66 | hdr->transport_status = host_byte(job->result); |
| 67 | hdr->driver_status = driver_byte(job->result); |
| 68 | hdr->info = 0; |
| 69 | if (hdr->device_status || hdr->transport_status || hdr->driver_status) |
| 70 | hdr->info |= SG_INFO_CHECK; |
| 71 | hdr->response_len = 0; |
| 72 | |
| 73 | if (job->result < 0) { |
| 74 | /* we're only returning the result field in the reply */ |
| 75 | job->reply_len = sizeof(u32); |
| 76 | ret = job->result; |
| 77 | } |
| 78 | |
| 79 | if (job->reply_len && hdr->response) { |
| 80 | int len = min(hdr->max_response_len, job->reply_len); |
| 81 | |
| 82 | if (copy_to_user(uptr64(hdr->response), job->reply, len)) |
| 83 | ret = -EFAULT; |
| 84 | else |
| 85 | hdr->response_len = len; |
| 86 | } |
| 87 | |
| 88 | /* we assume all request payload was transferred, residual == 0 */ |
| 89 | hdr->dout_resid = 0; |
| 90 | |
| 91 | if (rq->next_rq) { |
| 92 | unsigned int rsp_len = job->reply_payload.payload_len; |
| 93 | |
| 94 | if (WARN_ON(job->reply_payload_rcv_len > rsp_len)) |
| 95 | hdr->din_resid = 0; |
| 96 | else |
| 97 | hdr->din_resid = rsp_len - job->reply_payload_rcv_len; |
| 98 | } else { |
| 99 | hdr->din_resid = 0; |
| 100 | } |
| 101 | |
| 102 | return ret; |
| 103 | } |
| 104 | |
| 105 | static void bsg_transport_free_rq(struct request *rq) |
| 106 | { |
| 107 | struct bsg_job *job = blk_mq_rq_to_pdu(rq); |
| 108 | |
| 109 | kfree(job->request); |
| 110 | } |
| 111 | |
| 112 | static const struct bsg_ops bsg_transport_ops = { |
| 113 | .check_proto = bsg_transport_check_proto, |
| 114 | .fill_hdr = bsg_transport_fill_hdr, |
| 115 | .complete_rq = bsg_transport_complete_rq, |
| 116 | .free_rq = bsg_transport_free_rq, |
| 117 | }; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 118 | |
| 119 | /** |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 120 | * bsg_teardown_job - routine to teardown a bsg job |
Bart Van Assche | aa98192 | 2018-01-09 10:11:00 -0800 | [diff] [blame] | 121 | * @kref: kref inside bsg_job that is to be torn down |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 122 | */ |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 123 | static void bsg_teardown_job(struct kref *kref) |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 124 | { |
Johannes Thumshirn | bf0f2d3 | 2016-11-17 10:31:18 +0100 | [diff] [blame] | 125 | struct bsg_job *job = container_of(kref, struct bsg_job, kref); |
Christoph Hellwig | ef6fa64 | 2018-03-13 17:28:40 +0100 | [diff] [blame] | 126 | struct request *rq = blk_mq_rq_from_pdu(job); |
Johannes Thumshirn | c00da4c | 2016-11-17 10:31:20 +0100 | [diff] [blame] | 127 | |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 128 | put_device(job->dev); /* release reference for the request */ |
| 129 | |
| 130 | kfree(job->request_payload.sg_list); |
| 131 | kfree(job->reply_payload.sg_list); |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 132 | |
| 133 | blk_end_request_all(rq, BLK_STS_OK); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 134 | } |
| 135 | |
Johannes Thumshirn | fb6f7c8 | 2016-11-17 10:31:23 +0100 | [diff] [blame] | 136 | void bsg_job_put(struct bsg_job *job) |
| 137 | { |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 138 | kref_put(&job->kref, bsg_teardown_job); |
Johannes Thumshirn | fb6f7c8 | 2016-11-17 10:31:23 +0100 | [diff] [blame] | 139 | } |
| 140 | EXPORT_SYMBOL_GPL(bsg_job_put); |
| 141 | |
| 142 | int bsg_job_get(struct bsg_job *job) |
| 143 | { |
| 144 | return kref_get_unless_zero(&job->kref); |
| 145 | } |
| 146 | EXPORT_SYMBOL_GPL(bsg_job_get); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 147 | |
| 148 | /** |
| 149 | * bsg_job_done - completion routine for bsg requests |
| 150 | * @job: bsg_job that is complete |
| 151 | * @result: job reply result |
| 152 | * @reply_payload_rcv_len: length of payload recvd |
| 153 | * |
| 154 | * The LLD should call this when the bsg job has completed. |
| 155 | */ |
| 156 | void bsg_job_done(struct bsg_job *job, int result, |
| 157 | unsigned int reply_payload_rcv_len) |
| 158 | { |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 159 | job->result = result; |
| 160 | job->reply_payload_rcv_len = reply_payload_rcv_len; |
| 161 | blk_complete_request(blk_mq_rq_from_pdu(job)); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 162 | } |
| 163 | EXPORT_SYMBOL_GPL(bsg_job_done); |
| 164 | |
| 165 | /** |
| 166 | * bsg_softirq_done - softirq done routine for destroying the bsg requests |
| 167 | * @rq: BSG request that holds the job to be destroyed |
| 168 | */ |
| 169 | static void bsg_softirq_done(struct request *rq) |
| 170 | { |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 171 | struct bsg_job *job = blk_mq_rq_to_pdu(rq); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 172 | |
Johannes Thumshirn | fb6f7c8 | 2016-11-17 10:31:23 +0100 | [diff] [blame] | 173 | bsg_job_put(job); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 174 | } |
| 175 | |
| 176 | static int bsg_map_buffer(struct bsg_buffer *buf, struct request *req) |
| 177 | { |
| 178 | size_t sz = (sizeof(struct scatterlist) * req->nr_phys_segments); |
| 179 | |
| 180 | BUG_ON(!req->nr_phys_segments); |
| 181 | |
| 182 | buf->sg_list = kzalloc(sz, GFP_KERNEL); |
| 183 | if (!buf->sg_list) |
| 184 | return -ENOMEM; |
| 185 | sg_init_table(buf->sg_list, req->nr_phys_segments); |
| 186 | buf->sg_cnt = blk_rq_map_sg(req->q, req, buf->sg_list); |
| 187 | buf->payload_len = blk_rq_bytes(req); |
| 188 | return 0; |
| 189 | } |
| 190 | |
| 191 | /** |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 192 | * bsg_prepare_job - create the bsg_job structure for the bsg request |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 193 | * @dev: device that is being sent the bsg request |
| 194 | * @req: BSG request that needs a job structure |
| 195 | */ |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 196 | static bool bsg_prepare_job(struct device *dev, struct request *req) |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 197 | { |
| 198 | struct request *rsp = req->next_rq; |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 199 | struct bsg_job *job = blk_mq_rq_to_pdu(req); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 200 | int ret; |
| 201 | |
Christoph Hellwig | 31156ec | 2018-03-13 17:28:39 +0100 | [diff] [blame] | 202 | job->timeout = req->timeout; |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 203 | |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 204 | if (req->bio) { |
| 205 | ret = bsg_map_buffer(&job->request_payload, req); |
| 206 | if (ret) |
| 207 | goto failjob_rls_job; |
| 208 | } |
| 209 | if (rsp && rsp->bio) { |
| 210 | ret = bsg_map_buffer(&job->reply_payload, rsp); |
| 211 | if (ret) |
| 212 | goto failjob_rls_rqst_payload; |
| 213 | } |
| 214 | job->dev = dev; |
| 215 | /* take a reference for the request */ |
| 216 | get_device(job->dev); |
Johannes Thumshirn | bf0f2d3 | 2016-11-17 10:31:18 +0100 | [diff] [blame] | 217 | kref_init(&job->kref); |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 218 | return true; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 219 | |
| 220 | failjob_rls_rqst_payload: |
| 221 | kfree(job->request_payload.sg_list); |
| 222 | failjob_rls_job: |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 223 | job->result = -ENOMEM; |
| 224 | return false; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 225 | } |
| 226 | |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 227 | /** |
| 228 | * bsg_request_fn - generic handler for bsg requests |
| 229 | * @q: request queue to manage |
| 230 | * |
| 231 | * On error the create_bsg_job function should return a -Exyz error value |
Christoph Hellwig | 17d5363 | 2017-04-20 16:03:01 +0200 | [diff] [blame] | 232 | * that will be set to ->result. |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 233 | * |
| 234 | * Drivers/subsys should pass this to the queue init function. |
| 235 | */ |
Christoph Hellwig | 8ae94eb | 2017-01-03 15:25:02 +0300 | [diff] [blame] | 236 | static void bsg_request_fn(struct request_queue *q) |
Bart Van Assche | dbb3ab0 | 2016-09-25 19:54:38 -0700 | [diff] [blame] | 237 | __releases(q->queue_lock) |
| 238 | __acquires(q->queue_lock) |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 239 | { |
| 240 | struct device *dev = q->queuedata; |
| 241 | struct request *req; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 242 | int ret; |
| 243 | |
| 244 | if (!get_device(dev)) |
| 245 | return; |
| 246 | |
| 247 | while (1) { |
| 248 | req = blk_fetch_request(q); |
| 249 | if (!req) |
| 250 | break; |
| 251 | spin_unlock_irq(q->queue_lock); |
| 252 | |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 253 | if (!bsg_prepare_job(dev, req)) { |
Christoph Hellwig | 2a842ac | 2017-06-03 09:38:04 +0200 | [diff] [blame] | 254 | blk_end_request_all(req, BLK_STS_OK); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 255 | spin_lock_irq(q->queue_lock); |
| 256 | continue; |
| 257 | } |
| 258 | |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 259 | ret = q->bsg_job_fn(blk_mq_rq_to_pdu(req)); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 260 | spin_lock_irq(q->queue_lock); |
| 261 | if (ret) |
| 262 | break; |
| 263 | } |
| 264 | |
| 265 | spin_unlock_irq(q->queue_lock); |
| 266 | put_device(dev); |
| 267 | spin_lock_irq(q->queue_lock); |
| 268 | } |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 269 | |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 270 | /* called right after the request is allocated for the request_queue */ |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 271 | static int bsg_init_rq(struct request_queue *q, struct request *req, gfp_t gfp) |
| 272 | { |
| 273 | struct bsg_job *job = blk_mq_rq_to_pdu(req); |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 274 | |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 275 | job->reply = kzalloc(SCSI_SENSE_BUFFERSIZE, gfp); |
| 276 | if (!job->reply) |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 277 | return -ENOMEM; |
Benjamin Block | eab40cf | 2017-10-03 12:48:37 +0200 | [diff] [blame] | 278 | return 0; |
| 279 | } |
| 280 | |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 281 | /* called right before the request is given to the request_queue user */ |
Benjamin Block | eab40cf | 2017-10-03 12:48:37 +0200 | [diff] [blame] | 282 | static void bsg_initialize_rq(struct request *req) |
| 283 | { |
| 284 | struct bsg_job *job = blk_mq_rq_to_pdu(req); |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 285 | void *reply = job->reply; |
Benjamin Block | eab40cf | 2017-10-03 12:48:37 +0200 | [diff] [blame] | 286 | |
| 287 | memset(job, 0, sizeof(*job)); |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 288 | job->reply = reply; |
| 289 | job->reply_len = SCSI_SENSE_BUFFERSIZE; |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 290 | job->dd_data = job + 1; |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 291 | } |
| 292 | |
| 293 | static void bsg_exit_rq(struct request_queue *q, struct request *req) |
| 294 | { |
| 295 | struct bsg_job *job = blk_mq_rq_to_pdu(req); |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 296 | |
Christoph Hellwig | 17cb960 | 2018-03-13 17:28:41 +0100 | [diff] [blame] | 297 | kfree(job->reply); |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 298 | } |
| 299 | |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 300 | /** |
| 301 | * bsg_setup_queue - Create and add the bsg hooks so we can receive requests |
| 302 | * @dev: device to attach bsg device to |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 303 | * @name: device to give bsg device |
| 304 | * @job_fn: bsg job handler |
| 305 | * @dd_job_size: size of LLD data needed for each job |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 306 | */ |
Christoph Hellwig | c1225f0 | 2017-08-25 17:37:38 +0200 | [diff] [blame] | 307 | struct request_queue *bsg_setup_queue(struct device *dev, const char *name, |
Christoph Hellwig | 5de815a | 2018-05-29 08:40:23 +0200 | [diff] [blame] | 308 | bsg_job_fn *job_fn, int dd_job_size) |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 309 | { |
Christoph Hellwig | 8ae94eb | 2017-01-03 15:25:02 +0300 | [diff] [blame] | 310 | struct request_queue *q; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 311 | int ret; |
| 312 | |
Christoph Hellwig | 82ed4db | 2017-01-27 09:46:29 +0100 | [diff] [blame] | 313 | q = blk_alloc_queue(GFP_KERNEL); |
Christoph Hellwig | 8ae94eb | 2017-01-03 15:25:02 +0300 | [diff] [blame] | 314 | if (!q) |
| 315 | return ERR_PTR(-ENOMEM); |
Benjamin Block | 50b4d48 | 2017-08-24 01:57:56 +0200 | [diff] [blame] | 316 | q->cmd_size = sizeof(struct bsg_job) + dd_job_size; |
| 317 | q->init_rq_fn = bsg_init_rq; |
| 318 | q->exit_rq_fn = bsg_exit_rq; |
Benjamin Block | eab40cf | 2017-10-03 12:48:37 +0200 | [diff] [blame] | 319 | q->initialize_rq_fn = bsg_initialize_rq; |
Christoph Hellwig | 82ed4db | 2017-01-27 09:46:29 +0100 | [diff] [blame] | 320 | q->request_fn = bsg_request_fn; |
| 321 | |
| 322 | ret = blk_init_allocated_queue(q); |
| 323 | if (ret) |
| 324 | goto out_cleanup_queue; |
Christoph Hellwig | 8ae94eb | 2017-01-03 15:25:02 +0300 | [diff] [blame] | 325 | |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 326 | q->queuedata = dev; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 327 | q->bsg_job_fn = job_fn; |
Bart Van Assche | 8b904b5 | 2018-03-07 17:10:10 -0800 | [diff] [blame] | 328 | blk_queue_flag_set(QUEUE_FLAG_BIDI, q); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 329 | blk_queue_softirq_done(q, bsg_softirq_done); |
| 330 | blk_queue_rq_timeout(q, BLK_DEFAULT_SG_TIMEOUT); |
| 331 | |
Christoph Hellwig | 5de815a | 2018-05-29 08:40:23 +0200 | [diff] [blame] | 332 | ret = bsg_register_queue(q, dev, name, &bsg_transport_ops); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 333 | if (ret) { |
| 334 | printk(KERN_ERR "%s: bsg interface failed to " |
| 335 | "initialize - register queue\n", dev->kobj.name); |
Christoph Hellwig | 82ed4db | 2017-01-27 09:46:29 +0100 | [diff] [blame] | 336 | goto out_cleanup_queue; |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 337 | } |
| 338 | |
Christoph Hellwig | 8ae94eb | 2017-01-03 15:25:02 +0300 | [diff] [blame] | 339 | return q; |
Christoph Hellwig | 82ed4db | 2017-01-27 09:46:29 +0100 | [diff] [blame] | 340 | out_cleanup_queue: |
| 341 | blk_cleanup_queue(q); |
| 342 | return ERR_PTR(ret); |
Mike Christie | aa387cc | 2011-07-31 22:05:09 +0200 | [diff] [blame] | 343 | } |
| 344 | EXPORT_SYMBOL_GPL(bsg_setup_queue); |