pid.c (c1144d29f405ce1f4e6ede6482beb3d0d09750c6) | pid.c (7a36094d61bfe9843de5484ff0140227983ac5d5) |
---|---|
1/* 2 * Generic pidhash and scalable, time-bounded PID allocator 3 * 4 * (C) 2002-2003 Nadia Yvette Chambers, IBM 5 * (C) 2004 Nadia Yvette Chambers, Oracle 6 * (C) 2002-2004 Ingo Molnar, Red Hat 7 * 8 * pid-structures are backing objects for tasks sharing a given ID to chain --- 407 unchanged lines hidden (view full) --- 416 struct pid_namespace *ns) 417{ 418 pid_t nr = 0; 419 420 rcu_read_lock(); 421 if (!ns) 422 ns = task_active_pid_ns(current); 423 if (likely(pid_alive(task))) { | 1/* 2 * Generic pidhash and scalable, time-bounded PID allocator 3 * 4 * (C) 2002-2003 Nadia Yvette Chambers, IBM 5 * (C) 2004 Nadia Yvette Chambers, Oracle 6 * (C) 2002-2004 Ingo Molnar, Red Hat 7 * 8 * pid-structures are backing objects for tasks sharing a given ID to chain --- 407 unchanged lines hidden (view full) --- 416 struct pid_namespace *ns) 417{ 418 pid_t nr = 0; 419 420 rcu_read_lock(); 421 if (!ns) 422 ns = task_active_pid_ns(current); 423 if (likely(pid_alive(task))) { |
424 if (type != PIDTYPE_PID) { 425 if (type == __PIDTYPE_TGID) 426 type = PIDTYPE_PID; 427 428 task = task->group_leader; 429 } 430 nr = pid_nr_ns(rcu_dereference(task->pids[type].pid), ns); | 424 struct pid *pid; 425 if (type == PIDTYPE_PID) 426 pid = task_pid(task); 427 else if (type == __PIDTYPE_TGID) 428 pid = task_tgid(task); 429 else 430 pid = rcu_dereference(task->group_leader->pids[type].pid); 431 nr = pid_nr_ns(pid, ns); |
431 } 432 rcu_read_unlock(); 433 434 return nr; 435} 436EXPORT_SYMBOL(__task_pid_nr_ns); 437 438struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) --- 32 unchanged lines hidden --- | 432 } 433 rcu_read_unlock(); 434 435 return nr; 436} 437EXPORT_SYMBOL(__task_pid_nr_ns); 438 439struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) --- 32 unchanged lines hidden --- |