int reads_queued, writes_queued, high_prio_read; 
int reads_queued, writes_queued; 
static void pkt_iosched_process_queue(struct pktcdvd_device *pd){	request_queue_t *q;	if (atomic_read(&pd->iosched.attention) == 0)		return;	atomic_set(&pd->iosched.attention, 0);	q = bdev_get_queue(pd->bdev);	for (;;) {		struct bio *bio;		int reads_queued, writes_queued, high_prio_read;		spin_lock(&pd->iosched.lock);		reads_queued = (pd->iosched.read_queue != NULL);		writes_queued = (pd->iosched.write_queue != NULL);		if (!reads_queued)			pd->iosched.high_prio_read = 0;		high_prio_read = pd->iosched.high_prio_read;		spin_unlock(&pd->iosched.lock);		if (!reads_queued && !writes_queued)			break;		if (pd->iosched.writing) {			if (high_prio_read || (!writes_queued && reads_queued)) {				if (atomic_read(&pd->cdrw.pending_bios) > 0) {					VPRINTK("pktcdvd: write, waiting\n");					break;				}				pkt_flush_cache(pd);				pd->iosched.writing = 0;			}		} else {			if (!reads_queued && writes_queued) {				if (atomic_read(&pd->cdrw.pending_bios) > 0) {					VPRINTK("pktcdvd: read, waiting\n");					break;				}				pd->iosched.writing = 1;			}		}		spin_lock(&pd->iosched.lock);		if (pd->iosched.writing) {			bio = pkt_get_list_first(&pd->iosched.write_queue,						 &pd->iosched.write_queue_tail);		} else {			bio = pkt_get_list_first(&pd->iosched.read_queue,						 &pd->iosched.read_queue_tail);		}		spin_unlock(&pd->iosched.lock);		if (!bio)			continue;		if (bio_data_dir(bio) == READ)			pd->iosched.successive_reads += bio->bi_size >> 10;		else			pd->iosched.successive_reads = 0;		if (pd->iosched.successive_reads >= HI_SPEED_SWITCH) {			if (pd->read_speed == pd->write_speed) {				pd->read_speed = MAX_SPEED;				pkt_set_speed(pd, pd->write_speed, pd->read_speed);			}		} else {			if (pd->read_speed != pd->write_speed) {				pd->read_speed = pd->write_speed;				pkt_set_speed(pd, pd->write_speed, pd->read_speed);			}		}		atomic_inc(&pd->cdrw.pending_bios);		generic_make_request(bio);	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/46c271bedd2c8444b1d05bc44928beec0c07debc/pktcdvd.c/buggy/drivers/block/pktcdvd.c