while (q->elevator->ops->elevator_dispatch_fn(q, 1)) ; 
elv_drain_elevator(q); 
static void elevator_switch(request_queue_t *q, struct elevator_type *new_e){	elevator_t *old_elevator, *e;	/*	 * Allocate new elevator	 */	e = kmalloc(sizeof(elevator_t), GFP_KERNEL);	if (!e)		goto error;	/*	 * Turn on BYPASS and drain all requests w/ elevator private data	 */	spin_lock_irq(q->queue_lock);	set_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);	while (q->elevator->ops->elevator_dispatch_fn(q, 1))		;	while (q->rq.elvpriv) {		blk_remove_plug(q);		q->request_fn(q);		spin_unlock_irq(q->queue_lock);		msleep(10);		spin_lock_irq(q->queue_lock);	}	spin_unlock_irq(q->queue_lock);	/*	 * unregister old elevator data	 */	elv_unregister_queue(q);	old_elevator = q->elevator;	/*	 * attach and start new elevator	 */	if (elevator_attach(q, new_e, e))		goto fail;	if (elv_register_queue(q))		goto fail_register;	/*	 * finally exit old elevator and turn off BYPASS.	 */	elevator_exit(old_elevator);	clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);	return;fail_register:	/*	 * switch failed, exit the new io scheduler and reattach the old	 * one again (along with re-adding the sysfs dir)	 */	elevator_exit(e);	e = NULL;fail:	q->elevator = old_elevator;	elv_register_queue(q);	clear_bit(QUEUE_FLAG_ELVSWITCH, &q->queue_flags);	kfree(e);error:	elevator_put(new_e);	printk(KERN_ERR "elevator: switch to %s failed\n",new_e->elevator_name);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/15853af9f07673680439b224519c692f1352b959/elevator.c/buggy/block/elevator.c