diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:18:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-09 18:18:49 -0500 |
commit | 31aeb6c815549948571eec988ad9728c27d7a68d (patch) | |
tree | e155438be253924ebb1b792182e406947369b3eb /init | |
parent | c40f6f8bbc4cbd2902671aacd587400ddca62627 (diff) | |
parent | fc55584175589b70f4c30cb594f09f4bd6ad5d40 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus
* git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-linus:
MAINTAINERS: squashfs entry
Squashfs: documentation
Squashfs: initrd support
Squashfs: Kconfig entry
Squashfs: Makefiles
Squashfs: header files
Squashfs: block operations
Squashfs: cache operations
Squashfs: uid/gid lookup operations
Squashfs: fragment block operations
Squashfs: export operations
Squashfs: super block operations
Squashfs: symlink operations
Squashfs: regular file operations
Squashfs: directory readdir operations
Squashfs: directory lookup operations
Squashfs: inode operations
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts_rd.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index a7c748fa977a..0f0f0cf3ba9a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | 10 | ||
11 | #include "do_mounts.h" | 11 | #include "do_mounts.h" |
12 | #include "../fs/squashfs/squashfs_fs.h" | ||
12 | 13 | ||
13 | int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ | 14 | int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ |
14 | 15 | ||
@@ -41,6 +42,7 @@ static int __init crd_load(int in_fd, int out_fd); | |||
41 | * ext2 | 42 | * ext2 |
42 | * romfs | 43 | * romfs |
43 | * cramfs | 44 | * cramfs |
45 | * squashfs | ||
44 | * gzip | 46 | * gzip |
45 | */ | 47 | */ |
46 | static int __init | 48 | static int __init |
@@ -51,6 +53,7 @@ identify_ramdisk_image(int fd, int start_block) | |||
51 | struct ext2_super_block *ext2sb; | 53 | struct ext2_super_block *ext2sb; |
52 | struct romfs_super_block *romfsb; | 54 | struct romfs_super_block *romfsb; |
53 | struct cramfs_super *cramfsb; | 55 | struct cramfs_super *cramfsb; |
56 | struct squashfs_super_block *squashfsb; | ||
54 | int nblocks = -1; | 57 | int nblocks = -1; |
55 | unsigned char *buf; | 58 | unsigned char *buf; |
56 | 59 | ||
@@ -62,6 +65,7 @@ identify_ramdisk_image(int fd, int start_block) | |||
62 | ext2sb = (struct ext2_super_block *) buf; | 65 | ext2sb = (struct ext2_super_block *) buf; |
63 | romfsb = (struct romfs_super_block *) buf; | 66 | romfsb = (struct romfs_super_block *) buf; |
64 | cramfsb = (struct cramfs_super *) buf; | 67 | cramfsb = (struct cramfs_super *) buf; |
68 | squashfsb = (struct squashfs_super_block *) buf; | ||
65 | memset(buf, 0xe5, size); | 69 | memset(buf, 0xe5, size); |
66 | 70 | ||
67 | /* | 71 | /* |
@@ -99,6 +103,16 @@ identify_ramdisk_image(int fd, int start_block) | |||
99 | goto done; | 103 | goto done; |
100 | } | 104 | } |
101 | 105 | ||
106 | /* squashfs is at block zero too */ | ||
107 | if (le32_to_cpu(squashfsb->s_magic) == SQUASHFS_MAGIC) { | ||
108 | printk(KERN_NOTICE | ||
109 | "RAMDISK: squashfs filesystem found at block %d\n", | ||
110 | start_block); | ||
111 | nblocks = (le64_to_cpu(squashfsb->bytes_used) + BLOCK_SIZE - 1) | ||
112 | >> BLOCK_SIZE_BITS; | ||
113 | goto done; | ||
114 | } | ||
115 | |||
102 | /* | 116 | /* |
103 | * Read block 1 to test for minix and ext2 superblock | 117 | * Read block 1 to test for minix and ext2 superblock |
104 | */ | 118 | */ |