diff options
-rw-r--r-- | fs/proc/base.c | 31 | ||||
-rw-r--r-- | include/linux/cgroup.h | 2 | ||||
-rw-r--r-- | include/linux/cpuset.h | 3 | ||||
-rw-r--r-- | kernel/cgroup.c | 15 | ||||
-rw-r--r-- | kernel/cpuset.c | 15 |
5 files changed, 35 insertions, 31 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 | ||
408 | static 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 | |||
414 | static 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 | |||
424 | static 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 | |||
430 | static 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 | |||
407 | static int proc_oom_score(struct task_struct *task, char *buffer) | 438 | static 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; |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 900af5964f55..68f2157b71d4 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -42,7 +42,7 @@ extern int cgroupstats_build(struct cgroupstats *stats, | |||
42 | extern int cgroup_load_subsys(struct cgroup_subsys *ss); | 42 | extern int cgroup_load_subsys(struct cgroup_subsys *ss); |
43 | extern void cgroup_unload_subsys(struct cgroup_subsys *ss); | 43 | extern void cgroup_unload_subsys(struct cgroup_subsys *ss); |
44 | 44 | ||
45 | extern const struct file_operations proc_cgroup_operations; | 45 | extern int proc_cgroup_show(struct seq_file *, void *); |
46 | 46 | ||
47 | /* Define the enumeration of all builtin cgroup subsystems */ | 47 | /* Define the enumeration of all builtin cgroup subsystems */ |
48 | #define SUBSYS(_x) _x ## _subsys_id, | 48 | #define SUBSYS(_x) _x ## _subsys_id, |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 8c8a60d29407..22b637c5ecae 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -64,10 +64,9 @@ extern int cpuset_mems_allowed_intersects(const struct task_struct *tsk1, | |||
64 | extern int cpuset_memory_pressure_enabled; | 64 | extern int cpuset_memory_pressure_enabled; |
65 | extern void __cpuset_memory_pressure_bump(void); | 65 | extern void __cpuset_memory_pressure_bump(void); |
66 | 66 | ||
67 | extern const struct file_operations proc_cpuset_operations; | ||
68 | struct seq_file; | ||
69 | extern void cpuset_task_status_allowed(struct seq_file *m, | 67 | extern void cpuset_task_status_allowed(struct seq_file *m, |
70 | struct task_struct *task); | 68 | struct task_struct *task); |
69 | extern int proc_cpuset_show(struct seq_file *, void *); | ||
71 | 70 | ||
72 | extern int cpuset_mem_spread_node(void); | 71 | extern int cpuset_mem_spread_node(void); |
73 | extern int cpuset_slab_spread_node(void); | 72 | extern int cpuset_slab_spread_node(void); |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index a32f9432666c..d5cffe80b469 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4769,7 +4769,7 @@ out: | |||
4769 | */ | 4769 | */ |
4770 | 4770 | ||
4771 | /* TODO: Use a proper seq_file iterator */ | 4771 | /* TODO: Use a proper seq_file iterator */ |
4772 | static int proc_cgroup_show(struct seq_file *m, void *v) | 4772 | int proc_cgroup_show(struct seq_file *m, void *v) |
4773 | { | 4773 | { |
4774 | struct pid *pid; | 4774 | struct pid *pid; |
4775 | struct task_struct *tsk; | 4775 | struct task_struct *tsk; |
@@ -4821,19 +4821,6 @@ out: | |||
4821 | return retval; | 4821 | return retval; |
4822 | } | 4822 | } |
4823 | 4823 | ||
4824 | static int cgroup_open(struct inode *inode, struct file *file) | ||
4825 | { | ||
4826 | struct pid *pid = PROC_I(inode)->pid; | ||
4827 | return single_open(file, proc_cgroup_show, pid); | ||
4828 | } | ||
4829 | |||
4830 | const struct file_operations proc_cgroup_operations = { | ||
4831 | .open = cgroup_open, | ||
4832 | .read = seq_read, | ||
4833 | .llseek = seq_lseek, | ||
4834 | .release = single_release, | ||
4835 | }; | ||
4836 | |||
4837 | /* Display information about each subsystem and each hierarchy */ | 4824 | /* Display information about each subsystem and each hierarchy */ |
4838 | static int proc_cgroupstats_show(struct seq_file *m, void *v) | 4825 | static int proc_cgroupstats_show(struct seq_file *m, void *v) |
4839 | { | 4826 | { |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 4f9dfe43ecbd..1b6f615be587 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -2666,7 +2666,7 @@ void __cpuset_memory_pressure_bump(void) | |||
2666 | * and we take cpuset_mutex, keeping cpuset_attach() from changing it | 2666 | * and we take cpuset_mutex, keeping cpuset_attach() from changing it |
2667 | * anyway. | 2667 | * anyway. |
2668 | */ | 2668 | */ |
2669 | static int proc_cpuset_show(struct seq_file *m, void *unused_v) | 2669 | int proc_cpuset_show(struct seq_file *m, void *unused_v) |
2670 | { | 2670 | { |
2671 | struct pid *pid; | 2671 | struct pid *pid; |
2672 | struct task_struct *tsk; | 2672 | struct task_struct *tsk; |
@@ -2700,19 +2700,6 @@ out_free: | |||
2700 | out: | 2700 | out: |
2701 | return retval; | 2701 | return retval; |
2702 | } | 2702 | } |
2703 | |||
2704 | static int cpuset_open(struct inode *inode, struct file *file) | ||
2705 | { | ||
2706 | struct pid *pid = PROC_I(inode)->pid; | ||
2707 | return single_open(file, proc_cpuset_show, pid); | ||
2708 | } | ||
2709 | |||
2710 | const struct file_operations proc_cpuset_operations = { | ||
2711 | .open = cpuset_open, | ||
2712 | .read = seq_read, | ||
2713 | .llseek = seq_lseek, | ||
2714 | .release = single_release, | ||
2715 | }; | ||
2716 | #endif /* CONFIG_PROC_PID_CPUSET */ | 2703 | #endif /* CONFIG_PROC_PID_CPUSET */ |
2717 | 2704 | ||
2718 | /* Display task mems_allowed in /proc/<pid>/status file. */ | 2705 | /* Display task mems_allowed in /proc/<pid>/status file. */ |