diff options
author | Zefan Li <lizefan@huawei.com> | 2014-09-18 04:03:15 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2014-09-18 13:27:23 -0400 |
commit | 006f4ac49742b5f70ef7e39176fd42a500144ccc (patch) | |
tree | 976006e7b7a5a0df635538fe51348e4648d9df8c /fs/proc/base.c | |
parent | 971ff49355387fef41d1327434d8939721a4eb35 (diff) |
cgroup: simplify proc_cgroup_show()
Use the ONE macro instead of REG, and we can simplify proc_cgroup_show().
Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index baf852b648ad..6b96892015ec 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -376,21 +376,6 @@ static const struct file_operations proc_lstats_operations = { | |||
376 | 376 | ||
377 | #endif | 377 | #endif |
378 | 378 | ||
379 | #ifdef CONFIG_CGROUPS | ||
380 | static int cgroup_open(struct inode *inode, struct file *file) | ||
381 | { | ||
382 | struct pid *pid = PROC_I(inode)->pid; | ||
383 | return single_open(file, proc_cgroup_show, pid); | ||
384 | } | ||
385 | |||
386 | static const struct file_operations proc_cgroup_operations = { | ||
387 | .open = cgroup_open, | ||
388 | .read = seq_read, | ||
389 | .llseek = seq_lseek, | ||
390 | .release = single_release, | ||
391 | }; | ||
392 | #endif | ||
393 | |||
394 | #ifdef CONFIG_PROC_PID_CPUSET | 379 | #ifdef CONFIG_PROC_PID_CPUSET |
395 | 380 | ||
396 | static int cpuset_open(struct inode *inode, struct file *file) | 381 | static int cpuset_open(struct inode *inode, struct file *file) |
@@ -2576,7 +2561,7 @@ static const struct pid_entry tgid_base_stuff[] = { | |||
2576 | REG("cpuset", S_IRUGO, proc_cpuset_operations), | 2561 | REG("cpuset", S_IRUGO, proc_cpuset_operations), |
2577 | #endif | 2562 | #endif |
2578 | #ifdef CONFIG_CGROUPS | 2563 | #ifdef CONFIG_CGROUPS |
2579 | REG("cgroup", S_IRUGO, proc_cgroup_operations), | 2564 | ONE("cgroup", S_IRUGO, proc_cgroup_show), |
2580 | #endif | 2565 | #endif |
2581 | ONE("oom_score", S_IRUGO, proc_oom_score), | 2566 | ONE("oom_score", S_IRUGO, proc_oom_score), |
2582 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations), | 2567 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations), |
@@ -2922,7 +2907,7 @@ static const struct pid_entry tid_base_stuff[] = { | |||
2922 | REG("cpuset", S_IRUGO, proc_cpuset_operations), | 2907 | REG("cpuset", S_IRUGO, proc_cpuset_operations), |
2923 | #endif | 2908 | #endif |
2924 | #ifdef CONFIG_CGROUPS | 2909 | #ifdef CONFIG_CGROUPS |
2925 | REG("cgroup", S_IRUGO, proc_cgroup_operations), | 2910 | ONE("cgroup", S_IRUGO, proc_cgroup_show), |
2926 | #endif | 2911 | #endif |
2927 | ONE("oom_score", S_IRUGO, proc_oom_score), | 2912 | ONE("oom_score", S_IRUGO, proc_oom_score), |
2928 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations), | 2913 | REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adj_operations), |