aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi/scsi_cmnd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/scsi/scsi_cmnd.h')
-rw-r--r--include/scsi/scsi_cmnd.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index de28aab820b0..8d20e60a94b7 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -130,6 +130,9 @@ extern void scsi_release_buffers(struct scsi_cmnd *cmd);
130extern int scsi_dma_map(struct scsi_cmnd *cmd); 130extern int scsi_dma_map(struct scsi_cmnd *cmd);
131extern void scsi_dma_unmap(struct scsi_cmnd *cmd); 131extern void scsi_dma_unmap(struct scsi_cmnd *cmd);
132 132
133struct scsi_cmnd *scsi_allocate_command(gfp_t gfp_mask);
134void scsi_free_command(gfp_t gfp_mask, struct scsi_cmnd *cmd);
135
133static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd) 136static inline unsigned scsi_sg_count(struct scsi_cmnd *cmd)
134{ 137{
135 return cmd->sdb.table.nents; 138 return cmd->sdb.table.nents;
@@ -175,4 +178,18 @@ static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd)
175 return &cmd->sdb; 178 return &cmd->sdb;
176} 179}
177 180
181static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd,
182 void *buf, int buflen)
183{
184 return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
185 buf, buflen);
186}
187
188static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd,
189 void *buf, int buflen)
190{
191 return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
192 buf, buflen);
193}
194
178#endif /* _SCSI_SCSI_CMND_H */ 195#endif /* _SCSI_SCSI_CMND_H */