Commit efb1a57d authored by Alexey Dobriyan's avatar Alexey Dobriyan Committed by Linus Torvalds

fs/proc: use __ro_after_init

/proc/self inode numbers, value of proc_inode_cache and st_nlink of
/proc/$TGID are fixed constants.

Link: http://lkml.kernel.org/r/20180103184707.GA31849@avx2Signed-off-by: default avatarAlexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 53f63345
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/tracehook.h> #include <linux/tracehook.h>
#include <linux/printk.h> #include <linux/printk.h>
#include <linux/cache.h>
#include <linux/cgroup.h> #include <linux/cgroup.h>
#include <linux/cpuset.h> #include <linux/cpuset.h>
#include <linux/audit.h> #include <linux/audit.h>
...@@ -112,8 +113,8 @@ ...@@ -112,8 +113,8 @@
* in /proc for a task before it execs a suid executable. * in /proc for a task before it execs a suid executable.
*/ */
static u8 nlink_tid; static u8 nlink_tid __ro_after_init;
static u8 nlink_tgid; static u8 nlink_tgid __ro_after_init;
struct pid_entry { struct pid_entry {
const char *name; const char *name;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1991, 1992 Linus Torvalds
*/ */
#include <linux/cache.h>
#include <linux/time.h> #include <linux/time.h>
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -52,7 +53,7 @@ static void proc_evict_inode(struct inode *inode) ...@@ -52,7 +53,7 @@ static void proc_evict_inode(struct inode *inode)
} }
} }
static struct kmem_cache * proc_inode_cachep; static struct kmem_cache *proc_inode_cachep __ro_after_init;
static struct inode *proc_alloc_inode(struct super_block *sb) static struct inode *proc_alloc_inode(struct super_block *sb)
{ {
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/cache.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pid_namespace.h> #include <linux/pid_namespace.h>
...@@ -30,7 +31,7 @@ static const struct inode_operations proc_self_inode_operations = { ...@@ -30,7 +31,7 @@ static const struct inode_operations proc_self_inode_operations = {
.get_link = proc_self_get_link, .get_link = proc_self_get_link,
}; };
static unsigned self_inum; static unsigned self_inum __ro_after_init;
int proc_setup_self(struct super_block *s) int proc_setup_self(struct super_block *s)
{ {
......
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/cache.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/pid_namespace.h> #include <linux/pid_namespace.h>
...@@ -30,7 +31,7 @@ static const struct inode_operations proc_thread_self_inode_operations = { ...@@ -30,7 +31,7 @@ static const struct inode_operations proc_thread_self_inode_operations = {
.get_link = proc_thread_self_get_link, .get_link = proc_thread_self_get_link,
}; };
static unsigned thread_self_inum; static unsigned thread_self_inum __ro_after_init;
int proc_setup_thread_self(struct super_block *s) int proc_setup_thread_self(struct super_block *s)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment