* and set blk_size for -ENOSPC, Werner Fink <werner@suse.de>, Apr '99
*/
+#include <linux/config.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <asm/atomic.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
+#include <linux/devfs_fs_kernel.h>
#include <linux/pagemap.h>
#include <linux/blkdev.h>
#include <linux/genhd.h>
* behaviour. The default is still BLOCK_SIZE (needed by rd_load_image that
* supposes the filesystem in the image uses a BLOCK_SIZE blocksize).
*/
-static int rd_blocksize = CONFIG_BLK_DEV_RAM_BLOCKSIZE;
+static int rd_blocksize = BLOCK_SIZE; /* blocksize of the RAM disks */
/*
* Copyright (C) 2000 Linus Torvalds.
return 0;
}
-static const struct address_space_operations ramdisk_aops = {
+static struct address_space_operations ramdisk_aops = {
.readpage = ramdisk_readpage,
.prepare_write = ramdisk_prepare_write,
.commit_write = ramdisk_commit_write,
put_disk(rd_disks[i]);
blk_cleanup_queue(rd_queue[i]);
}
+ devfs_remove("rd");
unregister_blkdev(RAMDISK_MAJOR, "ramdisk");
}
goto out;
}
+ devfs_mk_dir("rd");
+
for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
struct gendisk *disk = rd_disks[i];
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]);
}