summaryrefslogtreecommitdiff
path: root/include/linux/bsg-lib.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-03-13 19:28:41 +0300
committerJens Axboe <axboe@kernel.dk>2018-03-13 20:40:24 +0300
commit17cb960f29c29ee07bf6848ada3265f4be55972e (patch)
tree8571a25cac75a45261456dbe6711f324dc5b1044 /include/linux/bsg-lib.h
parentef6fa64f9b8e1611854077ea9213f2eef2428cd2 (diff)
downloadlinux-17cb960f29c29ee07bf6848ada3265f4be55972e.tar.xz
bsg: split handling of SCSI CDBs vs transport requeues
The current BSG design tries to shoe-horn the transport-specific passthrough commands into the overall framework for SCSI passthrough requests. This has a couple problems: - each passthrough queue has to set the QUEUE_FLAG_SCSI_PASSTHROUGH flag despite not dealing with SCSI commands at all. Because of that these queues could also incorrectly accept SCSI commands from in-kernel users or through the legacy SCSI_IOCTL_SEND_COMMAND ioctl. - the real SCSI bsg queues also incorrectly accept bsg requests of the BSG_SUB_PROTOCOL_SCSI_TRANSPORT type - the bsg transport code is almost unredable because it tries to reuse different SCSI concepts for its own purpose. This patch instead adds a new bsg_ops structure to handle the two cases differently, and thus solves all of the above problems. Another side effect is that the bsg-lib queues also don't need to embedd a struct scsi_request anymore. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/bsg-lib.h')
-rw-r--r--include/linux/bsg-lib.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
index 08762d297cbd..28a7ccc55c89 100644
--- a/include/linux/bsg-lib.h
+++ b/include/linux/bsg-lib.h
@@ -38,7 +38,6 @@ struct bsg_buffer {
};
struct bsg_job {
- struct scsi_request sreq;
struct device *dev;
struct kref kref;
@@ -64,6 +63,9 @@ struct bsg_job {
struct bsg_buffer request_payload;
struct bsg_buffer reply_payload;
+ int result;
+ unsigned int reply_payload_rcv_len;
+
void *dd_data; /* Used for driver-specific storage */
};