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

Next file: linux/drivers/char/console.c
Previous file: linux/drivers/block/ll_rw_blk.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.49/linux/drivers/block/rd.c linux/drivers/block/rd.c
@@ -70,8 +70,6 @@
 int rd_prompt = 1;		/* 1 = prompt for ramdisk, 0 = don't prompt */
 int rd_image_start = 0;		/* starting block # of image */
 
-int rd_loading = 0;
-
 /*
  *  Basically, my strategy here is to set up a buffer-head which can't be
  *  deleted, and make that my Ramdisk.  If the request is outside of the
@@ -253,7 +251,6 @@
 	}
 
 	/* Try ext2 */
-	printk("ext2 magic = %d\n", ext2sb->s_magic);
 	if (ext2sb->s_magic == EXT2_SUPER_MAGIC) {
 		printk(KERN_NOTICE
 		       "RAMDISK: Ext2 filesystem found at block %d\n",
@@ -296,6 +293,8 @@
 	int device, ram_device;
 	int nblocks, i;
 	char *buf;
+	unsigned short rotate = 0;
+	char rotator[4] = { '|' , '/' , '-' , '\\' };
 
 	if (rd_doload == 0)
 		return;
@@ -328,7 +327,6 @@
 
 	fs = get_fs();
 	set_fs(KERNEL_DS);
-	rd_loading = 1;
 	
 	nblocks = identify_ramdisk_image(device, &infile, rd_image_start);
 	if (nblocks < 0)
@@ -360,12 +358,19 @@
 		printk(KERN_ERR "RAMDISK: could not allocate buffer\n");
 		goto done;
 	}
+
+	printk(KERN_NOTICE "RAMDISK: Loading %d blocks into ram disk... ", nblocks);
 	for (i=0; i < nblocks; i++) {
 		infile.f_op->read(infile.f_inode, &infile, buf,
 				  BLOCK_SIZE);
 		outfile.f_op->write(outfile.f_inode, &outfile, buf,
 				    BLOCK_SIZE);
+		if (!(i % 16)) {
+			printk("%c\b", rotator[rotate & 0x3]);
+			rotate++;
+		}
 	}
+	printk("done.\n");
 	kfree(buf);
 
 successful_load:
@@ -376,12 +381,9 @@
 	if (infile.f_op->release)
 		infile.f_op->release(&inode, &infile);
 	set_fs(fs);
-	rd_loading = 0;
 }
 
 #ifdef BUILD_CRAMDISK
-
-#include <string.h>
 
 /*
  * gzip declarations

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this