]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-inittmpfs.patch
- fetch 2.6.37; .36 is on LINUX_2_6_36
[packages/kernel.git] / kernel-inittmpfs.patch
CommitLineData
38eb4ad4 1diff -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
4@@ -724,6 +724,25 @@
2380c486 5
38eb4ad4 6 If you don't know what Access Control Lists are, say N.
2380c486 7
38eb4ad4 8+config TMPFS_ROOT
9+ bool "Use tmpfs instrad of ramfs for initramfs"
10+ depends on TMPFS && SHMEM
2380c486
JR
11+ default y
12+ help
38eb4ad4 13+ This replaces the ramfs used for unpacking the cpio images
14+ with tmpfs.
15+
16+config RAMFS
17+ bool "Ramfs file system support" if TMPFS_ROOT
18+ default n
19+ ---help---
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.
23+
24+ Ramfs is used for booting the system and unpacking the cpio if
25+ TMPFS_ROOT is not set.
2380c486
JR
26+
27 config HUGETLBFS
28 bool "HugeTLB file system support"
38eb4ad4 29 depends on X86 || IA64 || PPC64 || SPARC64 || (SUPERH && MMU) || \
30diff -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
33@@ -265,6 +265,13 @@
34 return get_sb_nodev(fs_type, flags, data, ramfs_fill_super, mnt);
2380c486
JR
35 }
36
38eb4ad4 37+static struct file_system_type ramfs_fs_type = {
38+ .name = "ramfs",
39+ .get_sb = ramfs_get_sb,
40+ .kill_sb = kill_litter_super,
41+};
2380c486 42+
38eb4ad4 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)
46 {
47@@ -278,30 +285,12 @@
48 kill_litter_super(sb);
49 }
2380c486 50
38eb4ad4 51-static struct file_system_type ramfs_fs_type = {
52- .name = "ramfs",
53- .get_sb = ramfs_get_sb,
54- .kill_sb = ramfs_kill_sb,
55-};
56 static struct file_system_type rootfs_fs_type = {
57 .name = "rootfs",
58 .get_sb = rootfs_get_sb,
2380c486
JR
59 .kill_sb = kill_litter_super,
60 };
61
38eb4ad4 62-static int __init init_ramfs_fs(void)
63-{
64- return register_filesystem(&ramfs_fs_type);
65-}
66-
67-static void __exit exit_ramfs_fs(void)
68-{
69- unregister_filesystem(&ramfs_fs_type);
70-}
71-
72-module_init(init_ramfs_fs)
73-module_exit(exit_ramfs_fs)
74-
75 int __init init_rootfs(void)
2380c486 76 {
38eb4ad4 77 int err;
78@@ -316,5 +305,19 @@
2380c486 79
38eb4ad4 80 return err;
2380c486 81 }
38eb4ad4 82+#endif
83+
84+static int __init init_ramfs_fs(void)
85+{
86+ return register_filesystem(&ramfs_fs_type);
87+}
88+
89+static void __exit exit_ramfs_fs(void)
90+{
91+ unregister_filesystem(&ramfs_fs_type);
92+}
93+
94+module_init(init_ramfs_fs)
95+module_exit(exit_ramfs_fs)
2380c486 96
38eb4ad4 97 MODULE_LICENSE("GPL");
98diff -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
101@@ -86,7 +86,7 @@
102 #ifdef CONFIG_TMPFS
103 static unsigned long shmem_default_max_blocks(void)
104 {
105- return totalram_pages / 2;
106+ return totalram_pages / 10 * 9;
107 }
108
109 static unsigned long shmem_default_max_inodes(void)
110@@ -2369,6 +2369,10 @@
111
112 static int init_inodecache(void)
113 {
114+#ifdef CONFIG_TMPFS_ROOT
115+ if (shmem_inode_cachep)
116+ return 0;
117+#endif
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 @@
122 }
123 EXPORT_SYMBOL_GPL(shmem_file_setup);
124
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)
128+{
129+ return get_sb_nodev(fs_type, flags, data, shmem_fill_super, mnt);
130+}
131+
132+static struct file_system_type rootfs_fs_type = {
133+ .name = "rootfs",
134+ .get_sb = rootfs_get_sb,
135+ .kill_sb = kill_litter_super,
136+};
137+
138+int __init init_rootfs(void)
139+{
140+ if (init_inodecache())
141+ panic("Can't initialize shm inode cache");
142+ return register_filesystem(&rootfs_fs_type);
143+}
144+#endif
145+
146 /**
147 * shmem_zero_setup - setup a shared anonymous mapping
148 * @vma: the vma to be mmapped is prepared by do_mmap_pgoff
This page took 0.09665 seconds and 4 git commands to generate.