X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=kernel-inittmpfs.patch;h=a89cb38df9dca4e741bb17805370884bfda3b268;hb=968cc686e4754b540581e741e5ee450a69101639;hp=9084a581583201db6901069f2f5c89f8d6e5ac31;hpb=38eb4ad4bc8fb65a80dc7342f471a18eb9ca89ea;p=packages%2Fkernel.git diff --git a/kernel-inittmpfs.patch b/kernel-inittmpfs.patch index 9084a581..a89cb38d 100644 --- a/kernel-inittmpfs.patch +++ b/kernel-inittmpfs.patch @@ -6,7 +6,7 @@ diff -ruw linux-2.6.30.orig/fs/Kconfig linux-2.6.30/fs/Kconfig If you don't know what Access Control Lists are, say N. +config TMPFS_ROOT -+ bool "Use tmpfs instrad of ramfs for initramfs" ++ bool "Use tmpfs instead of ramfs for initramfs" + depends on TMPFS && SHMEM + default y + help @@ -30,32 +30,34 @@ diff -ruw linux-2.6.30.orig/fs/Kconfig linux-2.6.30/fs/Kconfig diff -ruw linux-2.6.30.orig/fs/ramfs/inode.c linux-2.6.30/fs/ramfs/inode.c --- linux-2.6.30.orig/fs/ramfs/inode.c 2009-02-12 17:51:15.000000000 +0000 +++ linux-2.6.30/fs/ramfs/inode.c 2009-02-13 11:30:30.000000000 +0000 -@@ -265,6 +265,13 @@ - return get_sb_nodev(fs_type, flags, data, ramfs_fill_super, mnt); +@@ -244,12 +244,6 @@ + return mount_nodev(fs_type, flags, data, ramfs_fill_super); } -+static struct file_system_type ramfs_fs_type = { -+ .name = "ramfs", -+ .get_sb = ramfs_get_sb, -+ .kill_sb = kill_litter_super, -+}; +-static struct dentry *rootfs_mount(struct file_system_type *fs_type, +- int flags, const char *dev_name, void *data) +-{ +- return mount_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super); +-} +- + static void ramfs_kill_sb(struct super_block *sb) + { + kfree(sb->s_fs_info); +@@ -261,18 +255,20 @@ + .mount = ramfs_mount, + .kill_sb = ramfs_kill_sb, + }; + +#ifndef CONFIG_TMPFS_ROOT - static int rootfs_get_sb(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data, struct vfsmount *mnt) - { -@@ -278,30 +285,12 @@ - kill_litter_super(sb); - } - --static struct file_system_type ramfs_fs_type = { -- .name = "ramfs", -- .get_sb = ramfs_get_sb, -- .kill_sb = ramfs_kill_sb, --}; ++static struct dentry *rootfs_mount(struct file_system_type *fs_type, ++ int flags, const char *dev_name, void *data) ++{ ++ return mount_nodev(fs_type, flags|MS_NOUSER, data, ramfs_fill_super); ++} ++ static struct file_system_type rootfs_fs_type = { .name = "rootfs", - .get_sb = rootfs_get_sb, + .mount = rootfs_mount, .kill_sb = kill_litter_super, }; @@ -63,19 +65,12 @@ diff -ruw linux-2.6.30.orig/fs/ramfs/inode.c linux-2.6.30/fs/ramfs/inode.c -{ - return register_filesystem(&ramfs_fs_type); -} -- --static void __exit exit_ramfs_fs(void) --{ -- unregister_filesystem(&ramfs_fs_type); --} -- -module_init(init_ramfs_fs) --module_exit(exit_ramfs_fs) - int __init init_rootfs(void) { int err; -@@ -316,5 +305,19 @@ +@@ -287,3 +283,12 @@ return err; } @@ -83,18 +78,11 @@ diff -ruw linux-2.6.30.orig/fs/ramfs/inode.c linux-2.6.30/fs/ramfs/inode.c + +static int __init init_ramfs_fs(void) +{ -+ return register_filesystem(&ramfs_fs_type); ++ return register_filesystem(&ramfs_fs_type); +} ++module_init(init_ramfs_fs) + -+static void __exit exit_ramfs_fs(void) -+{ -+ unregister_filesystem(&ramfs_fs_type); -+} + -+module_init(init_ramfs_fs) -+module_exit(exit_ramfs_fs) - - MODULE_LICENSE("GPL"); diff -ruw linux-2.6.30.orig/mm/shmem.c linux-2.6.30/mm/shmem.c --- linux-2.6.30.orig/mm/shmem.c 2009-02-12 17:51:15.000000000 +0000 +++ linux-2.6.30/mm/shmem.c 2009-02-13 11:42:02.000000000 +0000 @@ -109,7 +97,7 @@ diff -ruw linux-2.6.30.orig/mm/shmem.c linux-2.6.30/mm/shmem.c static unsigned long shmem_default_max_inodes(void) @@ -2369,6 +2369,10 @@ - static int init_inodecache(void) + static int shmem_init_inodecache(void) { +#ifdef CONFIG_TMPFS_ROOT + if (shmem_inode_cachep) @@ -123,21 +111,21 @@ diff -ruw linux-2.6.30.orig/mm/shmem.c linux-2.6.30/mm/shmem.c EXPORT_SYMBOL_GPL(shmem_file_setup); +#ifdef CONFIG_TMPFS_ROOT -+static int rootfs_get_sb(struct file_system_type *fs_type, -+ int flags, const char *dev_name, void *data, struct vfsmount *mnt) -+{ -+ return get_sb_nodev(fs_type, flags, data, shmem_fill_super, mnt); -+} ++ ++ ++ ++ ++ + +static struct file_system_type rootfs_fs_type = { + .name = "rootfs", -+ .get_sb = rootfs_get_sb, ++ .mount = shmem_mount, + .kill_sb = kill_litter_super, +}; + +int __init init_rootfs(void) +{ -+ if (init_inodecache()) ++ if (shmem_init_inodecache()) + panic("Can't initialize shm inode cache"); + return register_filesystem(&rootfs_fs_type); +}