diff options
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 74 |
1 files changed, 1 insertions, 73 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index c8343051be9e..70cf9321ef54 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -141,7 +141,6 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
141 | unsigned int cmd, unsigned long arg); | 141 | unsigned int cmd, unsigned long arg); |
142 | static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo); | 142 | static int cciss_getgeo(struct block_device *bdev, struct hd_geometry *geo); |
143 | 143 | ||
144 | static int revalidate_allvol(ctlr_info_t *host); | ||
145 | static int cciss_revalidate(struct gendisk *disk); | 144 | static int cciss_revalidate(struct gendisk *disk); |
146 | static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk); | 145 | static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk); |
147 | static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, | 146 | static int deregister_disk(struct gendisk *disk, drive_info_struct *drv, |
@@ -857,9 +856,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
857 | } | 856 | } |
858 | 857 | ||
859 | case CCISS_REVALIDVOLS: | 858 | case CCISS_REVALIDVOLS: |
860 | if (bdev != bdev->bd_contains || drv != host->drv) | 859 | return rebuild_lun_table(host, NULL); |
861 | return -ENXIO; | ||
862 | return revalidate_allvol(host); | ||
863 | 860 | ||
864 | case CCISS_GETLUNINFO:{ | 861 | case CCISS_GETLUNINFO:{ |
865 | LogvolInfo_struct luninfo; | 862 | LogvolInfo_struct luninfo; |
@@ -1159,75 +1156,6 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
1159 | } | 1156 | } |
1160 | } | 1157 | } |
1161 | 1158 | ||
1162 | /* | ||
1163 | * revalidate_allvol is for online array config utilities. After a | ||
1164 | * utility reconfigures the drives in the array, it can use this function | ||
1165 | * (through an ioctl) to make the driver zap any previous disk structs for | ||
1166 | * that controller and get new ones. | ||
1167 | * | ||
1168 | * Right now I'm using the getgeometry() function to do this, but this | ||
1169 | * function should probably be finer grained and allow you to revalidate one | ||
1170 | * particular logical volume (instead of all of them on a particular | ||
1171 | * controller). | ||
1172 | */ | ||
1173 | static int revalidate_allvol(ctlr_info_t *host) | ||
1174 | { | ||
1175 | int ctlr = host->ctlr, i; | ||
1176 | unsigned long flags; | ||
1177 | |||
1178 | spin_lock_irqsave(CCISS_LOCK(ctlr), flags); | ||
1179 | if (host->usage_count > 1) { | ||
1180 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); | ||
1181 | printk(KERN_WARNING "cciss: Device busy for volume" | ||
1182 | " revalidation (usage=%d)\n", host->usage_count); | ||
1183 | return -EBUSY; | ||
1184 | } | ||
1185 | host->usage_count++; | ||
1186 | spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags); | ||
1187 | |||
1188 | for (i = 0; i < NWD; i++) { | ||
1189 | struct gendisk *disk = host->gendisk[i]; | ||
1190 | if (disk) { | ||
1191 | request_queue_t *q = disk->queue; | ||
1192 | |||
1193 | if (disk->flags & GENHD_FL_UP) | ||
1194 | del_gendisk(disk); | ||
1195 | if (q) | ||
1196 | blk_cleanup_queue(q); | ||
1197 | } | ||
1198 | } | ||
1199 | |||
1200 | /* | ||
1201 | * Set the partition and block size structures for all volumes | ||
1202 | * on this controller to zero. We will reread all of this data | ||
1203 | */ | ||
1204 | memset(host->drv, 0, sizeof(drive_info_struct) | ||
1205 | * CISS_MAX_LUN); | ||
1206 | /* | ||
1207 | * Tell the array controller not to give us any interrupts while | ||
1208 | * we check the new geometry. Then turn interrupts back on when | ||
1209 | * we're done. | ||
1210 | */ | ||
1211 | host->access.set_intr_mask(host, CCISS_INTR_OFF); | ||
1212 | cciss_getgeometry(ctlr); | ||
1213 | host->access.set_intr_mask(host, CCISS_INTR_ON); | ||
1214 | |||
1215 | /* Loop through each real device */ | ||
1216 | for (i = 0; i < NWD; i++) { | ||
1217 | struct gendisk *disk = host->gendisk[i]; | ||
1218 | drive_info_struct *drv = &(host->drv[i]); | ||
1219 | /* we must register the controller even if no disks exist */ | ||
1220 | /* this is for the online array utilities */ | ||
1221 | if (!drv->heads && i) | ||
1222 | continue; | ||
1223 | blk_queue_hardsect_size(drv->queue, drv->block_size); | ||
1224 | set_capacity(disk, drv->nr_blocks); | ||
1225 | add_disk(disk); | ||
1226 | } | ||
1227 | host->usage_count--; | ||
1228 | return 0; | ||
1229 | } | ||
1230 | |||
1231 | static inline void complete_buffers(struct bio *bio, int status) | 1159 | static inline void complete_buffers(struct bio *bio, int status) |
1232 | { | 1160 | { |
1233 | while (bio) { | 1161 | while (bio) { |