iscsi_buf_init_hdr(conn, &r2t->headbuf, (char*)hdr, (u8 *)dtask->hdrext); 
iscsi_buf_init_virt(&r2t->headbuf, (char*)hdr, sizeof(struct iscsi_hdr)); 
iscsi_solicit_data_init(struct iscsi_conn *conn, struct iscsi_cmd_task *ctask,			struct iscsi_r2t_info *r2t){	struct iscsi_data *hdr;	struct iscsi_data_task *dtask;	struct scsi_cmnd *sc = ctask->sc;	dtask = mempool_alloc(ctask->datapool, GFP_ATOMIC);	BUG_ON(!dtask);	hdr = &dtask->hdr;	memset(hdr, 0, sizeof(struct iscsi_data));	hdr->ttt = r2t->ttt;	hdr->datasn = cpu_to_be32(r2t->solicit_datasn);	r2t->solicit_datasn++;	hdr->opcode = ISCSI_OP_SCSI_DATA_OUT;	memcpy(hdr->lun, ctask->hdr.lun, sizeof(hdr->lun));	hdr->itt = ctask->hdr.itt;	hdr->exp_statsn = r2t->exp_statsn;	hdr->offset = cpu_to_be32(r2t->data_offset);	if (r2t->data_length > conn->max_xmit_dlength) {		hton24(hdr->dlength, conn->max_xmit_dlength);		r2t->data_count = conn->max_xmit_dlength;		hdr->flags = 0;	} else {		hton24(hdr->dlength, r2t->data_length);		r2t->data_count = r2t->data_length;		hdr->flags = ISCSI_FLAG_CMD_FINAL;	}	conn->dataout_pdus_cnt++;	r2t->sent = 0;	iscsi_buf_init_hdr(conn, &r2t->headbuf, (char*)hdr,			   (u8 *)dtask->hdrext);	r2t->dtask = dtask;	if (sc->use_sg) {		int i, sg_count = 0;		struct scatterlist *sg = sc->request_buffer;		r2t->sg = NULL;		for (i = 0; i < sc->use_sg; i++, sg += 1) {			/* FIXME: prefetch ? */			if (sg_count + sg->length > r2t->data_offset) {				int page_offset;				/* sg page found! */				/* offset within this page */				page_offset = r2t->data_offset - sg_count;				/* fill in this buffer */				iscsi_buf_init_sg(&r2t->sendbuf, sg);				r2t->sendbuf.sg.offset += page_offset;				r2t->sendbuf.sg.length -= page_offset;				/* xmit logic will continue with next one */				r2t->sg = sg + 1;				break;			}			sg_count += sg->length;		}		BUG_ON(r2t->sg == NULL);	} else		iscsi_buf_init_iov(&ctask->sendbuf,			    (char*)sc->request_buffer + r2t->data_offset,			    r2t->data_count);	list_add(&dtask->item, &ctask->dataqueue);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/af973481f4a0902ad35726636c290f4794704948/iscsi_tcp.c/clean/drivers/scsi/iscsi_tcp.c