OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 2/6] Rename pid_nr function
Re: [PATCH 2/6] Rename pid_nr function [message #19335 is a reply to message #19328] Fri, 13 July 2007 14:09 Go to previous messageGo to previous message
Pavel Emelianov is currently offline  Pavel Emelianov
Messages: 1149
Registered: September 2006
Senior Member
Serge E. Hallyn wrote:
> Quoting Pavel Emelianov (xemul@openvz.org):
>> sukadev@us.ibm.com wrote:
>>> Pavel Emelianov [xemul@openvz.org] wrote:
>>> | sukadev@us.ibm.com wrote:
>>> | > Subject: [PATCH 2/6] Rename pid_nr function 
>>> | > 
>>> | > From: Sukadev Bhattiprolu <sukadev@us.ibm.com>
>>> | > 
>>> | > Rename pid_nr() function to pid_to_nr() which is more descriptive
>>> | > and will hopefully cause less confusion with new structure/functions
>>> | > being added to support multiple pid namespaces.
>>> | 
>>> | Don't we need at least two convertors:
>>> | pid_to_nr_as_it_seen_by_current()
>>> | and
>>> | pid_to_nr_as_it_seen_by_some_other_task()
>>>
>>> Can you give me an example of where you would use this latter
>>> (pid_to_nr_as_it_seen_by_some_other_task()) interface ?
>> Easy. Consider you're observing /proc/<pid>/status file for a task
>> that lives in two namespaces - init and some created. When making 
>> "cat" on this from init namespace you must get the task's pid as it
>> is seen from init namespace, but when making "cat" from the created
>> namespace you must see the pid as it is seen by this namespace. And 
>> so on and so forth.
> 
> But 'current' in that case is the process reading the file, so you do in
> fact want to use pid_to_nr_as_it_seen_by_current().

Well. I see. There's a misleading in names. Better would be called them
pid_nr_as_it_is_seen_by_the_owning_task_when_he_reads_it() %)
and
pid_nr_as_it_is_seen_by_arbitrary_task()

the first one is pid_vnr() the second is pid_nr_ns().

> -serge
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: containers development plans (July 10 version)
Next Topic: Lost JBD fix
Goto Forum:
  


Current Time: Wed Jul 17 06:25:49 GMT 2024

Total time taken to generate the page: 0.02767 seconds