Add 'zero-copy' in libiscsi for reads.
It is not real zero-copy since the data is still copied in the kernel, but it avoids copying the data inside libiscsi as well as in the callback. For SCSI tasks that will return data from the target, the application can now specify application buffers for libiscsi to read the data directly into. This is done by calling scsi_task_add_data_in_buffer(task, ... These buffers need not be linear, you can specify different areas to read into by calling this function several times. See examples/iscsiclient.c for an example.
This commit is contained in:
@@ -248,6 +248,9 @@ int iscsi_send_target_nop_out(struct iscsi_context *iscsi, uint32_t ttt);
|
||||
void iscsi_set_error(struct iscsi_context *iscsi, const char *error_string,
|
||||
...);
|
||||
|
||||
unsigned char *iscsi_get_user_in_buffer(struct iscsi_context *iscsi, struct iscsi_in_pdu *in, uint32_t pos, ssize_t *count);
|
||||
unsigned char *scsi_task_get_data_in_buffer(struct scsi_task *task, uint32_t pos, ssize_t *count);
|
||||
|
||||
unsigned long crc32c(char *buf, int len);
|
||||
|
||||
#endif /* __iscsi_private_h__ */
|
||||
|
||||
Reference in New Issue
Block a user