pkt_queue_bio(pd, pkt->w_bio, 0); 
pkt_queue_bio(pd, pkt->w_bio); 
static void pkt_start_write(struct pktcdvd_device *pd, struct packet_data *pkt){	struct bio *bio;	struct page *pages[PACKET_MAX_SIZE];	int offsets[PACKET_MAX_SIZE];	int f;	int frames_write;	for (f = 0; f < pkt->frames; f++) {		pages[f] = pkt->pages[(f * CD_FRAMESIZE) / PAGE_SIZE];		offsets[f] = (f * CD_FRAMESIZE) % PAGE_SIZE;	}	/*	 * Fill-in pages[] and offsets[] with data from orig_bios.	 */	frames_write = 0;	spin_lock(&pkt->lock);	for (bio = pkt->orig_bios; bio; bio = bio->bi_next) {		int segment = bio->bi_idx;		int src_offs = 0;		int first_frame = (bio->bi_sector - pkt->sector) / (CD_FRAMESIZE >> 9);		int num_frames = bio->bi_size / CD_FRAMESIZE;		BUG_ON(first_frame < 0);		BUG_ON(first_frame + num_frames > pkt->frames);		for (f = first_frame; f < first_frame + num_frames; f++) {			struct bio_vec *src_bvl = bio_iovec_idx(bio, segment);			while (src_offs >= src_bvl->bv_len) {				src_offs -= src_bvl->bv_len;				segment++;				BUG_ON(segment >= bio->bi_vcnt);				src_bvl = bio_iovec_idx(bio, segment);			}			if (src_bvl->bv_len - src_offs >= CD_FRAMESIZE) {				pages[f] = src_bvl->bv_page;				offsets[f] = src_bvl->bv_offset + src_offs;			} else {				pkt_copy_bio_data(bio, segment, src_offs,						  pages[f], offsets[f]);			}			src_offs += CD_FRAMESIZE;			frames_write++;		}	}	pkt_set_state(pkt, PACKET_WRITE_WAIT_STATE);	spin_unlock(&pkt->lock);	VPRINTK("pkt_start_write: Writing %d frames for zone %llx\n",		frames_write, (unsigned long long)pkt->sector);	BUG_ON(frames_write != pkt->write_size);	if (test_bit(PACKET_MERGE_SEGS, &pd->flags) || (pkt->write_size < pkt->frames)) {		pkt_make_local_copy(pkt, pages, offsets);		pkt->cache_valid = 1;	} else {		pkt->cache_valid = 0;	}	/* Start the write request */	bio_init(pkt->w_bio);	pkt->w_bio->bi_max_vecs = PACKET_MAX_SIZE;	pkt->w_bio->bi_sector = pkt->sector;	pkt->w_bio->bi_bdev = pd->bdev;	pkt->w_bio->bi_end_io = pkt_end_io_packet_write;	pkt->w_bio->bi_private = pkt;	for (f = 0; f < pkt->frames; f++) {		if ((f + 1 < pkt->frames) && (pages[f + 1] == pages[f]) &&		    (offsets[f + 1] = offsets[f] + CD_FRAMESIZE)) {			if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE * 2, offsets[f]))				BUG();			f++;		} else {			if (!bio_add_page(pkt->w_bio, pages[f], CD_FRAMESIZE, offsets[f]))				BUG();		}	}	VPRINTK("pktcdvd: vcnt=%d\n", pkt->w_bio->bi_vcnt);	atomic_set(&pkt->io_wait, 1);	pkt->w_bio->bi_rw = WRITE;	pkt_queue_bio(pd, pkt->w_bio, 0);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/46c271bedd2c8444b1d05bc44928beec0c07debc/pktcdvd.c/buggy/drivers/block/pktcdvd.c