aboutsummaryrefslogtreecommitdiffstats
diff options
authorGreg Kroah-Hartman <gregkh@suse.de>2010-03-16 14:06:49 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-16 14:06:49 -0700
commit36f5953290c210200013be5c128de2d71787ae90 (patch)
tree2ecb08b609029ea260b8ca7607668290ae6195e0
parent108dcbf0cc62fdc5366515b300e52195852b2d20 (diff)
downloadpatches-36f5953290c210200013be5c128de2d71787ae90.tar.gz
devtmpfs to use ramfs if needed patch
-rw-r--r--driver-core/devtmpfs-support-config_tmpfs.patch91
-rw-r--r--series4
2 files changed, 93 insertions, 2 deletions
diff --git a/driver-core/devtmpfs-support-config_tmpfs.patch b/driver-core/devtmpfs-support-config_tmpfs.patch
new file mode 100644
index 00000000000000..df32af5c484025
--- /dev/null
+++ b/driver-core/devtmpfs-support-config_tmpfs.patch
@@ -0,0 +1,91 @@
+From jacmet@sunsite.dk Tue Mar 16 14:05:09 2010
+From: Peter Korsgaard <jacmet@sunsite.dk>
+Date: Tue, 16 Mar 2010 21:55:21 +0100
+Subject: devtmpfs: support !CONFIG_TMPFS
+To: gregkh@suse.de, kay.sievers@vrfy.org, linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org
+Cc: Peter Korsgaard <jacmet@sunsite.dk>
+Message-ID: <1268772921-31908-1-git-send-email-jacmet@sunsite.dk>
+
+
+Make devtmpfs available on (embedded) configurations without SHMEM/TMPFS,
+using ramfs instead.
+
+Saves ~15KB.
+
+Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
+Acked-by: Kay Sievers <kay.sievers@vrfy.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/base/Kconfig | 7 +++++--
+ drivers/base/devtmpfs.c | 5 +++++
+ fs/ramfs/inode.c | 2 +-
+ include/linux/ramfs.h | 2 ++
+ 4 files changed, 13 insertions(+), 3 deletions(-)
+
+--- a/drivers/base/Kconfig
++++ b/drivers/base/Kconfig
+@@ -18,9 +18,9 @@ config UEVENT_HELPER_PATH
+
+ config DEVTMPFS
+ bool "Maintain a devtmpfs filesystem to mount at /dev"
+- depends on HOTPLUG && SHMEM && TMPFS
++ depends on HOTPLUG
+ help
+- This creates a tmpfs filesystem instance early at bootup.
++ This creates a tmpfs/ramfs filesystem instance early at bootup.
+ In this filesystem, the kernel driver core maintains device
+ nodes with their default names and permissions for all
+ registered devices with an assigned major/minor number.
+@@ -33,6 +33,9 @@ config DEVTMPFS
+ functional /dev without any further help. It also allows simple
+ rescue systems, and reliably handles dynamic major/minor numbers.
+
++ Notice: if CONFIG_TMPFS isn't enabled, the simpler ramfs
++ file system will be used instead.
++
+ config DEVTMPFS_MOUNT
+ bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs"
+ depends on DEVTMPFS
+--- a/drivers/base/devtmpfs.c
++++ b/drivers/base/devtmpfs.c
+@@ -20,6 +20,7 @@
+ #include <linux/namei.h>
+ #include <linux/fs.h>
+ #include <linux/shmem_fs.h>
++#include <linux/ramfs.h>
+ #include <linux/cred.h>
+ #include <linux/sched.h>
+ #include <linux/init_task.h>
+@@ -44,7 +45,11 @@ __setup("devtmpfs.mount=", mount_param);
+ static int dev_get_sb(struct file_system_type *fs_type, int flags,
+ const char *dev_name, void *data, struct vfsmount *mnt)
+ {
++#ifdef CONFIG_TMPFS
+ return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt);
++#else
++ return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt);
++#endif
+ }
+
+ static struct file_system_type dev_fs_type = {
+--- a/fs/ramfs/inode.c
++++ b/fs/ramfs/inode.c
+@@ -213,7 +213,7 @@ static int ramfs_parse_options(char *dat
+ return 0;
+ }
+
+-static int ramfs_fill_super(struct super_block * sb, void * data, int silent)
++int ramfs_fill_super(struct super_block *sb, void *data, int silent)
+ {
+ struct ramfs_fs_info *fsi;
+ struct inode *inode = NULL;
+--- a/include/linux/ramfs.h
++++ b/include/linux/ramfs.h
+@@ -20,4 +20,6 @@ extern const struct file_operations ramf
+ extern const struct vm_operations_struct generic_file_vm_ops;
+ extern int __init init_rootfs(void);
+
++int ramfs_fill_super(struct super_block *sb, void *data, int silent);
++
+ #endif
diff --git a/series b/series
index c3f6c00df64771..ab80cc6619964e 100644
--- a/series
+++ b/series
@@ -79,7 +79,7 @@ usb.current/usb-cp210x-remove-double-usb_control_msg-from-cp210x_set_config.patc
usb.current/usb-fix-usb_fill_int_urb-for-superspeed-devices.patch
usb.current/usb-xhci-make-endpoint-interval-debugging-clearer.patch
usb.current/usb-r8a66597-hcd-fix-removed-from-an-attached-hub.patch
-
+usb.current/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch
#################################
@@ -100,6 +100,7 @@ driver-core/driver-core-fix-potential-race-condition-in-drivers-base-dd.c.patch
driver-core/driver-core-don-t-initialize-wakeup-flags.patch
driver-core/driver-core-early-dev_name-support.patch
driver-core/driver-core-module.c-use-kasprintf.patch
+driver-core/devtmpfs-support-config_tmpfs.patch
# will we make it this time???
driver-core/drivers-base-convert-sema.patch
@@ -130,7 +131,6 @@ usb/usb-musb-allow-the-blackfin-vrsel-gpio-to-be-active-low.patch
usb/usb-musb-add-debugfs-support.patch
usb/usb-musb-gadget-support-musb-specific-test-modes.patch
usb/usb-musb-hsdma-use-musb_read-writel.patch
-usb/usb-gadget-multi-cdc_do_config-remove-redundant-check.patch
usb/usb-f_mass_storage-dynamic-buffers-for-better-alignment.patch