[PATCH] devfs: Remove the gendisk devfs_name field as it's no longer needed
Greg Kroah-Hartman [Tue, 21 Jun 2005 04:15:16 +0000 (21:15 -0700)]
And remove the now unneeded number field.
Also fixes all drivers that set these fields.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

29 files changed:
arch/um/drivers/ubd_kern.c
drivers/block/DAC960.c
drivers/block/acsi.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/block/loop.c
drivers/block/nbd.c
drivers/block/ps2esdi.c
drivers/block/rd.c
drivers/block/swim3.c
drivers/block/sx8.c
drivers/block/ub.c
drivers/block/umem.c
drivers/block/viodasd.c
drivers/block/xd.c
drivers/block/z2ram.c
drivers/cdrom/aztcd.c
drivers/cdrom/gscd.c
drivers/cdrom/optcd.c
drivers/cdrom/sbpcd.c
drivers/cdrom/sjcd.c
drivers/cdrom/sonycd535.c
drivers/cdrom/viocd.c
drivers/md/md.c
drivers/message/i2o/i2o_block.c
drivers/mmc/mmc_block.c
drivers/s390/block/dasd_genhd.c
drivers/s390/block/xpram.c
include/linux/genhd.h

index 5856a02..c3e205b 100644 (file)
@@ -637,14 +637,10 @@ static int ubd_new_disk(int major, u64 size, int unit,
        disk->first_minor = unit << UBD_SHIFT;
        disk->fops = &ubd_blops;
        set_capacity(disk, size / 512);
-       if(major == MAJOR_NR){
+       if(major == MAJOR_NR)
                sprintf(disk->disk_name, "ubd%c", 'a' + unit);
-               sprintf(disk->devfs_name, "ubd/disc%d", unit);
-       }
-       else {
+       else
                sprintf(disk->disk_name, "ubd_fake%d", unit);
-               sprintf(disk->devfs_name, "ubd_fake/disc%d", unit);
-       }
 
        /* sysfs register (not for ide fake devices) */
        if (major == MAJOR_NR) {
index dd8a150..50ca1aa 100644 (file)
@@ -2530,7 +2530,6 @@ static boolean DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller)
        blk_queue_max_sectors(RequestQueue, Controller->MaxBlocksPerCommand);
        disk->queue = RequestQueue;
        sprintf(disk->disk_name, "rd/c%dd%d", Controller->ControllerNumber, n);
-       sprintf(disk->devfs_name, "rd/host%d/target%d", Controller->ControllerNumber, n);
        disk->major = MajorNumber;
        disk->first_minor = n << DAC960_MaxPartitionsBits;
        disk->fops = &DAC960_BlockDeviceOperations;
index 196c0ec..a317e43 100644 (file)
@@ -1732,13 +1732,10 @@ int acsi_init( void )
                struct gendisk *disk = acsi_gendisk[i];
                sprintf(disk->disk_name, "ad%c", 'a'+i);
                aip = &acsi_info[NDevices];
-               sprintf(disk->devfs_name, "ad/target%d/lun%d", aip->target, aip->lun);
                disk->major = ACSI_MAJOR;
                disk->first_minor = i << 4;
-               if (acsi_info[i].type != HARDDISK) {
+               if (acsi_info[i].type != HARDDISK)
                        disk->minors = 1;
-                       strcat(disk->devfs_name, "/disc");
-               }
                disk->fops = &acsi_fops;
                disk->private_data = &acsi_info[i];
                set_capacity(disk, acsi_info[i].size);
index 39b0f53..05fb083 100644 (file)
@@ -3248,7 +3248,6 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
 
                q->queuedata = hba[i];
                sprintf(disk->disk_name, "cciss/c%dd%d", i, j);
-               sprintf(disk->devfs_name, "cciss/host%d/target%d", i, j);
                disk->major = hba[i]->major;
                disk->first_minor = j << NWD_SHIFT;
                disk->fops = &cciss_fops;
index f96e6c0..bfd245d 100644 (file)
@@ -1805,8 +1805,6 @@ static void getgeometry(int ctlr)
 
                                }
 
