Re: [PATCH] fs, proc: Introduce /proc/<pid>/task/<tid>/children entry v7
From: Eric W. Biederman
Date: Thu Jan 19 2012 - 18:11:46 EST
Cyrill Gorcunov <gorcunov@xxxxxxxxx> writes:
> On Thu, Jan 19, 2012 at 06:57:00PM +0100, Oleg Nesterov wrote:
>> On 01/19, Cyrill Gorcunov wrote:
>> >
>> > On Thu, Jan 19, 2012 at 07:51:12PM +0400, Cyrill Gorcunov wrote:
>> > > If it's needed I can wrap all this with CONFIG_CHECKPOINT_RESTORE, should I?
>> > >
>> > > ---
>> >
>> > Oleg, if only I'm not missing something obvious you meant handling like below?
>>
>> Yes, but...
>>
>> > +struct proc_pid_children_iter {
>> > + struct pid_namespace *pid_ns;
>> > + struct pid *parent_pid;
>> > +};
>>
>> you forgot to remove this definition.
>>
>
> No, I rather forgot to quilt refresh :)
>
>> > +static int children_seq_show(struct seq_file *seq, void *v)
>> > +{
>> > + struct inode *inode = seq->private;
>> > + unsigned long pid;
>> > +
>> > + pid = (unsigned long)pid_nr_ns(v, inode->i_sb->s_fs_info);
>> > + return seq_printf(seq, " %lu", pid);
>> > +}
>>
>> just noticed... why unsigned long and %lu? afaics pid_t/%d should work
>> without any typecasts.
>>
>
> I'm not sure how important it is, but Andrew mentioned in one of email
> that we might be moving from pid_t from int to long one day (which of
> course will require extreme huge work on checking code where int->long
> transition might cause problems). So I thought why should I wait then?
>
> [ Andrew, am I correct? ]
It is going to take a lot to get to a > 32bit pid value. I would not
worry about it today unless there is some 64bit arch somewhere that defines
pid_t as long.
Eric
--
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/