diff options
author | Christoph Hellwig <hch@lst.de> | 2017-01-27 03:46:29 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-01-27 17:08:35 -0500 |
commit | 82ed4db499b8598f16f8871261bff088d6b0597f (patch) | |
tree | e1cc0a433bf5ae2b9723837291617bdfeeb61816 /drivers/scsi/libsas/sas_host_smp.c | |
parent | 8ae94eb65be9425af4d57a4f4cfebfdf03081e93 (diff) |
block: split scsi_request out of struct request
And require all drivers that want to support BLOCK_PC to allocate it
as the first thing of their private data. To support this the legacy
IDE and BSG code is switched to set cmd_size on their queues to let
the block layer allocate the additional space.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi/libsas/sas_host_smp.c')
-rw-r--r-- | drivers/scsi/libsas/sas_host_smp.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/libsas/sas_host_smp.c b/drivers/scsi/libsas/sas_host_smp.c index d24792575169..45cbbc44f4d7 100644 --- a/drivers/scsi/libsas/sas_host_smp.c +++ b/drivers/scsi/libsas/sas_host_smp.c | |||
@@ -274,15 +274,15 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, | |||
274 | 274 | ||
275 | switch (req_data[1]) { | 275 | switch (req_data[1]) { |
276 | case SMP_REPORT_GENERAL: | 276 | case SMP_REPORT_GENERAL: |
277 | req->resid_len -= 8; | 277 | scsi_req(req)->resid_len -= 8; |
278 | rsp->resid_len -= 32; | 278 | scsi_req(rsp)->resid_len -= 32; |
279 | resp_data[2] = SMP_RESP_FUNC_ACC; | 279 | resp_data[2] = SMP_RESP_FUNC_ACC; |
280 | resp_data[9] = sas_ha->num_phys; | 280 | resp_data[9] = sas_ha->num_phys; |
281 | break; | 281 | break; |
282 | 282 | ||
283 | case SMP_REPORT_MANUF_INFO: | 283 | case SMP_REPORT_MANUF_INFO: |
284 | req->resid_len -= 8; | 284 | scsi_req(req)->resid_len -= 8; |
285 | rsp->resid_len -= 64; | 285 | scsi_req(rsp)->resid_len -= 64; |
286 | resp_data[2] = SMP_RESP_FUNC_ACC; | 286 | resp_data[2] = SMP_RESP_FUNC_ACC; |
287 | memcpy(resp_data + 12, shost->hostt->name, | 287 | memcpy(resp_data + 12, shost->hostt->name, |
288 | SAS_EXPANDER_VENDOR_ID_LEN); | 288 | SAS_EXPANDER_VENDOR_ID_LEN); |
@@ -295,13 +295,13 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, | |||
295 | break; | 295 | break; |
296 | 296 | ||
297 | case SMP_DISCOVER: | 297 | case SMP_DISCOVER: |
298 | req->resid_len -= 16; | 298 | scsi_req(req)->resid_len -= 16; |
299 | if ((int)req->resid_len < 0) { | 299 | if ((int)scsi_req(req)->resid_len < 0) { |
300 | req->resid_len = 0; | 300 | scsi_req(req)->resid_len = 0; |
301 | error = -EINVAL; | 301 | error = -EINVAL; |
302 | goto out; | 302 | goto out; |
303 | } | 303 | } |
304 | rsp->resid_len -= 56; | 304 | scsi_req(rsp)->resid_len -= 56; |
305 | sas_host_smp_discover(sas_ha, resp_data, req_data[9]); | 305 | sas_host_smp_discover(sas_ha, resp_data, req_data[9]); |
306 | break; | 306 | break; |
307 | 307 | ||
@@ -311,13 +311,13 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, | |||
311 | break; | 311 | break; |
312 | 312 | ||
313 | case SMP_REPORT_PHY_SATA: | 313 | case SMP_REPORT_PHY_SATA: |
314 | req->resid_len -= 16; | 314 | scsi_req(req)->resid_len -= 16; |
315 | if ((int)req->resid_len < 0) { | 315 | if ((int)scsi_req(req)->resid_len < 0) { |
316 | req->resid_len = 0; | 316 | scsi_req(req)->resid_len = 0; |
317 | error = -EINVAL; | 317 | error = -EINVAL; |
318 | goto out; | 318 | goto out; |
319 | } | 319 | } |
320 | rsp->resid_len -= 60; | 320 | scsi_req(rsp)->resid_len -= 60; |
321 | sas_report_phy_sata(sas_ha, resp_data, req_data[9]); | 321 | sas_report_phy_sata(sas_ha, resp_data, req_data[9]); |
322 | break; | 322 | break; |
323 | 323 | ||
@@ -331,15 +331,15 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, | |||
331 | int to_write = req_data[4]; | 331 | int to_write = req_data[4]; |
332 | 332 | ||
333 | if (blk_rq_bytes(req) < base_frame_size + to_write * 4 || | 333 | if (blk_rq_bytes(req) < base_frame_size + to_write * 4 || |
334 | req->resid_len < base_frame_size + to_write * 4) { | 334 | scsi_req(req)->resid_len < base_frame_size + to_write * 4) { |
335 | resp_data[2] = SMP_RESP_INV_FRM_LEN; | 335 | resp_data[2] = SMP_RESP_INV_FRM_LEN; |
336 | break; | 336 | break; |
337 | } | 337 | } |
338 | 338 | ||
339 | to_write = sas_host_smp_write_gpio(sas_ha, resp_data, req_data[2], | 339 | to_write = sas_host_smp_write_gpio(sas_ha, resp_data, req_data[2], |
340 | req_data[3], to_write, &req_data[8]); | 340 | req_data[3], to_write, &req_data[8]); |
341 | req->resid_len -= base_frame_size + to_write * 4; | 341 | scsi_req(req)->resid_len -= base_frame_size + to_write * 4; |
342 | rsp->resid_len -= 8; | 342 | scsi_req(rsp)->resid_len -= 8; |
343 | break; | 343 | break; |
344 | } | 344 | } |
345 | 345 | ||
@@ -348,13 +348,13 @@ int sas_smp_host_handler(struct Scsi_Host *shost, struct request *req, | |||
348 | break; | 348 | break; |
349 | 349 | ||
350 | case SMP_PHY_CONTROL: | 350 | case SMP_PHY_CONTROL: |
351 | req->resid_len -= 44; | 351 | scsi_req(req)->resid_len -= 44; |
352 | if ((int)req->resid_len < 0) { | 352 | if ((int)scsi_req(req)->resid_len < 0) { |
353 | req->resid_len = 0; | 353 | scsi_req(req)->resid_len = 0; |
354 | error = -EINVAL; | 354 | error = -EINVAL; |
355 | goto out; | 355 | goto out; |
356 | } | 356 | } |
357 | rsp->resid_len -= 8; | 357 | scsi_req(rsp)->resid_len -= 8; |
358 | sas_phy_control(sas_ha, req_data[9], req_data[10], | 358 | sas_phy_control(sas_ha, req_data[9], req_data[10], |
359 | req_data[32] >> 4, req_data[33] >> 4, | 359 | req_data[32] >> 4, req_data[33] >> 4, |
360 | resp_data); | 360 | resp_data); |