Lines Matching refs:pid_ns
55 static inline int mk_pid(struct pid_namespace *pid_ns, in mk_pid() argument
58 return (map - pid_ns->pidmap)*BITS_PER_PAGE + off; in mk_pid()
144 static void set_last_pid(struct pid_namespace *pid_ns, int base, int pid) in set_last_pid() argument
150 last_write = cmpxchg(&pid_ns->last_pid, prev, pid); in set_last_pid()
154 static int alloc_pidmap(struct pid_namespace *pid_ns) in alloc_pidmap() argument
156 int i, offset, max_scan, pid, last = pid_ns->last_pid; in alloc_pidmap()
163 map = &pid_ns->pidmap[pid/BITS_PER_PAGE]; in alloc_pidmap()
191 set_last_pid(pid_ns, last, pid); in alloc_pidmap()
197 pid = mk_pid(pid_ns, map, offset); in alloc_pidmap()
202 if (map < &pid_ns->pidmap[(pid_max-1)/BITS_PER_PAGE]) { in alloc_pidmap()
206 map = &pid_ns->pidmap[0]; in alloc_pidmap()
211 pid = mk_pid(pid_ns, map, offset); in alloc_pidmap()
216 int next_pidmap(struct pid_namespace *pid_ns, unsigned int last) in next_pidmap() argument
225 map = &pid_ns->pidmap[(last + 1)/BITS_PER_PAGE]; in next_pidmap()
226 end = &pid_ns->pidmap[PIDMAP_ENTRIES]; in next_pidmap()
232 return mk_pid(pid_ns, map, offset); in next_pidmap()