Skip to content
Snippets Groups Projects
Select Git revision
  • a7d7723ae7c0178d715c06c5621e8fd8014ba92f
  • vme-testing default
  • ci-test
  • master
  • remoteproc
  • am625-sk-ov5640
  • pcal6534-upstreaming
  • lps22df-upstreaming
  • msc-upstreaming
  • imx8mp
  • iio/noa1305
  • vme-next
  • vme-next-4.14-rc4
  • v4.14-rc4
  • v4.14-rc3
  • v4.14-rc2
  • v4.14-rc1
  • v4.13
  • vme-next-4.13-rc7
  • v4.13-rc7
  • v4.13-rc6
  • v4.13-rc5
  • v4.13-rc4
  • v4.13-rc3
  • v4.13-rc2
  • v4.13-rc1
  • v4.12
  • v4.12-rc7
  • v4.12-rc6
  • v4.12-rc5
  • v4.12-rc4
  • v4.12-rc3
32 results

l2cap_core.c

Blame
  • proc_sysctl.c 41.22 KiB
    // SPDX-License-Identifier: GPL-2.0
    /*
     * /proc/sys support
     */
    #include <linux/init.h>
    #include <linux/sysctl.h>
    #include <linux/poll.h>
    #include <linux/proc_fs.h>
    #include <linux/printk.h>
    #include <linux/security.h>
    #include <linux/sched.h>
    #include <linux/cred.h>
    #include <linux/namei.h>
    #include <linux/mm.h>
    #include <linux/module.h>
    #include <linux/bpf-cgroup.h>
    #include "internal.h"
    
    static const struct dentry_operations proc_sys_dentry_operations;
    static const struct file_operations proc_sys_file_operations;
    static const struct inode_operations proc_sys_inode_operations;
    static const struct file_operations proc_sys_dir_file_operations;
    static const struct inode_operations proc_sys_dir_operations;
    
    /* shared constants to be used in various sysctls */
    const int sysctl_vals[] = { 0, 1, INT_MAX };
    EXPORT_SYMBOL(sysctl_vals);
    
    /* Support for permanently empty directories */
    
    struct ctl_table sysctl_mount_point[] = {
    	{ }
    };
    
    static bool is_empty_dir(struct ctl_table_header *head)
    {
    	return head->ctl_table[0].child == sysctl_mount_point;
    }
    
    static void set_empty_dir(struct ctl_dir *dir)
    {
    	dir->header.ctl_table[0].child = sysctl_mount_point;
    }
    
    static void clear_empty_dir(struct ctl_dir *dir)
    
    {
    	dir->header.ctl_table[0].child = NULL;
    }
    
    void proc_sys_poll_notify(struct ctl_table_poll *poll)
    {
    	if (!poll)
    		return;
    
    	atomic_inc(&poll->event);
    	wake_up_interruptible(&poll->wait);
    }
    
    static struct ctl_table root_table[] = {
    	{
    		.procname = "",
    		.mode = S_IFDIR|S_IRUGO|S_IXUGO,
    	},
    	{ }
    };
    static struct ctl_table_root sysctl_table_root = {
    	.default_set.dir.header = {
    		{{.count = 1,
    		  .nreg = 1,