aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index f2637c972160..8281986693be 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -404,6 +404,37 @@ static const struct file_operations proc_lstats_operations = {
404 404
405#endif 405#endif
406 406
407#ifdef CONFIG_CGROUPS
408static int cgroup_open(struct inode *inode, struct file *file)
409{
410 struct pid *pid = PROC_I(inode)->pid;
411 return single_open(file, proc_cgroup_show, pid);
412}
413
414static const struct file_operations proc_cgroup_operations = {
415 .open = cgroup_open,
416 .read = seq_read,
417 .llseek = seq_lseek,
418 .release = single_release,
419};
420#endif
421
422#ifdef CONFIG_PROC_PID_CPUSET
423
424static int cpuset_open(struct inode *inode, struct file *file)
425{
426 struct pid *pid = PROC_I(inode)->pid;
427 return single_open(file, proc_cpuset_show, pid);
428}
429
430static const struct file_operations proc_cpuset_operations = {
431 .open = cpuset_open,
432 .read = seq_read,
433 .llseek = seq_lseek,
434 .release = single_release,
435};
436#endif
437
407static int proc_oom_score(struct task_struct *task, char *buffer) 438static int proc_oom_score(struct task_struct *task, char *buffer)
408{ 439{
409 unsigned long totalpages = totalram_pages + total_swap_pages; 440 unsigned long totalpages = totalram_pages + total_swap_pages;