Re: [PATCH 12/16] core: rename setrlimit to do_setrlimit

From: AmÃrico Wang
Date: Fri Nov 20 2009 - 01:10:54 EST


On Wed, Nov 18, 2009 at 10:51 PM, Jiri Slaby <jslaby@xxxxxxxxxx> wrote:
> Rename it so that it makes more sense in the field of syscalls
> (i.e. do_* is used for functions called by syscall wrappers but
> also when called from other paths).
>
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxxxxx>
> Cc: James Morris <jmorris@xxxxxxxxx>
> Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxx>


Sounds good.

Reviewed-by: WANG Cong <xiyou.wangcong@xxxxxxxxx>

> ---
> Âfs/proc/base.c      |  Â2 +-
> Âinclude/linux/resource.h | Â Â2 +-
> Âkernel/sys.c       |  Â4 ++--
> Â3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index b894170..c6589fb 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -576,7 +576,7 @@ static ssize_t limits_write(struct file *file, const char __user *buf,
> Â Â Â Â Â Â Â Âgoto put_task;
> Â Â Â Â}
>
> - Â Â Â ret = setrlimit(task, i, &new_rlimit);
> + Â Â Â ret = do_setrlimit(task, i, &new_rlimit);
> Â Â Â Âif (ret)
> Â Â Â Â Â Â Â Âcount = ret;
>
> diff --git a/include/linux/resource.h b/include/linux/resource.h
> index 4301d67..08beb1a 100644
> --- a/include/linux/resource.h
> +++ b/include/linux/resource.h
> @@ -71,7 +71,7 @@ struct rlimit {
> Â#include <asm/resource.h>
>
> Âint getrusage(struct task_struct *p, int who, struct rusage __user *ru);
> -int setrlimit(struct task_struct *tsk, unsigned int resource,
> +int do_setrlimit(struct task_struct *tsk, unsigned int resource,
> Â Â Â Â Â Â Â Âstruct rlimit *new_rlim);
>
> Â#endif
> diff --git a/kernel/sys.c b/kernel/sys.c
> index 52200d4..4db6ba6 100644
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -1239,7 +1239,7 @@ SYSCALL_DEFINE2(old_getrlimit, unsigned int, resource,
> Â#endif
>
> Â/* make sure you are allowed to change @tsk limits before calling this */
> -int setrlimit(struct task_struct *tsk, unsigned int resource,
> +int do_setrlimit(struct task_struct *tsk, unsigned int resource,
> Â Â Â Â Â Â Â Âstruct rlimit *new_rlim)
> Â{
> Â Â Â Âstruct rlimit *old_rlim;
> @@ -1308,7 +1308,7 @@ SYSCALL_DEFINE2(setrlimit, unsigned int, resource, struct rlimit __user *, rlim)
> Â Â Â Â Â Â Â Âreturn -EINVAL;
> Â Â Â Âif (copy_from_user(&new_rlim, rlim, sizeof(*rlim)))
> Â Â Â Â Â Â Â Âreturn -EFAULT;
> - Â Â Â return setrlimit(current, resource, &new_rlim);
> + Â Â Â return do_setrlimit(current, resource, &new_rlim);
> Â}
>
> Â/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/