License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6/btrfs-unstable.git] / include / scsi / scsi_request.h
blobb06f28c749085b0901c809ae506ab3ec9d8dc464
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _SCSI_SCSI_REQUEST_H
3 #define _SCSI_SCSI_REQUEST_H
5 #include <linux/blk-mq.h>
7 #define BLK_MAX_CDB 16
9 struct scsi_request {
10 unsigned char __cmd[BLK_MAX_CDB];
11 unsigned char *cmd;
12 unsigned short cmd_len;
13 int result;
14 unsigned int sense_len;
15 unsigned int resid_len; /* residual count */
16 int retries;
17 void *sense;
20 static inline struct scsi_request *scsi_req(struct request *rq)
22 return blk_mq_rq_to_pdu(rq);
25 static inline void scsi_req_free_cmd(struct scsi_request *req)
27 if (req->cmd != req->__cmd)
28 kfree(req->cmd);
31 void scsi_req_init(struct scsi_request *req);
33 #endif /* _SCSI_SCSI_REQUEST_H */