/* This function sets up the segment so that subsequent data is copied to the indicated sg entry, at the given offset.  */
static void iscsi_tcp_segment_init_sg(struct iscsi_segment *segment, struct scatterlist *sg, unsigned int offset)
/* This function sets up the segment so that subsequent data is copied to the indicated sg entry, at the given offset.  */
static void iscsi_tcp_segment_init_sg(struct iscsi_segment *segment, struct scatterlist *sg, unsigned int offset)
{
	segment->sg = sg;
	segment->sg_offset = offset;
	segment->size = min(sg->length - offset,
			    segment->total_size - segment->total_copied);
	segment->data = NULL;
}