Commit 6dfb870f authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] devfs: rd

parent 024548b8
......@@ -370,11 +370,9 @@ static void __exit rd_cleanup (void)
}
del_gendisk(rd_disks[i]);
put_disk(rd_disks[i]);
devfs_remove("rd/%d", i);
}
#ifdef CONFIG_BLK_DEV_INITRD
put_disk(initrd_disk);
devfs_remove("rd/initrd");
#endif
devfs_remove("rd");
unregister_blkdev(RAMDISK_MAJOR, "ramdisk" );
......@@ -402,7 +400,9 @@ static int __init rd_init (void)
initrd_disk->first_minor = INITRD_MINOR;
initrd_disk->fops = &rd_bd_op;
sprintf(initrd_disk->disk_name, "initrd");
sprintf(initrd_disk->devfs_name, "rd/initrd");
#endif
for (i = 0; i < NUM_RAMDISKS; i++) {
rd_disks[i] = alloc_disk(1);
if (!rd_disks[i])
......@@ -420,30 +420,22 @@ static int __init rd_init (void)
for (i = 0; i < NUM_RAMDISKS; i++) {
struct gendisk *disk = rd_disks[i];
char name[16];
/* rd_size is given in kB */
disk->major = RAMDISK_MAJOR;
disk->first_minor = i;
disk->fops = &rd_bd_op;
disk->queue = &rd_queue;
sprintf(disk->disk_name, "ram%d", i);
sprintf(disk->devfs_name, "rd/%d", i);
set_capacity(disk, rd_size * 2);
sprintf(name, "rd/%d", i);
devfs_register(NULL, name, DEVFS_FL_DEFAULT,
disk->major, disk->first_minor,
S_IFBLK | S_IRUSR | S_IWUSR,
disk->fops, NULL);
}
for (i = 0; i < NUM_RAMDISKS; i++)
add_disk(rd_disks[i]);
}
#ifdef CONFIG_BLK_DEV_INITRD
/* We ought to separate initrd operations here */
set_capacity(initrd_disk, (initrd_end-initrd_start+511)>>9);
add_disk(initrd_disk);
devfs_register(NULL, "rd/initrd", DEVFS_FL_DEFAULT, RAMDISK_MAJOR,
INITRD_MINOR, S_IFBLK | S_IRUSR, &rd_bd_op, NULL);
#endif
/* rd_size is given in kB */
......
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