Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123309
b: refs/heads/master
c: a0ea862
h: refs/heads/master
i:
  123307: fd27718
v: v3
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Dec 29, 2008
1 parent fab869a commit f26a53b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 62c1fe9d9f0a676fce89185b1513f0e5f473c72c
refs/heads/master: a0ea8622918019ed76c0b85f5d0247809ba05a7c
16 changes: 9 additions & 7 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo);

static int cciss_revalidate(struct gendisk *disk);
static int rebuild_lun_table(ctlr_info_t *h, int first_time);
static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
static int deregister_disk(ctlr_info_t *h, int drv_index,
int clear_all);

static void cciss_read_capacity(int ctlr, int logvol, int withirq,
Expand Down Expand Up @@ -1479,8 +1479,7 @@ static void cciss_update_drive_info(int ctlr, int drv_index, int first_time)
* which keeps the interrupt handler from starting
* the queue.
*/
ret = deregister_disk(h->gendisk[drv_index],
&h->drv[drv_index], 0);
ret = deregister_disk(h, drv_index, 0);
h->drv[drv_index].busy_configuring = 0;
}

Expand Down Expand Up @@ -1698,8 +1697,7 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
h->drv[i].busy_configuring = 1;
spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
return_code = deregister_disk(h->gendisk[i],
&h->drv[i], 1);
return_code = deregister_disk(h, i, 1);
h->drv[i].busy_configuring = 0;
}
}
Expand Down Expand Up @@ -1769,15 +1767,19 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
* the highest_lun should be left unchanged and the LunID
* should not be cleared.
*/
static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
static int deregister_disk(ctlr_info_t *h, int drv_index,
int clear_all)
{
int i;
ctlr_info_t *h = get_host(disk);
struct gendisk *disk;
drive_info_struct *drv;

if (!capable(CAP_SYS_RAWIO))
return -EPERM;

drv = &h->drv[drv_index];
disk = h->gendisk[drv_index];

/* make sure logical volume is NOT is use */
if (clear_all || (h->gendisk[0] == disk)) {
if (drv->usage_count > 1)
Expand Down

0 comments on commit f26a53b

Please sign in to comment.