Commit 8e62b8a7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Initialise devfs_name in various block drivers

From: Andrey Borzenkov <arvidjaar@mail.ru>

Various block drivers are currently devfs-unaware.  Andrey's patch attempts
to give them reasonable representations in devfs.


 "The attached patch suggests some possible names for non-floppy devices
  based on reading driver source.  I have to ask if these make sense.  At
  least for cciss Mandrake devfsd patch expects different names but it
  seems to be mistake (it assumes single controller always)

 "For floppy it is not as simple.  Floppy cannot use genhd and must
  create names manually; but I do not know what names are appropriate or
  expected.

 "For acsi the target/lun name may have problem of creating compat names
  (if any) by devfsd.

 "Please note that none of them created any devfs name under 2.4 as well.
   So it is not a regression ..."
parent ceffc556
......@@ -1729,10 +1729,14 @@ int acsi_init( void )
for( i = 0; i < NDevices; ++i ) {
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);
......
......@@ -2531,6 +2531,7 @@ static int __init cciss_init_one(struct pci_dev *pdev,
struct gendisk *disk = hba[i]->gendisk[j];
sprintf(disk->disk_name, "cciss/c%dd%d", i, j);
sprintf(disk->devfs_name, "cciss/host%d/target%d", i, j);
disk->major = COMPAQ_CISS_MAJOR + i;
disk->first_minor = j << NWD_SHIFT;
disk->fops = &cciss_fops;
......
......@@ -421,6 +421,7 @@ 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;
}
......
......@@ -52,7 +52,6 @@
#include <linux/fcntl.h> /* O_ACCMODE */
#include <linux/hdreg.h> /* HDIO_GETGEO */
#include <linux/devfs_fs_kernel.h>
#include <linux/umem.h>
......@@ -1204,11 +1203,10 @@ int __init mm_init(void)
goto out;
}
devfs_mk_dir("umem");
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;
......@@ -1245,7 +1243,6 @@ void __exit mm_cleanup(void)
del_gendisk(mm_gendisk[i]);
put_disk(mm_gendisk[i]);
}
devfs_remove("umem");
pci_unregister_driver(&mm_pci_driver);
......
......@@ -45,7 +45,6 @@
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/wait.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/blkdev.h>
#include <linux/blkpg.h>
......@@ -182,7 +181,6 @@ static int __init xd_init(void)
if (!xd_queue)
goto out1a;
devfs_mk_dir("xd");
if (xd_detect(&controller,&address)) {
printk("Detected a%s controller (type %d) at address %06x\n",
......@@ -213,6 +211,7 @@ 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;
......@@ -249,7 +248,6 @@ static int __init xd_init(void)
out3:
release_region(xd_iobase,4);
out2:
devfs_remove("xd");
blk_cleanup_queue(xd_queue);
out1a:
unregister_blkdev(XT_DISK_MAJOR, "xd");
......@@ -1064,7 +1062,6 @@ void cleanup_module(void)
}
blk_cleanup_queue(xd_queue);
release_region(xd_iobase,4);
devfs_remove("xd");
if (xd_drives) {
free_irq(xd_irq, NULL);
free_dma(xd_dma);
......
......@@ -354,6 +354,7 @@ 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment