lkml.org 
[lkml]   [2018]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 05/11] pids: Move the pgrp and session pid pointers from task_struct to signal_struct
This is a bit offtopic/cosmetic and we can do this later, just for record
before I forget this...

On 07/10, Eric W. Biederman wrote:
>
> +static struct pid **task_pid_ptr(struct task_struct *task, enum pid_type type)
> +{
> + return (type == PIDTYPE_PID) ?
> + &task->thread_pid :
> + (type == __PIDTYPE_TGID) ?
> + &task->signal->leader_pid :
> + &task->signal->pids[type];
> +}

This new helper is (simplified after you removed __PIDTYPE_TGID/leader_pid) can
have more users: task_pid_type(), init_task_pid(). In fact even (say) task_tgid()
can use it if we export it inline.

And if we make task_pid_ptr() the only user of signal->pids[] array we can shrink
it, signal->pids[0] is not used. Or may be we can simply redefine enum pid_type,
we can define PIDTYPE_PID == -1 or move it at the end, or do something else.

Once again, this is just random/minor thoughts, feel free to ignore.

Oleg.

\
 
 \ /
  Last update: 2018-07-17 14:01    [W:0.139 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site