diff options
Diffstat (limited to 'init/do_mounts_rd.c')
| -rw-r--r-- | init/do_mounts_rd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index 887629e24c54..6212586df29a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c | |||
| @@ -54,20 +54,19 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) | |||
| 54 | { | 54 | { |
| 55 | const int size = 512; | 55 | const int size = 512; |
| 56 | struct minix_super_block *minixsb; | 56 | struct minix_super_block *minixsb; |
| 57 | struct ext2_super_block *ext2sb; | ||
| 58 | struct romfs_super_block *romfsb; | 57 | struct romfs_super_block *romfsb; |
| 59 | struct cramfs_super *cramfsb; | 58 | struct cramfs_super *cramfsb; |
| 60 | struct squashfs_super_block *squashfsb; | 59 | struct squashfs_super_block *squashfsb; |
| 61 | int nblocks = -1; | 60 | int nblocks = -1; |
| 62 | unsigned char *buf; | 61 | unsigned char *buf; |
| 63 | const char *compress_name; | 62 | const char *compress_name; |
| 63 | unsigned long n; | ||
| 64 | 64 | ||
| 65 | buf = kmalloc(size, GFP_KERNEL); | 65 | buf = kmalloc(size, GFP_KERNEL); |
| 66 | if (!buf) | 66 | if (!buf) |
| 67 | return -ENOMEM; | 67 | return -ENOMEM; |
| 68 | 68 | ||
| 69 | minixsb = (struct minix_super_block *) buf; | 69 | minixsb = (struct minix_super_block *) buf; |
| 70 | ext2sb = (struct ext2_super_block *) buf; | ||
| 71 | romfsb = (struct romfs_super_block *) buf; | 70 | romfsb = (struct romfs_super_block *) buf; |
| 72 | cramfsb = (struct cramfs_super *) buf; | 71 | cramfsb = (struct cramfs_super *) buf; |
| 73 | squashfsb = (struct squashfs_super_block *) buf; | 72 | squashfsb = (struct squashfs_super_block *) buf; |
| @@ -150,12 +149,12 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor) | |||
| 150 | } | 149 | } |
| 151 | 150 | ||
| 152 | /* Try ext2 */ | 151 | /* Try ext2 */ |
| 153 | if (ext2sb->s_magic == cpu_to_le16(EXT2_SUPER_MAGIC)) { | 152 | n = ext2_image_size(buf); |
| 153 | if (n) { | ||
| 154 | printk(KERN_NOTICE | 154 | printk(KERN_NOTICE |
| 155 | "RAMDISK: ext2 filesystem found at block %d\n", | 155 | "RAMDISK: ext2 filesystem found at block %d\n", |
| 156 | start_block); | 156 | start_block); |
| 157 | nblocks = le32_to_cpu(ext2sb->s_blocks_count) << | 157 | nblocks = n; |
| 158 | le32_to_cpu(ext2sb->s_log_block_size); | ||
| 159 | goto done; | 158 | goto done; |
| 160 | } | 159 | } |
| 161 | 160 | ||
| @@ -178,7 +177,7 @@ int __init rd_load_image(char *from) | |||
| 178 | char *buf = NULL; | 177 | char *buf = NULL; |
| 179 | unsigned short rotate = 0; | 178 | unsigned short rotate = 0; |
| 180 | decompress_fn decompressor = NULL; | 179 | decompress_fn decompressor = NULL; |
| 181 | #if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) | 180 | #if !defined(CONFIG_S390) |
| 182 | char rotator[4] = { '|' , '/' , '-' , '\\' }; | 181 | char rotator[4] = { '|' , '/' , '-' , '\\' }; |
| 183 | #endif | 182 | #endif |
| 184 | 183 | ||
| @@ -264,7 +263,7 @@ int __init rd_load_image(char *from) | |||
| 264 | } | 263 | } |
| 265 | sys_read(in_fd, buf, BLOCK_SIZE); | 264 | sys_read(in_fd, buf, BLOCK_SIZE); |
| 266 | sys_write(out_fd, buf, BLOCK_SIZE); | 265 | sys_write(out_fd, buf, BLOCK_SIZE); |
| 267 | #if !defined(CONFIG_S390) && !defined(CONFIG_PPC_ISERIES) | 266 | #if !defined(CONFIG_S390) |
| 268 | if (!(i % 16)) { | 267 | if (!(i % 16)) { |
| 269 | printk("%c\b", rotator[rotate & 0x3]); | 268 | printk("%c\b", rotator[rotate & 0x3]); |
| 270 | rotate++; | 269 | rotate++; |
