Lines Matching defs:disk

170 static void cciss_release(struct gendisk *disk, fmode_t mode);
175 static int cciss_revalidate(struct gendisk *disk);
1065 static inline ctlr_info_t *get_host(struct gendisk *disk)
1067 return disk->queue->queuedata;
1070 static inline drive_info_struct *get_drv(struct gendisk *disk)
1072 return disk->private_data;
1090 * disk information. I don't think I really like this
1127 static void cciss_release(struct gendisk *disk, fmode_t mode)
1133 h = get_host(disk);
1134 drv = get_drv(disk);
1135 dev_dbg(&h->pdev->dev, "cciss_release %s\n", disk->disk_name);
1446 struct gendisk *disk, void __user *argp)
1449 drive_info_struct *drv = get_drv(disk);
1703 struct gendisk *disk = bdev->bd_disk;
1704 ctlr_info_t *h = get_host(disk);
1733 return cciss_getluninfo(h, disk, argp);
1786 /* make sure the disk has been added and the drive is real
1931 static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
1934 disk->queue = blk_init_queue(do_cciss_request, &h->lock);
1935 if (!disk->queue)
1937 sprintf(disk->disk_name, "cciss/c%dd%d", h->ctlr, drv_index);
1938 disk->major = h->major;
1939 disk->first_minor = drv_index << NWD_SHIFT;
1940 disk->fops = &cciss_fops;
1943 disk->private_data = h->drv[drv_index];
1944 disk->driverfs_dev = &h->drv[drv_index]->dev;
1947 blk_queue_bounce_limit(disk->queue, h->pdev->dma_mask);
1950 blk_queue_max_segments(disk->queue, h->maxsgentries);
1952 blk_queue_max_hw_sectors(disk->queue, h->cciss_max_sectors);
1954 blk_queue_softirq_done(disk->queue, cciss_softirq_done);
1956 disk->queue->queuedata = h;
1958 blk_queue_logical_block_size(disk->queue,
1965 h->drv[drv_index]->queue = disk->queue;
1966 add_disk(disk);
1970 blk_cleanup_queue(disk->queue);
1971 disk->queue = NULL;
1979 * then the drive information will be updated and the disk will be
1982 * is disk 0 which will always be left registered with the kernel since it
1983 * is also the controller node. Any changes to disk 0 will show up on
1989 struct gendisk *disk;
1997 /* Get information about the disk and modify the driver structure */
2033 /* Save the lunid in case we deregister the disk, below. */
2037 /* Is it the same disk we already know, and nothing's changed? */
2046 /* The disk is unchanged, nothing to update */
2049 /* If we get here it's not the same disk, or something's changed,
2052 * If the disk already exists then deregister it before proceeding
2053 * (unless it's the first disk (for the controller node).
2056 dev_warn(&h->pdev->dev, "disk %d has changed.\n", drv_index);
2068 /* If the disk is in use return */
2073 * and serial number inquiry. If the disk was deregistered
2096 disk = h->gendisk[drv_index];
2097 set_capacity(disk, h->drv[drv_index]->nr_blocks);
2099 /* If it's not disk 0 (drv_index != 0)
2100 * or if it was disk 0, but there was previously
2106 if (cciss_add_disk(h, disk, drv_index) != 0) {
2109 dev_warn(&h->pdev->dev, "could not update disk %d\n",
2147 * disk is configured there, skip it.
2159 /* If adding a real disk at cxd0, and it's already alloc'ed */
2194 * count this disk, or if it's only being added to provide
2213 "could not allocate a new disk %d\n",
2223 /* else knows about this disk yet to contend */
2238 * to register a disk so the controller can be accessed
2243 struct gendisk *disk;
2259 disk = h->gendisk[drv_index];
2260 if (cciss_add_disk(h, disk, drv_index) == 0)
2265 dev_warn(&h->pdev->dev, "could not add disk 0.\n");
2413 /* zero out the disk size info */
2430 /* This function will deregister the disk and it's queue from the
2434 * disk = This is the disk to be deregistered
2435 * drv = This is the drive_info_struct associated with the disk to be
2436 * deregistered. It contains information about the disk used
2438 * clear_all = This flag determines whether or not the disk information
2441 * the disk in preparation for re-adding it. In this case
2455 struct gendisk *disk;
2463 disk = h->gendisk[drv_index];
2466 if (clear_all || (h->gendisk[0] == disk)) {
2474 /* invalidate the devices and deregister the disk. If it is disk
2476 * allows us to delete disk zero but keep the controller registered.
2478 if (h->gendisk[0] != disk) {
2479 struct request_queue *q = disk->queue;
2480 if (disk->flags & GENHD_FL_UP) {
2482 del_gendisk(disk);
2488 * other than disk 0 we will call put_disk. We do not
2489 * do this for disk 0 as we need it to be able to
2494 * disk in our array and NULL our the pointer.
2499 if (h->gendisk[i] == disk) {
2504 put_disk(disk);
2507 set_capacity(disk, 0);
2513 /* if it was the last disk, find the new hightest lun */
2517 /* if the disk has size > 0, it is available */
2943 static int cciss_revalidate(struct gendisk *disk)
2945 ctlr_info_t *h = get_host(disk);
2946 drive_info_struct *drv = get_drv(disk);
2982 set_capacity(disk, drv->nr_blocks);
5214 /* write all data in the battery backed cache to disk */
5269 /* remove it from the disk list */
5271 struct gendisk *disk = h->gendisk[j];
5272 if (disk) {
5273 struct request_queue *q = disk->queue;
5275 if (disk->flags & GENHD_FL_UP) {
5277 del_gendisk(disk);