drv->usage_count++; spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); 
else if( drv->usage_count > 0 ) return -EBUSY; 
static int deregister_disk(struct gendisk *disk){	unsigned long flags;	ctlr_info_t *h = get_host(disk);	drive_info_struct *drv = get_drv(disk);	int ctlr = h->ctlr;	if (!capable(CAP_SYS_RAWIO))		return -EPERM;	spin_lock_irqsave(CCISS_LOCK(ctlr), flags);	/* make sure logical volume is NOT is use */	if( drv->usage_count > 1) {		spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);                return -EBUSY;	}	drv->usage_count++;	spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);	/* invalidate the devices and deregister the disk */ 	if (disk->flags & GENHD_FL_UP)		del_gendisk(disk);	/* 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].nr_blocks)				newhighest = i;		}		h->highest_lun = newhighest;					}	--h->num_luns;	/* zero out the disk size info */ 	drv->nr_blocks = 0;	drv->block_size = 0;	drv->cylinders = 0;	drv->LunID = 0;	return(0);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ddd474420a0b0dfeda38b6b5f83c7af751235cc3/cciss.c/buggy/drivers/block/cciss.c