aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 491f2d9f89ac..b796bf90a0b1 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -65,6 +65,7 @@ enum pid_directory_inos {
65 PROC_TGID_STAT, 65 PROC_TGID_STAT,
66 PROC_TGID_STATM, 66 PROC_TGID_STATM,
67 PROC_TGID_MAPS, 67 PROC_TGID_MAPS,
68 PROC_TGID_NUMA_MAPS,
68 PROC_TGID_MOUNTS, 69 PROC_TGID_MOUNTS,
69 PROC_TGID_WCHAN, 70 PROC_TGID_WCHAN,
70#ifdef CONFIG_SCHEDSTATS 71#ifdef CONFIG_SCHEDSTATS
@@ -102,6 +103,7 @@ enum pid_directory_inos {
102 PROC_TID_STAT, 103 PROC_TID_STAT,
103 PROC_TID_STATM, 104 PROC_TID_STATM,
104 PROC_TID_MAPS, 105 PROC_TID_MAPS,
106 PROC_TID_NUMA_MAPS,
105 PROC_TID_MOUNTS, 107 PROC_TID_MOUNTS,
106 PROC_TID_WCHAN, 108 PROC_TID_WCHAN,
107#ifdef CONFIG_SCHEDSTATS 109#ifdef CONFIG_SCHEDSTATS
@@ -144,6 +146,9 @@ static struct pid_entry tgid_base_stuff[] = {
144 E(PROC_TGID_STAT, "stat", S_IFREG|S_IRUGO), 146 E(PROC_TGID_STAT, "stat", S_IFREG|S_IRUGO),
145 E(PROC_TGID_STATM, "statm", S_IFREG|S_IRUGO), 147 E(PROC_TGID_STATM, "statm", S_IFREG|S_IRUGO),
146 E(PROC_TGID_MAPS, "maps", S_IFREG|S_IRUGO), 148 E(PROC_TGID_MAPS, "maps", S_IFREG|S_IRUGO),
149#ifdef CONFIG_NUMA
150 E(PROC_TGID_NUMA_MAPS, "numa_maps", S_IFREG|S_IRUGO),
151#endif
147 E(PROC_TGID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR), 152 E(PROC_TGID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR),
148#ifdef CONFIG_SECCOMP 153#ifdef CONFIG_SECCOMP
149 E(PROC_TGID_SECCOMP, "seccomp", S_IFREG|S_IRUSR|S_IWUSR), 154 E(PROC_TGID_SECCOMP, "seccomp", S_IFREG|S_IRUSR|S_IWUSR),
@@ -180,6 +185,9 @@ static struct pid_entry tid_base_stuff[] = {
180 E(PROC_TID_STAT, "stat", S_IFREG|S_IRUGO), 185 E(PROC_TID_STAT, "stat", S_IFREG|S_IRUGO),
181 E(PROC_TID_STATM, "statm", S_IFREG|S_IRUGO), 186 E(PROC_TID_STATM, "statm", S_IFREG|S_IRUGO),
182 E(PROC_TID_MAPS, "maps", S_IFREG|S_IRUGO), 187 E(PROC_TID_MAPS, "maps", S_IFREG|S_IRUGO),
188#ifdef CONFIG_NUMA
189 E(PROC_TID_NUMA_MAPS, "numa_maps", S_IFREG|S_IRUGO),
190#endif
183 E(PROC_TID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR), 191 E(PROC_TID_MEM, "mem", S_IFREG|S_IRUSR|S_IWUSR),
184#ifdef CONFIG_SECCOMP 192#ifdef CONFIG_SECCOMP
185 E(PROC_TID_SECCOMP, "seccomp", S_IFREG|S_IRUSR|S_IWUSR), 193 E(PROC_TID_SECCOMP, "seccomp", S_IFREG|S_IRUSR|S_IWUSR),
@@ -515,6 +523,27 @@ static struct file_operations proc_maps_operations = {
515 .release = seq_release, 523 .release = seq_release,
516}; 524};
517 525
526#ifdef CONFIG_NUMA
527extern struct seq_operations proc_pid_numa_maps_op;
528static int numa_maps_open(struct inode *inode, struct file *file)
529{
530 struct task_struct *task = proc_task(inode);
531 int ret = seq_open(file, &proc_pid_numa_maps_op);
532 if (!ret) {
533 struct seq_file *m = file->private_data;
534 m->private = task;
535 }
536 return ret;
537}
538
539static struct file_operations proc_numa_maps_operations = {
540 .open = numa_maps_open,
541 .read = seq_read,
542 .llseek = seq_lseek,
543 .release = seq_release,
544};
545#endif
546
518extern struct seq_operations mounts_op; 547extern struct seq_operations mounts_op;
519static int mounts_open(struct inode *inode, struct file *file) 548static int mounts_open(struct inode *inode, struct file *file)
520{ 549{
@@ -1524,6 +1553,12 @@ static struct dentry *proc_pident_lookup(struct inode *dir,
1524 case PROC_TGID_MAPS: 1553 case PROC_TGID_MAPS:
1525 inode->i_fop = &proc_maps_operations; 1554 inode->i_fop = &proc_maps_operations;
1526 break; 1555 break;
1556#ifdef CONFIG_NUMA
1557 case PROC_TID_NUMA_MAPS:
1558 case PROC_TGID_NUMA_MAPS:
1559 inode->i_fop = &proc_numa_maps_operations;
1560 break;
1561#endif
1527 case PROC_TID_MEM: 1562 case PROC_TID_MEM:
1528 case PROC_TGID_MEM: 1563 case PROC_TGID_MEM:
1529 inode->i_op = &proc_mem_inode_operations; 1564 inode->i_op = &proc_mem_inode_operations;