linux/include/scsi/scsi_request.h
Christoph Hellwig 82ed4db499 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>
2017-01-27 15:08:35 -07:00

31 lines
591 B
C

#ifndef _SCSI_SCSI_REQUEST_H
#define _SCSI_SCSI_REQUEST_H
#include <linux/blk-mq.h>
#define BLK_MAX_CDB 16
struct scsi_request {
unsigned char __cmd[BLK_MAX_CDB];
unsigned char *cmd;
unsigned short cmd_len;
unsigned int sense_len;
unsigned int resid_len; /* residual count */
void *sense;
};
static inline struct scsi_request *scsi_req(struct request *rq)
{
return blk_mq_rq_to_pdu(rq);
}
static inline void scsi_req_free_cmd(struct scsi_request *req)
{
if (req->cmd != req->__cmd)
kfree(req->cmd);
}
void scsi_req_init(struct request *);
#endif /* _SCSI_SCSI_REQUEST_H */