diff options
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
-rw-r--r-- | include/scsi/scsi_cmnd.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index c6478bb6f963..de28aab820b0 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -2,12 +2,12 @@ | |||
2 | #define _SCSI_SCSI_CMND_H | 2 | #define _SCSI_SCSI_CMND_H |
3 | 3 | ||
4 | #include <linux/dma-mapping.h> | 4 | #include <linux/dma-mapping.h> |
5 | #include <linux/blkdev.h> | ||
5 | #include <linux/list.h> | 6 | #include <linux/list.h> |
6 | #include <linux/types.h> | 7 | #include <linux/types.h> |
7 | #include <linux/timer.h> | 8 | #include <linux/timer.h> |
8 | #include <linux/scatterlist.h> | 9 | #include <linux/scatterlist.h> |
9 | 10 | ||
10 | struct request; | ||
11 | struct Scsi_Host; | 11 | struct Scsi_Host; |
12 | struct scsi_device; | 12 | struct scsi_device; |
13 | 13 | ||
@@ -158,4 +158,21 @@ static inline int scsi_get_resid(struct scsi_cmnd *cmd) | |||
158 | #define scsi_for_each_sg(cmd, sg, nseg, __i) \ | 158 | #define scsi_for_each_sg(cmd, sg, nseg, __i) \ |
159 | for_each_sg(scsi_sglist(cmd), sg, nseg, __i) | 159 | for_each_sg(scsi_sglist(cmd), sg, nseg, __i) |
160 | 160 | ||
161 | static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) | ||
162 | { | ||
163 | return blk_bidi_rq(cmd->request) && | ||
164 | (cmd->request->next_rq->special != NULL); | ||
165 | } | ||
166 | |||
167 | static inline struct scsi_data_buffer *scsi_in(struct scsi_cmnd *cmd) | ||
168 | { | ||
169 | return scsi_bidi_cmnd(cmd) ? | ||
170 | cmd->request->next_rq->special : &cmd->sdb; | ||
171 | } | ||
172 | |||
173 | static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) | ||
174 | { | ||
175 | return &cmd->sdb; | ||
176 | } | ||
177 | |||
161 | #endif /* _SCSI_SCSI_CMND_H */ | 178 | #endif /* _SCSI_SCSI_CMND_H */ |