Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42750
b: refs/heads/master
c: 3833a74
h: refs/heads/master
v: v3
  • Loading branch information
Mike Miller authored and Linus Torvalds committed Dec 7, 2006
1 parent 72ef5b5 commit 440f4de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 74 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a06f789e0a1b46e4ed2a68f885cbe5ff74a34d6
refs/heads/master: 3833a748aa75dd39494bb861ab018216b0a2c14e
74 changes: 1 addition & 73 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
unsigned int cmd, unsigned long arg);
static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo);

static int revalidate_allvol(ctlr_info_t *host);
static int cciss_revalidate(struct gendisk *disk);
static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk);
static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
Expand Down Expand Up @@ -857,9 +856,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
}

case CCISS_REVALIDVOLS:
if (bdev != bdev->bd_contains || drv != host->drv)
return -ENXIO;
return revalidate_allvol(host);
return rebuild_lun_table(host, NULL);

case CCISS_GETLUNINFO:{
LogvolInfo_struct luninfo;
Expand Down Expand Up @@ -1159,75 +1156,6 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
}
}

/*
* revalidate_allvol is for online array config utilities. After a
* utility reconfigures the drives in the array, it can use this function
* (through an ioctl) to make the driver zap any previous disk structs for
* that controller and get new ones.
*
* Right now I'm using the getgeometry() function to do this, but this
* function should probably be finer grained and allow you to revalidate one
* particular logical volume (instead of all of them on a particular
* controller).
*/
static int revalidate_allvol(ctlr_info_t *host)
{
int ctlr = host->ctlr, i;
unsigned long flags;

spin_lock_irqsave(CCISS_LOCK(ctlr), flags);
if (host->usage_count > 1) {
spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
printk(KERN_WARNING "cciss: Device busy for volume"
" revalidation (usage=%d)\n", host->usage_count);
return -EBUSY;
}
host->usage_count++;
spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);

for (i = 0; i < NWD; i++) {
struct gendisk *disk = host->gendisk[i];
if (disk) {
request_queue_t *q = disk->queue;

if (disk->flags & GENHD_FL_UP)
del_gendisk(disk);
if (q)
blk_cleanup_queue(q);
}
}

/*
* Set the partition and block size structures for all volumes
* on this controller to zero. We will reread all of this data
*/
memset(host->drv, 0, sizeof(drive_info_struct)
* CISS_MAX_LUN);
/*
* Tell the array controller not to give us any interrupts while
* we check the new geometry. Then turn interrupts back on when
* we're done.
*/
host->access.set_intr_mask(host, CCISS_INTR_OFF);
cciss_getgeometry(ctlr);
host->access.set_intr_mask(host, CCISS_INTR_ON);

/* Loop through each real device */
for (i = 0; i < NWD; i++) {
struct gendisk *disk = host->gendisk[i];
drive_info_struct *drv = &(host->drv[i]);
/* we must register the controller even if no disks exist */
/* this is for the online array utilities */
if (!drv->heads && i)
continue;
blk_queue_hardsect_size(drv->queue, drv->block_size);
set_capacity(disk, drv->nr_blocks);
add_disk(disk);
}
host->usage_count--;
return 0;
}

static inline void complete_buffers(struct bio *bio, int status)
{
while (bio) {
Expand Down

0 comments on commit 440f4de

Please sign in to comment.