1 diff -ruw linux-2.6.30.orig/fs/Kconfig linux-2.6.30/fs/Kconfig
2 --- linux-2.6.30.orig/fs/Kconfig 2009-02-12 17:51:15.000000000 +0000
3 +++ linux-2.6.30/fs/Kconfig 2009-02-13 12:01:55.000000000 +0000
6 If you don't know what Access Control Lists are, say N.
9 + bool "Use tmpfs instrad of ramfs for initramfs"
10 + depends on TMPFS && SHMEM
13 + This replaces the ramfs used for unpacking the cpio images
17 + bool "Ramfs file system support" if TMPFS_ROOT
20 + Ramfs is a file system which keeps all files in RAM. Unlike tmpfs,
21 + it cannot be swapped to disk, and it has the risk of deadlocking
22 + the system by using all memory.
24 + Ramfs is used for booting the system and unpacking the cpio if
25 + TMPFS_ROOT is not set.
28 bool "HugeTLB file system support"
29 depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || \
30 diff -ruw linux-2.6.30.orig/fs/ramfs/inode.c linux-2.6.30/fs/ramfs/inode.c
31 --- linux-2.6.30.orig/fs/ramfs/inode.c 2009-02-12 17:51:15.000000000 +0000
32 +++ linux-2.6.30/fs/ramfs/inode.c 2009-02-13 11:30:30.000000000 +0000
34 return get_sb_nodev(fs_type, flags, data, ramfs_fill_super, mnt);
37 +static struct file_system_type ramfs_fs_type = {
39 + .get_sb = ramfs_get_sb,
40 + .kill_sb = kill_litter_super,
43 +#ifndef CONFIG_TMPFS_ROOT
44 static int rootfs_get_sb(struct file_system_type *fs_type,
45 int flags, const char *dev_name, void *data, struct vfsmount *mnt)
48 kill_litter_super(sb);
51 -static struct file_system_type ramfs_fs_type = {
53 - .get_sb = ramfs_get_sb,
54 - .kill_sb = ramfs_kill_sb,
56 static struct file_system_type rootfs_fs_type = {
58 .get_sb = rootfs_get_sb,
59 .kill_sb = kill_litter_super,
62 -static int __init init_ramfs_fs(void)
64 - return register_filesystem(&ramfs_fs_type);
67 -static void __exit exit_ramfs_fs(void)
69 - unregister_filesystem(&ramfs_fs_type);
72 -module_init(init_ramfs_fs)
73 -module_exit(exit_ramfs_fs)
75 int __init init_rootfs(void)
84 +static int __init init_ramfs_fs(void)
86 + return register_filesystem(&ramfs_fs_type);
89 +static void __exit exit_ramfs_fs(void)
91 + unregister_filesystem(&ramfs_fs_type);
94 +module_init(init_ramfs_fs)
95 +module_exit(exit_ramfs_fs)
97 MODULE_LICENSE("GPL");
98 diff -ruw linux-2.6.30.orig/mm/shmem.c linux-2.6.30/mm/shmem.c
99 --- linux-2.6.30.orig/mm/shmem.c 2009-02-12 17:51:15.000000000 +0000
100 +++ linux-2.6.30/mm/shmem.c 2009-02-13 11:42:02.000000000 +0000
103 static unsigned long shmem_default_max_blocks(void)
105 - return totalram_pages / 2;
106 + return totalram_pages / 10 * 9;
109 static unsigned long shmem_default_max_inodes(void)
110 @@ -2369,6 +2369,10 @@
112 static int init_inodecache(void)
114 +#ifdef CONFIG_TMPFS_ROOT
115 + if (shmem_inode_cachep)
118 shmem_inode_cachep = kmem_cache_create("shmem_inode_cache",
119 sizeof(struct shmem_inode_info),
120 0, SLAB_PANIC, init_once);
121 @@ -2587,6 +2591,27 @@
123 EXPORT_SYMBOL_GPL(shmem_file_setup);
125 +#ifdef CONFIG_TMPFS_ROOT
126 +static int rootfs_get_sb(struct file_system_type *fs_type,
127 + int flags, const char *dev_name, void *data, struct vfsmount *mnt)
129 + return get_sb_nodev(fs_type, flags, data, shmem_fill_super, mnt);
132 +static struct file_system_type rootfs_fs_type = {
134 + .get_sb = rootfs_get_sb,
135 + .kill_sb = kill_litter_super,
138 +int __init init_rootfs(void)
140 + if (init_inodecache())
141 + panic("Can't initialize shm inode cache");
142 + return register_filesystem(&rootfs_fs_type);
147 * shmem_zero_setup - setup a shared anonymous mapping
148 * @vma: the vma to be mmapped is prepared by do_mmap_pgoff