if (disk->flags & GENHD_FL_UP){ blk_cleanup_queue(disk->queue); del_gendisk(disk); drv->queue = NULL; 
if (disk) { request_queue_t *q = disk->queue; if (disk->flags & GENHD_FL_UP) del_gendisk(disk); if (q) blk_cleanup_queue(q); put_disk(disk); 
static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,			   int clear_all){	ctlr_info_t *h = get_host(disk);	if (!capable(CAP_SYS_RAWIO))		return -EPERM;	/* make sure logical volume is NOT is use */	if(clear_all || (h->gendisk[0] == disk)) {	if (drv->usage_count > 1)                return -EBUSY;	}        else        	if( drv->usage_count > 0 )                	return -EBUSY;	/* invalidate the devices and deregister the disk.  If it is disk	 * zero do not deregister it but just zero out it's values.  This	 * allows us to delete disk zero but keep the controller registered.	*/	if (h->gendisk[0] != disk){		if (disk->flags & GENHD_FL_UP){			blk_cleanup_queue(disk->queue);		del_gendisk(disk);			drv->queue = NULL;		}	}	--h->num_luns;	/* zero out the disk size info */	drv->nr_blocks = 0;	drv->block_size = 0;	drv->heads = 0;	drv->sectors = 0;	drv->cylinders = 0;	drv->raid_level = -1;	/* This can be used as a flag variable to				 * indicate that this element of the drive				 * array is free.				*/	if (clear_all){	/* check to see if it was the last disk */	if (drv == h->drv + h->highest_lun) {		/* if so, find the new hightest lun */		int i, newhighest =-1;		for(i=0; i<h->highest_lun; i++) {			/* if the disk has size > 0, it is available */				if (h->drv[i].heads)				newhighest = i;		}		h->highest_lun = newhighest;	}	drv->LunID = 0;	}	return(0);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/6f5a0f7c955d3567f800fa36f978758cb5b99aa2/cciss.c/clean/drivers/block/cciss.c