Skip to content
Snippets Groups Projects
Select Git revision
  • 2c9ede55ecec58099b72e4bb8eab719f32f72c31
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

devtmpfs.c

Blame
  • devtmpfs.c 9.19 KiB
    /*
     * devtmpfs - kernel-maintained tmpfs-based /dev
     *
     * Copyright (C) 2009, Kay Sievers <kay.sievers@vrfy.org>
     *
     * During bootup, before any driver core device is registered,
     * devtmpfs, a tmpfs-based filesystem is created. Every driver-core
     * device which requests a device node, will add a node in this
     * filesystem.
     * By default, all devices are named after the the name of the
     * device, owned by root and have a default mode of 0600. Subsystems
     * can overwrite the default setting if needed.
     */
    
    #include <linux/kernel.h>
    #include <linux/syscalls.h>
    #include <linux/mount.h>
    #include <linux/device.h>
    #include <linux/genhd.h>
    #include <linux/namei.h>
    #include <linux/fs.h>
    #include <linux/shmem_fs.h>
    #include <linux/ramfs.h>
    #include <linux/sched.h>
    #include <linux/slab.h>
    #include <linux/kthread.h>
    
    static struct task_struct *thread;
    
    #if defined CONFIG_DEVTMPFS_MOUNT
    static int mount_dev = 1;
    #else
    static int mount_dev;
    #endif
    
    static DEFINE_SPINLOCK(req_lock);
    
    static struct req {
    	struct req *next;
    	struct completion done;
    	int err;
    	const char *name;
    	umode_t mode;	/* 0 => delete */
    	struct device *dev;
    } *requests;
    
    static int __init mount_param(char *str)
    {
    	mount_dev = simple_strtoul(str, NULL, 0);
    	return 1;
    }
    __setup("devtmpfs.mount=", mount_param);
    
    static struct dentry *dev_mount(struct file_system_type *fs_type, int flags,
    		      const char *dev_name, void *data)
    {
    #ifdef CONFIG_TMPFS
    	return mount_single(fs_type, flags, data, shmem_fill_super);
    #else
    	return mount_single(fs_type, flags, data, ramfs_fill_super);
    #endif
    }
    
    static struct file_system_type dev_fs_type = {
    	.name = "devtmpfs",
    	.mount = dev_mount,
    	.kill_sb = kill_litter_super,
    };
    
    #ifdef CONFIG_BLOCK