patch-2.3.13 linux/drivers/block/rd.c

Next file: linux/drivers/block/rz1000.c
Previous file: linux/drivers/block/q40ide.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.12/linux/drivers/block/rd.c linux/drivers/block/rd.c
@@ -116,6 +116,7 @@
 int rd_size = 4096;		/* Size of the RAM disks */
 
 #ifndef MODULE
+
 int rd_doload = 0;		/* 1 = load RAM disk, 0 = don't load */
 int rd_prompt = 1;		/* 1 = prompt for RAM disk, 0 = don't prompt */
 int rd_image_start = 0;		/* starting block # of image */
@@ -123,7 +124,52 @@
 unsigned long initrd_start,initrd_end;
 int mount_initrd = 1;		/* zero if initrd should not be mounted */
 int initrd_below_start_ok = 0;
+
+static int __init no_initrd(char *str)
+{
+	mount_initrd = 0;
+	return 1;
+}
+
+__setup("noinitrd", no_initrd);
+
 #endif
+
+static int __init ramdisk_start_setup(char *str)
+{
+	rd_image_start = simple_strtol(str,NULL,0);
+	return 1;
+}
+
+static int __init load_ramdisk(char *str)
+{
+	rd_doload = simple_strtol(str,NULL,0) & 3;
+	return 1;
+}
+
+static int __init prompt_ramdisk(char *str)
+{
+	rd_prompt = simple_strtol(str,NULL,0) & 1;
+	return 1;
+}
+
+static int __init ramdisk_size(char *str)
+{
+	rd_size = simple_strtol(str,NULL,0);
+	return 1;
+}
+
+static int __init ramdisk_size2(char *str)
+{
+	return ramdisk_size(str);
+}
+
+__setup("ramdisk_start=", ramdisk_start_setup);
+__setup("load_ramdisk=", load_ramdisk);
+__setup("prompt_ramdisk=", prompt_ramdisk);
+__setup("ramdisk=", ramdisk_size);
+__setup("ramdisk_size=", ramdisk_size2);
+
 #endif
 
 /*
@@ -297,7 +343,7 @@
 };
 
 /* This is the registration and initialization section of the RAM disk driver */
-__initfunc(int rd_init(void))
+int __init rd_init(void)
 {
 	int		i;
 
@@ -370,8 +416,8 @@
  *	romfs
  * 	gzip
  */
-__initfunc(int
-identify_ramdisk_image(kdev_t device, struct file *fp, int start_block))
+int __init 
+identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
 {
 	const int size = 512;
 	struct minix_super_block *minixsb;
@@ -463,7 +509,7 @@
 /*
  * This routine loads in the RAM disk image.
  */
-__initfunc(static void rd_load_image(kdev_t device, int offset, int unit))
+static void __init rd_load_image(kdev_t device, int offset, int unit)
 {
  	struct inode inode, out_inode;
 	struct file infile, outfile;
@@ -585,7 +631,7 @@
 }
 
 
-__initfunc(static void rd_load_disk(int n))
+static void __init rd_load_disk(int n)
 {
 #ifdef CONFIG_BLK_DEV_INITRD
 	extern kdev_t real_root_dev;
@@ -614,18 +660,18 @@
 
 }
 
-__initfunc(void rd_load(void))
+void __init rd_load(void)
 {
 	rd_load_disk(0);
 }
 
-__initfunc(void rd_load_secondary(void))
+void __init rd_load_secondary(void)
 {
 	rd_load_disk(1);
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
-__initfunc(void initrd_load(void))
+void __init initrd_load(void)
 {
 	rd_load_image(MKDEV(MAJOR_NR, INITRD_MINOR),rd_image_start,0);
 }
@@ -684,21 +730,21 @@
 
 #include "../../lib/inflate.c"
 
-__initfunc(static void *malloc(int size))
+static void __init *malloc(int size)
 {
 	return kmalloc(size, GFP_KERNEL);
 }
 
-__initfunc(static void free(void *where))
+static void __init free(void *where)
 {
 	kfree(where);
 }
 
-__initfunc(static void gzip_mark(void **ptr))
+static void __init gzip_mark(void **ptr)
 {
 }
 
-__initfunc(static void gzip_release(void **ptr))
+static void __init gzip_release(void **ptr)
 {
 }
 
@@ -707,7 +753,7 @@
  * Fill the input buffer. This is called only when the buffer is empty
  * and at least one byte is really needed.
  */
-__initfunc(static int fill_inbuf(void))
+static int __init fill_inbuf(void)
 {
 	if (exit_code) return -1;
 	
@@ -724,7 +770,7 @@
  * Write the output window window[0..outcnt-1] and update crc and bytes_out.
  * (Used for the decompressed data only.)
  */
-__initfunc(static void flush_window(void))
+static void __init flush_window(void)
 {
     ulg c = crc;         /* temporary variable */
     unsigned n;
@@ -741,14 +787,14 @@
     outcnt = 0;
 }
 
-__initfunc(static void error(char *x))
+static void __init error(char *x)
 {
 	printk(KERN_ERR "%s", x);
 	exit_code = 1;
 }
 
-__initfunc(static int
-crd_load(struct file * fp, struct file *outfp))
+static int __init 
+crd_load(struct file * fp, struct file *outfp)
 {
 	int result;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)