diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-03-08 23:44:29 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:15:45 -0400 |
commit | 9ac16b616ab117dab3fce9790368d3b58ca441ef (patch) | |
tree | 2da372ba43875040a2fca67217372569f0a97ff3 /include/scsi | |
parent | b1adaf65ba0398c9a1adc8f3a274533165a4df61 (diff) |
[SCSI] scsi: add wrapper functions for sg buffer copy helper functions
LLDs need to copies data between the SG table in struct scsi_cmnd and
liner buffer. So they use the helper functions like
sg_copy_from_buffer(scsi_sglist(sc), scsi_sg_count(sc), buf, buflen)
sg_copy_to_buffer(scsi_sglist(sc), scsi_sg_count(sc), buf, buflen)
This patch just adds wrapper functions:
scsi_sg_copy_from_buffer(sc, buf, buflen)
scsi_sg_copy_to_buffer(sc, buf, buflen)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_cmnd.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h index de28aab820b0..b260be6d0d73 100644 --- a/include/scsi/scsi_cmnd.h +++ b/include/scsi/scsi_cmnd.h | |||
@@ -175,4 +175,18 @@ static inline struct scsi_data_buffer *scsi_out(struct scsi_cmnd *cmd) | |||
175 | return &cmd->sdb; | 175 | return &cmd->sdb; |
176 | } | 176 | } |
177 | 177 | ||
178 | static inline int scsi_sg_copy_from_buffer(struct scsi_cmnd *cmd, | ||
179 | void *buf, int buflen) | ||
180 | { | ||
181 | return sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), | ||
182 | buf, buflen); | ||
183 | } | ||
184 | |||
185 | static inline int scsi_sg_copy_to_buffer(struct scsi_cmnd *cmd, | ||
186 | void *buf, int buflen) | ||
187 | { | ||
188 | return sg_copy_to_buffer(scsi_sglist(cmd), scsi_sg_count(cmd), | ||
189 | buf, buflen); | ||
190 | } | ||
191 | |||
178 | #endif /* _SCSI_SCSI_CMND_H */ | 192 | #endif /* _SCSI_SCSI_CMND_H */ |