Re: [PATCH RFC v2] pidns: introduce syscall getvpid

2015-09-25 Thread Chen Fan
On 09/24/2015 09:53 PM, Konstantin Khlebnikov wrote: pid_t getvpid(pid_t pid, int source, int target); This syscall converts pid from source pid-namespace into pid in target pid-namespace. Namespaces are defined by file descriptors pointing to namespace entries in proc (/proc/[pid]/ns/pid). If

Re: [PATCH RFC v2] pidns: introduce syscall getvpid

2015-09-24 Thread Oleg Nesterov
On 09/24, Konstantin Khlebnikov wrote: > > On Thu, Sep 24, 2015 at 5:56 PM, Oleg Nesterov wrote: > > On 09/24, Konstantin Khlebnikov wrote: > >> > >> +SYSCALL_DEFINE3(getvpid, pid_t, pid, int, source, int, target) > >> +{ > >> + struct file *source_file = NULL, *target_file = NULL; > >> +

Re: [PATCH RFC v2] pidns: introduce syscall getvpid

2015-09-24 Thread Konstantin Khlebnikov
On Thu, Sep 24, 2015 at 5:56 PM, Oleg Nesterov wrote: > On 09/24, Konstantin Khlebnikov wrote: >> >> +SYSCALL_DEFINE3(getvpid, pid_t, pid, int, source, int, target) >> +{ >> + struct file *source_file = NULL, *target_file = NULL; >> + struct pid_namespace *source_ns, *target_ns; >> + s

Re: [PATCH RFC v2] pidns: introduce syscall getvpid

2015-09-24 Thread Oleg Nesterov
On 09/24, Konstantin Khlebnikov wrote: > > +SYSCALL_DEFINE3(getvpid, pid_t, pid, int, source, int, target) > +{ > + struct file *source_file = NULL, *target_file = NULL; > + struct pid_namespace *source_ns, *target_ns; > + struct pid *struct_pid; > + struct ns_common *ns; > + pi

[PATCH RFC v2] pidns: introduce syscall getvpid

2015-09-24 Thread Konstantin Khlebnikov
pid_t getvpid(pid_t pid, int source, int target); This syscall converts pid from source pid-namespace into pid in target pid-namespace. Namespaces are defined by file descriptors pointing to namespace entries in proc (/proc/[pid]/ns/pid). If source / target is negative then current pid namespace i