move lnames from fs/proc/base.c to include/linux/resource.h
RFC PATCH 2/3 move lnames from fs/proc/base.c to include/linux/resource.h
Signed-off-by Hirofumi Nakagawa <[email protected]>
--- fs/proc/base.c | 24 ------------------------ include/linux/resource.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-)
fs/proc/base.c +0 -24
@@ -431,30 +431,6 @@ static int proc_oom_score(struct task_streturn sprintf (buffer,"%lu\n" , points); } -struct limit_names { -char *name; -char *unit; -}; - -static const struct limit_names lnames[RLIM_NLIMITS ] = { - [RLIMIT_CPU ] = {"Max cpu time" ,"ms" }, - [RLIMIT_FSIZE ] = {"Max file size" ,"bytes" }, - [RLIMIT_DATA ] = {"Max data size" ,"bytes" }, - [RLIMIT_STACK ] = {"Max stack size" ,"bytes" }, - [RLIMIT_CORE ] = {"Max core file size" ,"bytes" }, - [RLIMIT_RSS ] = {"Max resident set" ,"bytes" }, - [RLIMIT_NPROC ] = {"Max processes" ,"processes" }, - [RLIMIT_NOFILE ] = {"Max open files" ,"files" }, - [RLIMIT_MEMLOCK ] = {"Max locked memory" ,"bytes" }, - [RLIMIT_AS ] = {"Max address space" ,"bytes" }, - [RLIMIT_LOCKS ] = {"Max file locks" ,"locks" }, - [RLIMIT_SIGPENDING ] = {"Max pending signals" ,"signals" }, - [RLIMIT_MSGQUEUE ] = {"Max msgqueue size" ,"bytes" }, - [RLIMIT_NICE ] = {"Max nice priority" ,NULL }, - [RLIMIT_RTPRIO ] = {"Max realtime priority" ,NULL }, - [RLIMIT_RTTIME ] = {"Max realtime timeout" ,"us" }, -}; -/* Display limits for a process */ static int proc_pid_limits (struct task_struct *task,char *buffer) {
include/linux/resource.h +24 -0
@@ -70,6 +70,30 @@ struct rlimit {*/ #include <asm/resource.h> +struct limit_names { +char *name; +char *unit; +}; + +static const struct limit_names lnames[RLIM_NLIMITS ] = { + [RLIMIT_CPU ] = {"Max cpu time" ,"ms" }, + [RLIMIT_FSIZE ] = {"Max file size" ,"bytes" }, + [RLIMIT_DATA ] = {"Max data size" ,"bytes" }, + [RLIMIT_STACK ] = {"Max stack size" ,"bytes" }, + [RLIMIT_CORE ] = {"Max core file size" ,"bytes" }, + [RLIMIT_RSS ] = {"Max resident set" ,"bytes" }, + [RLIMIT_NPROC ] = {"Max processes" ,"processes" }, + [RLIMIT_NOFILE ] = {"Max open files" ,"files" }, + [RLIMIT_MEMLOCK ] = {"Max locked memory" ,"bytes" }, + [RLIMIT_AS ] = {"Max address space" ,"bytes" }, + [RLIMIT_LOCKS ] = {"Max file locks" ,"locks" }, + [RLIMIT_SIGPENDING ] = {"Max pending signals" ,"signals" }, + [RLIMIT_MSGQUEUE ] = {"Max msgqueue size" ,"bytes" }, + [RLIMIT_NICE ] = {"Max nice priority" ,NULL }, + [RLIMIT_RTPRIO ] = {"Max realtime priority" ,NULL }, + [RLIMIT_RTTIME ] = {"Max realtime timeout" ,"us" }, +}; +int getrusage (struct task_struct *p,int who,struct rusage __user *ru);#endif