From: Marc Leeman <marc.leeman@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Marc Leeman <marc.leeman@gmail.com>
Subject: [patch] number of rd's in Kconfig
Date: Thu, 25 Nov 2004 11:59:10 +0100 [thread overview]
Message-ID: <1f729c4804112502595b98ed08@mail.gmail.com> (raw)
[-- 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:
next reply other threads:[~2004-11-27 6:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-25 10:59 Marc Leeman [this message]
2004-11-30 8:19 ` [patch] number of rd's in Kconfig Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f729c4804112502595b98ed08@mail.gmail.com \
--to=marc.leeman@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.