mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
![Christoph Hellwig](/assets/img/avatar_default.png)
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>
30 lines
591 B
C
30 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 */
|