public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] number of rd's in Kconfig
@ 2004-11-25 10:59 Marc Leeman
  2004-11-30  8:19 ` Jan Engelhardt
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Leeman @ 2004-11-25 10:59 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Marc Leeman

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

In dedicated systems or small systems; the number of required ramdisks
is by default (16) too large. Like the size of the ramdisks; these
patches add that the number of rds can be configured in the kernel
configuration.

These patches are against the 2.6.9

-- 
ash nazg durbatulûk, ash nazg gimbatul,
ash nazg thrakatulûk agh burzum-ishi krimpatul

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Kconfig.2.6.9.diff --]
[-- Type: text/x-patch; name="Kconfig.2.6.9.diff", Size: 719 bytes --]

--- linux-2.6.9/drivers/block/Kconfig	2004-10-18 23:53:43.000000000 +0200
+++ linux-2.6.9.barco/drivers/block/Kconfig	2004-11-25 09:00:56.000000000 +0100
@@ -329,6 +329,15 @@ config BLK_DEV_RAM
 	  Most normal users won't need the RAM disk functionality, and can
 	  thus say N here.
 
+config BLK_DEV_RAM_COUNT
+	int "Default number of RAM disks"
+	depends on BLK_DEV_RAM
+	default "16"
+	help
+	  The default value is 16 RAM disks. Change this if you know what 
+	  are doing. If you boot from a filesystem that needs to be extracted
+	  in memory, you will need at least one RAM disk (e.g. root on cramfs).
+
 config BLK_DEV_RAM_SIZE
 	int "Default RAM disk size (kbytes)"
 	depends on BLK_DEV_RAM

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: rd.c.2.6.9.diff --]
[-- Type: text/x-patch; name="rd.c.2.6.9.diff", Size: 1956 bytes --]

--- linux-2.6.9/drivers/block/rd.c	2004-10-18 23:54:37.000000000 +0200
+++ linux-2.6.9.barco/drivers/block/rd.c	2004-11-25 09:02:02.000000000 +0100
@@ -60,15 +60,12 @@
 
 #include <asm/uaccess.h>
 
-/* The RAM disk size is now a parameter */
-#define NUM_RAMDISKS 16		/* This cannot be overridden (yet) */
-
 /* Various static variables go here.  Most are used only in the RAM disk code.
  */
 
-static struct gendisk *rd_disks[NUM_RAMDISKS];
-static struct block_device *rd_bdev[NUM_RAMDISKS];/* Protected device data */
-static struct request_queue *rd_queue[NUM_RAMDISKS];
+static struct gendisk *rd_disks[CONFIG_BLK_DEV_RAM_COUNT];
+static struct block_device *rd_bdev[CONFIG_BLK_DEV_RAM_COUNT];/* Protected device data */
+static struct request_queue *rd_queue[CONFIG_BLK_DEV_RAM_COUNT];
 
 /*
  * Parameters for the boot-loading of the RAM disk.  These are set by
@@ -402,7 +399,7 @@ static void __exit rd_cleanup(void)
 {
 	int i;
 
-	for (i = 0; i < NUM_RAMDISKS; i++) {
+	for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
 		struct block_device *bdev = rd_bdev[i];
 		rd_bdev[i] = NULL;
 		if (bdev) {
@@ -432,7 +429,7 @@ static int __init rd_init(void)
 		rd_blocksize = BLOCK_SIZE;
 	}
 
-	for (i = 0; i < NUM_RAMDISKS; i++) {
+	for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
 		rd_disks[i] = alloc_disk(1);
 		if (!rd_disks[i])
 			goto out;
@@ -445,7 +442,7 @@ static int __init rd_init(void)
 
 	devfs_mk_dir("rd");
 
-	for (i = 0; i < NUM_RAMDISKS; i++) {
+	for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) {
 		struct gendisk *disk = rd_disks[i];
 
 		rd_queue[i] = blk_alloc_queue(GFP_KERNEL);
@@ -470,7 +467,7 @@ static int __init rd_init(void)
 	/* rd_size is given in kB */
 	printk("RAMDISK driver initialized: "
 		"%d RAM disks of %dK size %d blocksize\n",
-		NUM_RAMDISKS, rd_size, rd_blocksize);
+		CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize);
 
 	return 0;
 out_queue:

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] number of rd's in Kconfig
  2004-11-25 10:59 [patch] number of rd's in Kconfig Marc Leeman
@ 2004-11-30  8:19 ` Jan Engelhardt
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Engelhardt @ 2004-11-30  8:19 UTC (permalink / raw)
  To: Marc Leeman; +Cc: akpm, Linux Kernel Mailing List

>In dedicated systems or small systems; the number of required ramdisks
>is by default (16) too large. Like the size of the ramdisks; these
>patches add that the number of rds can be configured in the kernel
>configuration.
>
>These patches are against the 2.6.9

The last time I checked my kernel tree (it's a suse, but nevermind),
I was able to freely choose the ramdisk size, i.e. there is an input field for
a number.
I have not seen some number field to specify the _number_ of disks, though!


Jan Engelhardt
-- 
Gesellschaft für Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 Göttingen, www.gwdg.de

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-30  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-25 10:59 [patch] number of rd's in Kconfig Marc Leeman
2004-11-30  8:19 ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox