h->next_to_run = (start_queue + 1) % NWD; 
h->next_to_run = (start_queue + 1) % (h->highest_lun + 1); 
static irqreturn_t do_cciss_intr(int irq, void *dev_id, struct pt_regs *regs){	ctlr_info_t *h = dev_id;	CommandList_struct *c;	unsigned long flags;	__u32 a, a1;	int j;	int start_queue = h->next_to_run;	/* Is this interrupt for us? */	if (( h->access.intr_pending(h) == 0) || (h->interrupts_enabled == 0))		return IRQ_NONE;	/*	 * If there are completed commands in the completion queue,	 * we had better do something about it.	 */	spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);	while( h->access.intr_pending(h))	{		while((a = h->access.command_completed(h)) != FIFO_EMPTY) 		{			a1 = a;			a &= ~3;			if ((c = h->cmpQ) == NULL)			{  				printk(KERN_WARNING "cciss: Completion of %08lx ignored\n", (unsigned long)a1);				continue;				} 			while(c->busaddr != a) {				c = c->next;				if (c == h->cmpQ) 					break;			}			/*			 * If we've found the command, take it off the			 * completion Q and free it			 */			 if (c->busaddr == a) {				removeQ(&h->cmpQ, c);				if (c->cmd_type == CMD_RWREQ) {					complete_command(h, c, 0);				} else if (c->cmd_type == CMD_IOCTL_PEND) {					complete(c->waiting);				}#				ifdef CONFIG_CISS_SCSI_TAPE				else if (c->cmd_type == CMD_SCSI)					complete_scsi_command(c, 0, a1);#				endif				continue;			}		}	} 	/* check to see if we have maxed out the number of commands that can 	 * be placed on the queue.  If so then exit.  We do this check here 	 * in case the interrupt we serviced was from an ioctl and did not 	 * free any new commands.	 */ 	if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) 		goto cleanup; 	/* We have room on the queue for more commands.  Now we need to queue 	 * them up.  We will also keep track of the next queue to run so 	 * that every queue gets a chance to be started first. 	*/ 	for (j=0; j < NWD; j++){ 		int curr_queue = (start_queue + j) % NWD; 		/* make sure the disk has been added and the drive is real 		 * because this can be called from the middle of init_one. 		*/ 		if(!(h->gendisk[curr_queue]->queue) ||		 		   !(h->drv[curr_queue].heads)) 			continue; 		blk_start_queue(h->gendisk[curr_queue]->queue); 		/* check to see if we have maxed out the number of commands 		 * that can be placed on the queue. 		*/ 		if ((find_first_zero_bit(h->cmd_pool_bits, NR_CMDS)) == NR_CMDS) 		{ 			if (curr_queue == start_queue){ 				h->next_to_run = (start_queue + 1) % NWD; 				goto cleanup; 			} else { 				h->next_to_run = curr_queue; 				goto cleanup; 	} 		} else { 			curr_queue = (curr_queue + 1) % NWD; 		} 	}cleanup:	spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);	return IRQ_HANDLED;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ad2b93123d2b3cb4ba9a98dd5f62acb6d6b50391/cciss.c/clean/drivers/block/cciss.c