add 2.6.32 patches to use ext4 for ext2/3
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@24082 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
a75d08e09d
commit
fc778afbd3
|
@ -0,0 +1,123 @@
|
||||||
|
From 24b584240a0006ea7436cd35f5e8983eb76f1e6f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Theodore Ts'o <tytso@mit.edu>
|
||||||
|
Date: Mon, 7 Dec 2009 14:08:51 -0500
|
||||||
|
Subject: [PATCH] ext4: Use ext4 file system driver for ext2/ext3 file system mounts
|
||||||
|
|
||||||
|
Add a new config option, CONFIG_EXT4_USE_FOR_EXT23 which if enabled,
|
||||||
|
will cause ext4 to be used for either ext2 or ext3 file system mounts
|
||||||
|
when ext2 or ext3 is not enabled in the configuration.
|
||||||
|
|
||||||
|
This allows minimalist kernel fanatics to drop to file system drivers
|
||||||
|
from their compiled kernel with out losing functionality.
|
||||||
|
|
||||||
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
||||||
|
---
|
||||||
|
fs/ext4/Kconfig | 10 +++++++++
|
||||||
|
fs/ext4/super.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
2 files changed, 68 insertions(+), 0 deletions(-)
|
||||||
|
|
||||||
|
--- a/fs/ext4/Kconfig
|
||||||
|
+++ b/fs/ext4/Kconfig
|
||||||
|
@@ -26,6 +26,16 @@ config EXT4_FS
|
||||||
|
|
||||||
|
If unsure, say N.
|
||||||
|
|
||||||
|
+config EXT4_USE_FOR_EXT23
|
||||||
|
+ bool "Use ext4 for ext2/ext3 file systems"
|
||||||
|
+ depends on !EXT3_FS || !EXT2_FS
|
||||||
|
+ default y
|
||||||
|
+ help
|
||||||
|
+ Allow the ext4 file system driver code to be used for ext2 or
|
||||||
|
+ ext3 file system mounts. This allows users to reduce their
|
||||||
|
+ compiled kernel size by using one file system driver for
|
||||||
|
+ ext2, ext3, and ext4 file systems.
|
||||||
|
+
|
||||||
|
config EXT4_FS_XATTR
|
||||||
|
bool "Ext4 extended attributes"
|
||||||
|
depends on EXT4_FS
|
||||||
|
--- a/fs/ext4/super.c
|
||||||
|
+++ b/fs/ext4/super.c
|
||||||
|
@@ -3989,6 +3989,58 @@ static int ext4_get_sb(struct file_syste
|
||||||
|
return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if !defined(CONTIG_EXT2_FS) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
+static struct file_system_type ext2_fs_type = {
|
||||||
|
+ .owner = THIS_MODULE,
|
||||||
|
+ .name = "ext2",
|
||||||
|
+ .get_sb = ext4_get_sb,
|
||||||
|
+ .kill_sb = kill_block_super,
|
||||||
|
+ .fs_flags = FS_REQUIRES_DEV,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static inline void register_as_ext2(void)
|
||||||
|
+{
|
||||||
|
+ int err = register_filesystem(&ext2_fs_type);
|
||||||
|
+ if (err)
|
||||||
|
+ printk(KERN_WARNING
|
||||||
|
+ "EXT4-fs: Unable to register as ext2 (%d)\n", err);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static inline void unregister_as_ext2(void)
|
||||||
|
+{
|
||||||
|
+ unregister_filesystem(&ext2_fs_type);
|
||||||
|
+}
|
||||||
|
+#else
|
||||||
|
+static inline void register_as_ext2(void) { }
|
||||||
|
+static inline void unregister_as_ext2(void) { }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#if !defined(CONTIG_EXT3_FS) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
+static struct file_system_type ext3_fs_type = {
|
||||||
|
+ .owner = THIS_MODULE,
|
||||||
|
+ .name = "ext3",
|
||||||
|
+ .get_sb = ext4_get_sb,
|
||||||
|
+ .kill_sb = kill_block_super,
|
||||||
|
+ .fs_flags = FS_REQUIRES_DEV,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static inline void register_as_ext3(void)
|
||||||
|
+{
|
||||||
|
+ int err = register_filesystem(&ext3_fs_type);
|
||||||
|
+ if (err)
|
||||||
|
+ printk(KERN_WARNING
|
||||||
|
+ "EXT4-fs: Unable to register as ext3 (%d)\n", err);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static inline void unregister_as_ext3(void)
|
||||||
|
+{
|
||||||
|
+ unregister_filesystem(&ext3_fs_type);
|
||||||
|
+}
|
||||||
|
+#else
|
||||||
|
+static inline void register_as_ext3(void) { }
|
||||||
|
+static inline void unregister_as_ext3(void) { }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
static struct file_system_type ext4_fs_type = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "ext4",
|
||||||
|
@@ -4018,11 +4070,15 @@ static int __init init_ext4_fs(void)
|
||||||
|
err = init_inodecache();
|
||||||
|
if (err)
|
||||||
|
goto out1;
|
||||||
|
+ register_as_ext2();
|
||||||
|
+ register_as_ext3();
|
||||||
|
err = register_filesystem(&ext4_fs_type);
|
||||||
|
if (err)
|
||||||
|
goto out;
|
||||||
|
return 0;
|
||||||
|
out:
|
||||||
|
+ unregister_as_ext2();
|
||||||
|
+ unregister_as_ext3();
|
||||||
|
destroy_inodecache();
|
||||||
|
out1:
|
||||||
|
exit_ext4_xattr();
|
||||||
|
@@ -4038,6 +4094,8 @@ out4:
|
||||||
|
|
||||||
|
static void __exit exit_ext4_fs(void)
|
||||||
|
{
|
||||||
|
+ unregister_as_ext2();
|
||||||
|
+ unregister_as_ext3();
|
||||||
|
unregister_filesystem(&ext4_fs_type);
|
||||||
|
destroy_inodecache();
|
||||||
|
exit_ext4_xattr();
|
|
@ -0,0 +1,46 @@
|
||||||
|
From a214238d3bb03723f820b0a398928d8e1637c987 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Theodore Ts'o <tytso@mit.edu>
|
||||||
|
Date: Wed, 9 Dec 2009 21:09:58 -0500
|
||||||
|
Subject: [PATCH] ext4: Do not override ext2 or ext3 if built they are built as modules
|
||||||
|
|
||||||
|
The CONFIG_EXT4_USE_FOR_EXT23 option must not try to take over the
|
||||||
|
ext2 or ext3 file systems if the those file system drivers are
|
||||||
|
configured to be built as mdoules.
|
||||||
|
|
||||||
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
||||||
|
---
|
||||||
|
fs/ext4/Kconfig | 2 +-
|
||||||
|
fs/ext4/super.c | 4 ++--
|
||||||
|
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/fs/ext4/Kconfig
|
||||||
|
+++ b/fs/ext4/Kconfig
|
||||||
|
@@ -28,7 +28,7 @@ config EXT4_FS
|
||||||
|
|
||||||
|
config EXT4_USE_FOR_EXT23
|
||||||
|
bool "Use ext4 for ext2/ext3 file systems"
|
||||||
|
- depends on !EXT3_FS || !EXT2_FS
|
||||||
|
+ depends on EXT3_FS=n || EXT2_FS=n
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
Allow the ext4 file system driver code to be used for ext2 or
|
||||||
|
--- a/fs/ext4/super.c
|
||||||
|
+++ b/fs/ext4/super.c
|
||||||
|
@@ -3989,7 +3989,7 @@ static int ext4_get_sb(struct file_syste
|
||||||
|
return get_sb_bdev(fs_type, flags, dev_name, data, ext4_fill_super,mnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
-#if !defined(CONTIG_EXT2_FS) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
+#if !defined(CONTIG_EXT2_FS) && !defined(CONFIG_EXT2_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
static struct file_system_type ext2_fs_type = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "ext2",
|
||||||
|
@@ -4015,7 +4015,7 @@ static inline void register_as_ext2(void
|
||||||
|
static inline void unregister_as_ext2(void) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if !defined(CONTIG_EXT3_FS) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
+#if !defined(CONTIG_EXT3_FS) && !defined(CONFIG_EXT3_FS_MODULE) && defined(CONFIG_EXT4_USE_FOR_EXT23)
|
||||||
|
static struct file_system_type ext3_fs_type = {
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
.name = "ext3",
|
|
@ -0,0 +1,33 @@
|
||||||
|
From 51b7e3c9fbe7d22d4e355101e9a73b44fc5c9feb Mon Sep 17 00:00:00 2001
|
||||||
|
From: Theodore Ts'o <tytso@mit.edu>
|
||||||
|
Date: Mon, 21 Dec 2009 10:56:09 -0500
|
||||||
|
Subject: [PATCH] ext4: add module aliases for ext2 and ext3
|
||||||
|
|
||||||
|
Add module aliases for ext2 and ext3 when CONFIG_EXT4_USE_FOR_EXT23 is
|
||||||
|
set. This makes the existing user-space stuff like mkinitrd working
|
||||||
|
as is.
|
||||||
|
|
||||||
|
Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||||
|
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
|
||||||
|
---
|
||||||
|
fs/ext4/super.c | 2 ++
|
||||||
|
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||||
|
|
||||||
|
--- a/fs/ext4/super.c
|
||||||
|
+++ b/fs/ext4/super.c
|
||||||
|
@@ -4010,6 +4010,7 @@ static inline void unregister_as_ext2(vo
|
||||||
|
{
|
||||||
|
unregister_filesystem(&ext2_fs_type);
|
||||||
|
}
|
||||||
|
+MODULE_ALIAS("ext2");
|
||||||
|
#else
|
||||||
|
static inline void register_as_ext2(void) { }
|
||||||
|
static inline void unregister_as_ext2(void) { }
|
||||||
|
@@ -4036,6 +4037,7 @@ static inline void unregister_as_ext3(vo
|
||||||
|
{
|
||||||
|
unregister_filesystem(&ext3_fs_type);
|
||||||
|
}
|
||||||
|
+MODULE_ALIAS("ext3");
|
||||||
|
#else
|
||||||
|
static inline void register_as_ext3(void) { }
|
||||||
|
static inline void unregister_as_ext3(void) { }
|
Loading…
Reference in New Issue