source: trunk/target/linux/generic/patches-2.6.34/015-devtmpfs_ramfs.patch @ 22407

Last change on this file since 22407 was 22407, checked in by acoul, 7 years ago

generic/patches-2.6.34: Make devtmpfs available on (embedded) configurations without SHMEM/TMPFS,
using ramfs instead. (gone mainline in kernel 2.6.35-r3)

File size: 2.6 KB
  • drivers/base/Kconfig

    From: Peter Korsgaard <>
    Make devtmpfs available on (embedded) configurations without SHMEM/TMPFS,
    using ramfs instead.
    Saves ~15KB.
    Signed-off-by: Peter Korsgaard <>
    Acked-by: Kay Sievers <>
    Signed-off-by: Greg Kroah-Hartman <>
    a b config UEVENT_HELPER_PATH 
    1919config DEVTMPFS 
    2020        bool "Maintain a devtmpfs filesystem to mount at /dev" 
    21         depends on HOTPLUG && SHMEM && TMPFS 
     21        depends on HOTPLUG 
    2222        help 
    23           This creates a tmpfs filesystem instance early at bootup. 
     23          This creates a tmpfs/ramfs filesystem instance early at bootup. 
    2424          In this filesystem, the kernel driver core maintains device 
    2525          nodes with their default names and permissions for all 
    2626          registered devices with an assigned major/minor number. 
    config DEVTMPFS 
    3333          functional /dev without any further help. It also allows simple 
    3434          rescue systems, and reliably handles dynamic major/minor numbers. 
     36          Notice: if CONFIG_TMPFS isn't enabled, the simpler ramfs 
     37          file system will be used instead. 
    3639config DEVTMPFS_MOUNT 
    3740        bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs" 
    3841        depends on DEVTMPFS 
  • drivers/base/devtmpfs.c

    a b  
    2020#include <linux/namei.h> 
    2121#include <linux/fs.h> 
    2222#include <linux/shmem_fs.h> 
     23#include <linux/ramfs.h> 
    2324#include <linux/cred.h> 
    2425#include <linux/sched.h> 
    2526#include <linux/init_task.h> 
    __setup("devtmpfs.mount=", mount_param); 
    4546static int dev_get_sb(struct file_system_type *fs_type, int flags, 
    4647                      const char *dev_name, void *data, struct vfsmount *mnt) 
     49#ifdef CONFIG_TMPFS 
    4850        return get_sb_single(fs_type, flags, data, shmem_fill_super, mnt); 
     52        return get_sb_single(fs_type, flags, data, ramfs_fill_super, mnt); 
    5156static struct file_system_type dev_fs_type = { 
  • fs/ramfs/inode.c

    a b static int ramfs_parse_options(char *data, struct ramfs_mount_opts *opts) 
    214214        return 0; 
    217 static int ramfs_fill_super(struct super_block * sb, void * data, int silent) 
     217int ramfs_fill_super(struct super_block *sb, void *data, int silent) 
    219219        struct ramfs_fs_info *fsi; 
    220220        struct inode *inode = NULL; 
  • include/linux/ramfs.h

    a b extern const struct file_operations ramfs_file_operations; 
    2020extern const struct vm_operations_struct generic_file_vm_ops; 
    2121extern int __init init_rootfs(void); 
     23int ramfs_fill_super(struct super_block *sb, void *data, int silent); 
Note: See TracBrowser for help on using the repository browser.