-                               sprintf(disk->devfs_name, "ida/c%dd%d", ctlr, log_unit);
-
                                info_p->phys_drives =
                                    sense_config_buf->ctlr_phys_drv;
                                info_p->drv_assign_map
index dbf905c..9983e72 100644 (file)
@@ -1293,7 +1293,6 @@ static int __init loop_init(void)
                disk->first_minor = i;
                disk->fops = &lo_fops;
                sprintf(disk->disk_name, "loop%d", i);
-               sprintf(disk->devfs_name, "loop/%d", i);
                disk->private_data = lo;
                disk->queue = lo->lo_queue;
        }
index b164ee0..39662f0 100644 (file)
@@ -657,7 +657,6 @@ static int __init nbd_init(void)
                disk->private_data = &nbd_dev[i];
                disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
                sprintf(disk->disk_name, "nbd%d", i);
-               sprintf(disk->devfs_name, "nbd/%d", i);
                set_capacity(disk, 0x7ffffc00ULL << 1); /* 2 TB */
                add_disk(disk);
        }
index bea75f2..a729013 100644 (file)
@@ -421,7 +421,6 @@ static int __init ps2esdi_geninit(void)
                disk->major = PS2ESDI_MAJOR;
                disk->first_minor = i<<6;
                sprintf(disk->disk_name, "ed%c", 'a'+i);
-               sprintf(disk->devfs_name, "ed/target%d", i);
                disk->fops = &ps2esdi_fops;
                ps2esdi_gendisk[i] = disk;
        }
index 536be2d..e64f26e 100644 (file)
@@ -457,7 +457,6 @@ static int __init rd_init(void)
                disk->queue = rd_queue[i];
                disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
                sprintf(disk->disk_name, "ram%d", i);
-               sprintf(disk->devfs_name, "rd/%d", i);
                set_capacity(disk, rd_size * 2);
                add_disk(rd_disks[i]);
        }
index ef557b1..6288779 100644 (file)
@@ -1061,7 +1061,6 @@ int swim3_init(void)
                disk->queue = swim3_queue;
                disk->flags |= GENHD_FL_REMOVABLE;
                sprintf(disk->disk_name, "fd%d", i);
-               sprintf(disk->devfs_name, "floppy/%d", i);
                set_capacity(disk, 2880);
                add_disk(disk);
        }
index 3a48145..fbddeb4 100644 (file)
@@ -1509,7 +1509,6 @@ static int carm_init_disks(struct carm_host *host)
                port->disk = disk;
                sprintf(disk->disk_name, DRV_NAME "/%u",
                        (unsigned int) (host->id * CARM_MAX_PORTS) + i);
-               sprintf(disk->devfs_name, DRV_NAME "/%u_%u", host->id, i);
                disk->major = host->major;
                disk->first_minor = i * CARM_MINORS_PER_MAJOR;
                disk->fops = &carm_bd_ops;
index 87ec645..d62b49f 100644 (file)
@@ -28,7 +28,6 @@
 #include <scsi/scsi.h>
 
 #define DRV_NAME "ub"
-#define DEVFS_NAME DRV_NAME
 
 #define UB_MAJOR 180
 
@@ -2290,7 +2289,6 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
                goto err_diskalloc;
 
        sprintf(disk->disk_name, DRV_NAME "%c", lun->id + 'a');
-       sprintf(disk->devfs_name, DEVFS_NAME "/%c", lun->id + 'a');
        disk->major = UB_MAJOR;
        disk->first_minor = lun->id * UB_PARTS_PER_LUN;
        disk->fops = &ub_bd_fops;
