aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cca.cpqcorp.net>2008-12-18 08:55:51 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-12-29 02:29:52 -0500
commita0ea8622918019ed76c0b85f5d0247809ba05a7c (patch)
tree868710199baf728686d2e20afd77ab7eeac9a664 /drivers/block/cciss.c
parent62c1fe9d9f0a676fce89185b1513f0e5f473c72c (diff)
cciss: simplify parameters to deregister_disk function
Simplify parameters to deregister_disk function. Signed-off-by: Stephen M. Cameron <scameron@beardog.cca.cpqcorp.net> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 4e07b5ca847c..01e69383d9c0 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -164,7 +164,7 @@ static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo);
164 164
165static int cciss_revalidate(struct gendisk *disk); 165static int cciss_revalidate(struct gendisk *disk);
166static int rebuild_lun_table(ctlr_info_t *h, int first_time); 166static int rebuild_lun_table(ctlr_info_t *h, int first_time);
167static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, 167static int deregister_disk(ctlr_info_t *h, int drv_index,
168 int clear_all); 168 int clear_all);
169 169
170static void cciss_read_capacity(int ctlr, int logvol, int withirq, 170static void cciss_read_capacity(int ctlr, int logvol, int withirq,
@@ -1479,8 +1479,7 @@ static void cciss_update_drive_info(int ctlr, int drv_index, int first_time)
1479 * which keeps the interrupt handler from starting 1479 * which keeps the interrupt handler from starting
1480 * the queue. 1480 * the queue.
1481 */ 1481 */
1482 ret = deregister_disk(h->gendisk[drv_index], 1482 ret = deregister_disk(h, drv_index, 0);
1483 &h->drv[drv_index], 0);
1484 h->drv[drv_index].busy_configuring = 0; 1483 h->drv[drv_index].busy_configuring = 0;
1485 } 1484 }
1486 1485
@@ -1698,8 +1697,7 @@ static int rebuild_lun_table(ctlr_info_t *h, int first_time)
1698 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags); 1697 spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
1699 h->drv[i].busy_configuring = 1; 1698 h->drv[i].busy_configuring = 1;
1700 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); 1699 spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
1701 return_code = deregister_disk(h->gendisk[i], 1700 return_code = deregister_disk(h, i, 1);
1702 &h->drv[i], 1);
1703 h->drv[i].busy_configuring = 0; 1701 h->drv[i].busy_configuring = 0;
1704 } 1702 }
1705 } 1703 }
@@ -1769,15 +1767,19 @@ mem_msg:
1769 * the highest_lun should be left unchanged and the LunID 1767 * the highest_lun should be left unchanged and the LunID
1770 * should not be cleared. 1768 * should not be cleared.
1771*/ 1769*/
1772static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, 1770static int deregister_disk(ctlr_info_t *h, int drv_index,
1773 int clear_all) 1771 int clear_all)
1774{ 1772{
1775 int i; 1773 int i;
1776 ctlr_info_t *h = get_host(disk); 1774 struct gendisk *disk;
1775 drive_info_struct *drv;
1777 1776
1778 if (!capable(CAP_SYS_RAWIO)) 1777 if (!capable(CAP_SYS_RAWIO))
1779 return -EPERM; 1778 return -EPERM;
1780 1779
1780 drv = &h->drv[drv_index];
1781 disk = h->gendisk[drv_index];
1782
1781 /* make sure logical volume is NOT is use */ 1783 /* make sure logical volume is NOT is use */
1782 if (clear_all || (h->gendisk[0] == disk)) { 1784 if (clear_all || (h->gendisk[0] == disk)) {
1783 if (drv->usage_count > 1) 1785 if (drv->usage_count > 1)