if (qc->cursg_ofs == sg_dma_len(sg)) { 
if (qc->cursg_ofs == sg->length) { 
static void __atapi_pio_bytes(struct ata_queued_cmd *qc, unsigned int bytes){	int do_write = (qc->tf.flags & ATA_TFLAG_WRITE);	struct scatterlist *sg = qc->sg;	struct ata_port *ap = qc->ap;	struct page *page;	unsigned char *buf;	unsigned int offset, count;	if (qc->curbytes == qc->nbytes - bytes)		ap->pio_task_state = PIO_ST_LAST;next_sg:	sg = &qc->sg[qc->cursg];next_page:	page = sg->page;	offset = sg->offset + qc->cursg_ofs;	/* get the current page and offset */	page = nth_page(page, (offset >> PAGE_SHIFT));	offset %= PAGE_SIZE;	count = min(sg_dma_len(sg) - qc->cursg_ofs, bytes);	/* don't cross page boundaries */	count = min(count, (unsigned int)PAGE_SIZE - offset);	buf = kmap(page) + offset;	bytes -= count;	qc->curbytes += count;	qc->cursg_ofs += count;	if (qc->cursg_ofs == sg_dma_len(sg)) {		qc->cursg++;		qc->cursg_ofs = 0;	}	DPRINTK("data %s\n", qc->tf.flags & ATA_TFLAG_WRITE ? "write" : "read");	/* do the actual data transfer */	ata_data_xfer(ap, buf, count, do_write);	kunmap(page);	if (bytes) {		if (qc->cursg_ofs < sg_dma_len(sg))			goto next_page;		goto next_sg;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/32529e0128923e42126b5d14e444c18295a452ba/libata-core.c/clean/drivers/scsi/libata-core.c