diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/pid.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index 8132a6ddfa10..6eb14841b734 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -376,6 +376,19 @@ struct pid *find_get_pid(pid_t nr) | |||
376 | return pid; | 376 | return pid; |
377 | } | 377 | } |
378 | 378 | ||
379 | pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns) | ||
380 | { | ||
381 | struct upid *upid; | ||
382 | pid_t nr = 0; | ||
383 | |||
384 | if (pid && ns->level <= pid->level) { | ||
385 | upid = &pid->numbers[ns->level]; | ||
386 | if (upid->ns == ns) | ||
387 | nr = upid->nr; | ||
388 | } | ||
389 | return nr; | ||
390 | } | ||
391 | |||
379 | /* | 392 | /* |
380 | * Used by proc to find the first pid that is greater then or equal to nr. | 393 | * Used by proc to find the first pid that is greater then or equal to nr. |
381 | * | 394 | * |