pd->stats.secs_w += pd->settings.size; 
static void pkt_gather_data(struct pktcdvd_device *pd, struct packet_data *pkt){	int frames_read = 0;	struct bio *bio;	int f;	char written[PACKET_MAX_SIZE];	BUG_ON(!pkt->orig_bios);	atomic_set(&pkt->io_wait, 0);	atomic_set(&pkt->io_errors, 0);	if (pkt->cache_valid) {		VPRINTK("pkt_gather_data: zone %llx cached\n",			(unsigned long long)pkt->sector);		goto out_account;	}	/*	 * Figure out which frames we need to read before we can write.	 */	memset(written, 0, sizeof(written));	spin_lock(&pkt->lock);	for (bio = pkt->orig_bios; bio; bio = bio->bi_next) {		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++)			written[f] = 1;	}	spin_unlock(&pkt->lock);	/*	 * Schedule reads for missing parts of the packet.	 */	for (f = 0; f < pkt->frames; f++) {		int p, offset;		if (written[f])			continue;		bio = pkt->r_bios[f];		bio_init(bio);		bio->bi_max_vecs = 1;		bio->bi_sector = pkt->sector + f * (CD_FRAMESIZE >> 9);		bio->bi_bdev = pd->bdev;		bio->bi_end_io = pkt_end_io_read;		bio->bi_private = pkt;		p = (f * CD_FRAMESIZE) / PAGE_SIZE;		offset = (f * CD_FRAMESIZE) % PAGE_SIZE;		VPRINTK("pkt_gather_data: Adding frame %d, page:%p offs:%d\n",			f, pkt->pages[p], offset);		if (!bio_add_page(bio, pkt->pages[p], CD_FRAMESIZE, offset))			BUG();		atomic_inc(&pkt->io_wait);		bio->bi_rw = READ;		pkt_queue_bio(pd, bio);		frames_read++;	}out_account:	VPRINTK("pkt_gather_data: need %d frames for zone %llx\n",		frames_read, (unsigned long long)pkt->sector);	pd->stats.pkt_started++;	pd->stats.secs_rg += frames_read * (CD_FRAMESIZE >> 9);	pd->stats.secs_w += pd->settings.size;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/06e7ab53f4a1e8bbf66c3985968468949d74d006/pktcdvd.c/buggy/drivers/block/pktcdvd.c