index f7d4c65..585197b 100644 (file)
@@ -1192,7 +1192,6 @@ static int __init mm_init(void)
        for (i = 0; i < num_cards; i++) {
                struct gendisk *disk = mm_gendisk[i];
                sprintf(disk->disk_name, "umem%c", 'a'+i);
-               sprintf(disk->devfs_name, "umem/card%d", i);
                spin_lock_init(&cards[i].lock);
                disk->major = major_nr;
                disk->first_minor  = i << MM_SHIFT;
index b0df4f5..5cc7e67 100644 (file)
@@ -523,8 +523,6 @@ retry:
        else
                snprintf(g->disk_name, sizeof(g->disk_name),
                                VIOD_GENHD_NAME "%c", 'a' + (dev_no % 26));
-       snprintf(g->devfs_name, sizeof(g->devfs_name),
-                       "%s%d", VIOD_GENHD_DEVFS_NAME, dev_no);
        g->fops = &viodasd_fops;
        g->queue = q;
        g->private_data = d;
index cbce7c5..e828e4c 100644 (file)
@@ -215,7 +215,6 @@ static int __init xd_init(void)
                disk->major = XT_DISK_MAJOR;
                disk->first_minor = i<<6;
                sprintf(disk->disk_name, "xd%c", i+'a');
-               sprintf(disk->devfs_name, "xd/target%d", i);
                disk->fops = &xd_fops;
                disk->private_data = p;
                disk->queue = xd_queue;
index bb5e8d6..82ddbdd 100644 (file)
@@ -354,7 +354,6 @@ z2_init(void)
     z2ram_gendisk->first_minor = 0;
     z2ram_gendisk->fops = &z2_fops;
     sprintf(z2ram_gendisk->disk_name, "z2ram");
-    strcpy(z2ram_gendisk->devfs_name, z2ram_gendisk->disk_name);
 
     z2ram_gendisk->queue = z2_queue;
     add_disk(z2ram_gendisk);
index ec00489..ec46949 100644 (file)
@@ -1918,7 +1918,6 @@ static int __init aztcd_init(void)
        azt_disk->first_minor = 0;
        azt_disk->fops = &azt_fops;
        sprintf(azt_disk->disk_name, "aztcd");
-       sprintf(azt_disk->devfs_name, "aztcd");
        azt_disk->queue = azt_queue;
        add_disk(azt_disk);
        azt_invalidate_buffers();
index ad5464a..b6ee50a 100644 (file)
@@ -955,7 +955,6 @@ static int __init gscd_init(void)
        gscd_disk->first_minor = 0;
        gscd_disk->fops = &gscd_fops;
        sprintf(gscd_disk->disk_name, "gscd");
-       sprintf(gscd_disk->devfs_name, "gscd");
 
        if (register_blkdev(MAJOR_NR, "gscd")) {
                ret = -EIO;
index 0b0eab4..25032d7 100644 (file)
@@ -2033,7 +2033,6 @@ static int __init optcd_init(void)
        optcd_disk->first_minor = 0;
        optcd_disk->fops = &opt_fops;
        sprintf(optcd_disk->disk_name, "optcd");
-       sprintf(optcd_disk->devfs_name, "optcd");
 
        if (!request_region(optcd_port, 4, "optcd")) {
                printk(KERN_ERR "optcd: conflict, I/O port 0x%x already used\n",
index a75b363..2fc966c 100644 (file)
@@ -5868,7 +5868,6 @@ int __init sbpcd_init(void)
                disk->fops = &sbpcd_bdops;
                strcpy(disk->disk_name, sbpcd_infop->name);
                disk->flags = GENHD_FL_CD;
-               sprintf(disk->devfs_name, "sbp/c0t%d", p->drv_id);
                p->disk = disk;
                if (register_cdrom(sbpcd_infop))
                {
index 74b1cad..bf5aef4 100644 (file)
@@ -1695,7 +1695,6 @@ static int __init sjcd_init(void)
        sjcd_disk->first_minor = 0,
        sjcd_disk->fops = &sjcd_fops,
        sprintf(sjcd_disk->disk_name, "sjcd");
-       sprintf(sjcd_disk->devfs_name, "sjcd");
 
        if (!request_region(sjcd_base, 4,"sjcd")) {
                printk
index e656599..8f7cc45 100644 (file)
@@ -1589,7 +1589,6 @@ static int __init sony535_init(void)
        cdu_disk->first_minor = 0;
        cdu_disk->fops = &cdu_fops;
        sprintf(cdu_disk->disk_name, "cdu");
-       sprintf(cdu_disk->devfs_name, "cdu535");
 
        if (!request_region(sony535_cd_base_io, 4, CDU535_HANDLE)) {
                printk(KERN_WARNING"sonycd535: Unable to request region 0x%x\n",
index af6b3bf..f655970 100644 (file)
@@ -688,8 +688,6 @@ static int viocd_probe(struct vio_dev *vdev, const struct vio_device_id *id)
        gendisk->first_minor = deviceno;
        strncpy(gendisk->disk_name, c->name,
                        sizeof(gendisk->disk_name));
-       snprintf(gendisk->devfs_name, sizeof(gendisk->devfs_name),
-                       VIOCD_DEVICE_DEVFS "%d", deviceno);
        blk_queue_max_hw_segments(q, 1);
        blk_queue_max_phys_segments(q, 1);
        blk_queue_max_sectors(q, 4096 / 512);
index 95c275d..2ec1b35 100644 (file)
@@ -2910,13 +2910,10 @@ static struct kobject *md_probe(dev_t dev, int *part, void *data)
        }
        disk->major = MAJOR(dev);
        disk->first_minor = unit << shift;
-       if (partitioned) {
+       if (partitioned)
                sprintf(disk->disk_name, "md_d%d", unit);
-               sprintf(disk->devfs_name, "md/d%d", unit);
-       } else {
+       else
                sprintf(disk->disk_name, "md%d", unit);
-               sprintf(disk->devfs_name, "md/%d", unit);
-       }
        disk->fops = &md_fops;
        disk->private_data = mddev;
        disk->queue = mddev->queue;
index 7d4c549..1ddc2fb 100644 (file)
@@ -1089,7 +1089,6 @@ static int i2o_block_probe(struct device *dev)
        gd = i2o_blk_dev->gd;
        gd->first_minor = unit << 4;
        sprintf(gd->disk_name, "i2o/hd%c", 'a' + unit);
-       sprintf(gd->devfs_name, "i2o/hd%c", 'a' + unit);
        gd->driverfs_dev = &i2o_dev->device;
 
        /* setup request queue */
index 46138f4..115cc21 100644 (file)
@@ -408,7 +408,6 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
         */
 
        sprintf(md->disk->disk_name, "mmcblk%d", devidx);
-       sprintf(md->disk->devfs_name, "mmc/blk%d", devidx);
 
        blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
 
index fce2835..61ffde7 100644 (file)
@@ -68,8 +68,6 @@ dasd_gendisk_alloc(struct dasd_device *device)
        }
        len += sprintf(gdp->disk_name + len, "%c", 'a'+(device->devindex%26));
 
-       sprintf(gdp->devfs_name, "dasd/%s", device->cdev->dev.bus_id);
-
        if (device->features & DASD_FEATURE_READONLY)
                set_disk_ro(gdp, 1);
        gdp->private_data = device;
index f57a6c8..4c1e56b 100644 (file)
@@ -466,7 +466,6 @@ static int __init xpram_setup_blkdev(void)
                disk->private_data = &xpram_devices[i];
                disk->queue = xpram_queue;
                sprintf(disk->disk_name, "slram%d", i);
-               sprintf(disk->devfs_name, "slram/%d", i);
                set_capacity(disk, xpram_sizes[i] << 1);
                add_disk(disk);
        }
index 3498a0c..e4af57e 100644 (file)
@@ -112,8 +112,6 @@ struct gendisk {
        sector_t capacity;
 
        int flags;
-       char devfs_name[64];            /* devfs crap */
-       int number;                     /* more of the same */
        struct device *driverfs_dev;
        struct kobject kobj;
        struct kobject *holder_dir;