summaryrefslogtreecommitdiffstats
path: root/block/blk-exec.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-01-27 03:46:29 -0500
committerJens Axboe <axboe@fb.com>2017-01-27 17:08:35 -0500
commit82ed4db499b8598f16f8871261bff088d6b0597f (patch)
treee1cc0a433bf5ae2b9723837291617bdfeeb61816 /block/blk-exec.c
parent8ae94eb65be9425af4d57a4f4cfebfdf03081e93 (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 'block/blk-exec.c')
-rw-r--r--block/blk-exec.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/block/blk-exec.c b/block/blk-exec.c
index ed1f10165268..ed51800f4b44 100644
--- a/block/blk-exec.c
+++ b/block/blk-exec.c
@@ -11,11 +11,6 @@
11#include "blk.h" 11#include "blk.h"
12#include "blk-mq-sched.h" 12#include "blk-mq-sched.h"
13 13
14/*
15 * for max sense size
16 */
17#include <scsi/scsi_cmnd.h>
18
19/** 14/**
20 * blk_end_sync_rq - executes a completion event on a request 15 * blk_end_sync_rq - executes a completion event on a request
21 * @rq: request to complete 16 * @rq: request to complete
@@ -101,16 +96,9 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
101 struct request *rq, int at_head) 96 struct request *rq, int at_head)
102{ 97{
103 DECLARE_COMPLETION_ONSTACK(wait); 98 DECLARE_COMPLETION_ONSTACK(wait);
104 char sense[SCSI_SENSE_BUFFERSIZE];
105 int err = 0; 99 int err = 0;
106 unsigned long hang_check; 100 unsigned long hang_check;
107 101
108 if (!rq->sense) {
109 memset(sense, 0, sizeof(sense));
110 rq->sense = sense;
111 rq->sense_len = 0;
112 }
113
114 rq->end_io_data = &wait; 102 rq->end_io_data = &wait;
115 blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq); 103 blk_execute_rq_nowait(q, bd_disk, rq, at_head, blk_end_sync_rq);
116 104
@@ -124,11 +112,6 @@ int blk_execute_rq(struct request_queue *q, struct gendisk *bd_disk,
124 if (rq->errors) 112 if (rq->errors)
125 err = -EIO; 113 err = -EIO;
126 114
127 if (rq->sense == sense) {
128 rq->sense = NULL;
129 rq->sense_len = 0;
130 }
131
132 return err; 115 return err;
133} 116}
134EXPORT_SYMBOL(blk_execute_rq); 117EXPORT_SYMBOL(blk_execute_rq);