lkml.org 
[lkml]   [2012]   [Jan]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] fs, proc: Introduce /proc/<pid>/task/<tid>/children entry v6
On 01/18, Cyrill Gorcunov wrote:
>
> I suppose it might be something like below. I've updated comment and
> quoted your comment there just I wont forget this next time I'll be
> reading the source. Thanks!

I believe the patrch is correct.

But... Cyrill, I am wondering how much will you hate me if I make
yet another attempt to delay this patch.

> +static int children_seq_open(struct inode *inode, struct file *file)
> +{
> + struct proc_pid_children_iter *iter = NULL;
> + struct task_struct *task = NULL;
> + int ret = 0;
> +
> + task = get_proc_task(inode);
> + if (!task) {
> + ret = -ENOENT;
> + goto err;
> + }

For what??

> + if (!ret) {
> + struct seq_file *m = file->private_data;
> + m->private = iter;
> +
> + iter->pid_start = get_pid(task_pid(task));

This is what we need, right? So can't we remove this "task_struct *task"
and simply do

iter->pid_start = get_ppid(proc_pid(inode));

?

And while this is absolutely cosmetic probably ->parent_pid is
a bit better name, but this is up to you.

Oleg.



\
 
 \ /
  Last update: 2012-01-19 15:19    [W:0.055 / U:2.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site