Re: [RFC PATCH 5/X] ptrace: mv task_struct->ptraceptrace_task->pt_flags, kill ptrace_link()

From: Oleg Nesterov
Date: Mon May 25 2009 - 12:08:37 EST


On 05/25, Ingo Molnar wrote:
>
> * Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>
> > struct ptrace_task {
> > + unsigned long pt_flags;
> > };
>
> > - return task->ptrace;
> > + return unlikely(task->ptrace_task) ?
> > + task->ptrace_task->pt_flags : 0;
>
> Please no pt_ prefixes. It is abundantly clear from the
> '->ptrace_ctx' portion already that it's about ptrace - the rest
> should be a straightforward minimalistic naming - i.e.
> ->ptrace_ctx->flags.

OK, will rename.

But note that you can't use cscope to find the usage of ->flags. Even
grep is not reliable, unless the code always adds 'ptrace' to the name
of the pointer.

> Also, is the conditional necessary? We should not be calling ptrace
> methods on tasks with no ptrace context.

It is mostly used as is_task_ptraced() actually, that is why ptrace context
can be NULL.

This in turn needs cleanups, will be addressed further.

Oleg.

--
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/