From 5868287460b0fc243e828a0b856cd53d8bf45739 Mon Sep 17 00:00:00 2001 From: Robert Love Date: Tue, 3 Nov 2009 11:47:28 -0800 Subject: [SCSI] libfc: Add routine to copy data from a buffer to a SG list When handling the multi-frame responses of fc pass-thru requests, a code segment similar to fc_fcp_recv_data (routine to receive inbound SCSI data) is used in the response handler. This patch is to add a routine, called fc_copy_buffer_to_sglist(), to handle the common function of copying data from a buffer to a scatter- gather list in order to avoid code duplication. Signed-off-by: Robert Love Signed-off-by: James Bottomley --- drivers/scsi/libfc/fc_libfc.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/scsi/libfc/fc_libfc.h') diff --git a/drivers/scsi/libfc/fc_libfc.h b/drivers/scsi/libfc/fc_libfc.h index 0530149ac17..e4b5e9280cb 100644 --- a/drivers/scsi/libfc/fc_libfc.h +++ b/drivers/scsi/libfc/fc_libfc.h @@ -101,4 +101,12 @@ void fc_destroy_fcp(void); */ const char *fc_els_resp_type(struct fc_frame *); +/* + * Copies a buffer into an sg list + */ +u32 fc_copy_buffer_to_sglist(void *buf, size_t len, + struct scatterlist *sg, + u32 *nents, size_t *offset, + enum km_type km_type, u32 *crc); + #endif /* _FC_LIBFC_H_ */ -- cgit v1.2.3