Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
pid.c File Reference
#include <linux/mm.h>
#include <linux/export.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/rculist.h>
#include <linux/bootmem.h>
#include <linux/hash.h>
#include <linux/pid_namespace.h>
#include <linux/init_task.h>
#include <linux/syscalls.h>

Go to the source code of this file.

Macros

#define pid_hashfn(nr, ns)   hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift)
 
#define RESERVED_PIDS   300
 
#define BITS_PER_PAGE   (PAGE_SIZE*8)
 
#define BITS_PER_PAGE_MASK   (BITS_PER_PAGE-1)
 
#define find_next_offset(map, off)   find_next_zero_bit((map)->page, BITS_PER_PAGE, off)
 

Functions

 EXPORT_SYMBOL_GPL (init_pid_ns)
 
int is_container_init (struct task_struct *tsk)
 
 EXPORT_SYMBOL (is_container_init)
 
int next_pidmap (struct pid_namespace *pid_ns, unsigned int last)
 
void put_pid (struct pid *pid)
 
 EXPORT_SYMBOL_GPL (put_pid)
 
void free_pid (struct pid *pid)
 
struct pidalloc_pid (struct pid_namespace *ns)
 
struct pidfind_pid_ns (int nr, struct pid_namespace *ns)
 
 EXPORT_SYMBOL_GPL (find_pid_ns)
 
struct pidfind_vpid (int nr)
 
 EXPORT_SYMBOL_GPL (find_vpid)
 
void attach_pid (struct task_struct *task, enum pid_type type, struct pid *pid)
 
void detach_pid (struct task_struct *task, enum pid_type type)
 
void change_pid (struct task_struct *task, enum pid_type type, struct pid *pid)
 
void transfer_pid (struct task_struct *old, struct task_struct *new, enum pid_type type)
 
struct task_structpid_task (struct pid *pid, enum pid_type type)
 
 EXPORT_SYMBOL (pid_task)
 
struct task_structfind_task_by_pid_ns (pid_t nr, struct pid_namespace *ns)
 
struct task_structfind_task_by_vpid (pid_t vnr)
 
struct pidget_task_pid (struct task_struct *task, enum pid_type type)
 
 EXPORT_SYMBOL_GPL (get_task_pid)
 
struct task_structget_pid_task (struct pid *pid, enum pid_type type)
 
 EXPORT_SYMBOL_GPL (get_pid_task)
 
struct pidfind_get_pid (pid_t nr)
 
 EXPORT_SYMBOL_GPL (find_get_pid)
 
pid_t pid_nr_ns (struct pid *pid, struct pid_namespace *ns)
 
 EXPORT_SYMBOL_GPL (pid_nr_ns)
 
pid_t pid_vnr (struct pid *pid)
 
 EXPORT_SYMBOL_GPL (pid_vnr)
 
pid_t __task_pid_nr_ns (struct task_struct *task, enum pid_type type, struct pid_namespace *ns)
 
 EXPORT_SYMBOL (__task_pid_nr_ns)
 
pid_t task_tgid_nr_ns (struct task_struct *tsk, struct pid_namespace *ns)
 
 EXPORT_SYMBOL (task_tgid_nr_ns)
 
struct pid_namespacetask_active_pid_ns (struct task_struct *tsk)
 
 EXPORT_SYMBOL_GPL (task_active_pid_ns)
 
struct pidfind_ge_pid (int nr, struct pid_namespace *ns)
 
void __init pidhash_init (void)
 
void __init pidmap_init (void)
 

Variables

struct pid init_struct_pid = INIT_STRUCT_PID
 
int pid_max = PID_MAX_DEFAULT
 
int pid_max_min = RESERVED_PIDS + 1
 
int pid_max_max = PID_MAX_LIMIT
 
struct pid_namespace init_pid_ns
 

Macro Definition Documentation

#define BITS_PER_PAGE   (PAGE_SIZE*8)

Definition at line 53 of file pid.c.

#define BITS_PER_PAGE_MASK   (BITS_PER_PAGE-1)

Definition at line 54 of file pid.c.

#define find_next_offset (   map,
  off 
)    find_next_zero_bit((map)->page, BITS_PER_PAGE, off)

Definition at line 62 of file pid.c.

#define pid_hashfn (   nr,
  ns 
)    hash_long((unsigned long)nr + (unsigned long)ns, pidhash_shift)

Definition at line 40 of file pid.c.

#define RESERVED_PIDS   300

Definition at line 48 of file pid.c.

Function Documentation

pid_t __task_pid_nr_ns ( struct task_struct task,
enum pid_type  type,
struct pid_namespace ns 
)

Definition at line 490 of file pid.c.

struct pid* alloc_pid ( struct pid_namespace ns)
read

Definition at line 282 of file pid.c.

void attach_pid ( struct task_struct task,
enum pid_type  type,
struct pid pid 
)

Definition at line 354 of file pid.c.

void change_pid ( struct task_struct task,
enum pid_type  type,
struct pid pid 
)

Definition at line 389 of file pid.c.

void detach_pid ( struct task_struct task,
enum pid_type  type 
)

Definition at line 384 of file pid.c.

EXPORT_SYMBOL ( is_container_init  )
EXPORT_SYMBOL ( pid_task  )
EXPORT_SYMBOL ( __task_pid_nr_ns  )
EXPORT_SYMBOL ( task_tgid_nr_ns  )
EXPORT_SYMBOL_GPL ( init_pid_ns  )
EXPORT_SYMBOL_GPL ( put_pid  )
EXPORT_SYMBOL_GPL ( find_pid_ns  )
EXPORT_SYMBOL_GPL ( find_vpid  )
EXPORT_SYMBOL_GPL ( get_task_pid  )
EXPORT_SYMBOL_GPL ( get_pid_task  )
EXPORT_SYMBOL_GPL ( find_get_pid  )
EXPORT_SYMBOL_GPL ( pid_nr_ns  )
EXPORT_SYMBOL_GPL ( pid_vnr  )
EXPORT_SYMBOL_GPL ( task_active_pid_ns  )
struct pid* find_ge_pid ( int  nr,
struct pid_namespace ns 
)
read

Definition at line 526 of file pid.c.

struct pid* find_get_pid ( pid_t  nr)
read

Definition at line 458 of file pid.c.

struct pid* find_pid_ns ( int  nr,
struct pid_namespace ns 
)
read

Definition at line 330 of file pid.c.

struct task_struct* find_task_by_pid_ns ( pid_t  nr,
struct pid_namespace ns 
)
read

Definition at line 421 of file pid.c.

struct task_struct* find_task_by_vpid ( pid_t  vnr)
read

Definition at line 429 of file pid.c.

struct pid* find_vpid ( int  nr)
read

Definition at line 345 of file pid.c.

void free_pid ( struct pid pid)

Definition at line 265 of file pid.c.

struct task_struct* get_pid_task ( struct pid pid,
enum pid_type  type 
)
read

Definition at line 446 of file pid.c.

struct pid* get_task_pid ( struct task_struct task,
enum pid_type  type 
)
read

Definition at line 434 of file pid.c.

int is_container_init ( struct task_struct tsk)

Definition at line 84 of file pid.c.

int next_pidmap ( struct pid_namespace pid_ns,
unsigned int  last 
)

Definition at line 222 of file pid.c.

pid_t pid_nr_ns ( struct pid pid,
struct pid_namespace ns 
)

Definition at line 470 of file pid.c.

struct task_struct* pid_task ( struct pid pid,
enum pid_type  type 
)
read

Definition at line 404 of file pid.c.

pid_t pid_vnr ( struct pid pid)

Definition at line 484 of file pid.c.

void __init pidhash_init ( void  )

Definition at line 545 of file pid.c.

void __init pidmap_init ( void  )

Definition at line 559 of file pid.c.

void put_pid ( struct pid pid)

Definition at line 243 of file pid.c.

struct pid_namespace* task_active_pid_ns ( struct task_struct tsk)
read

Definition at line 515 of file pid.c.

pid_t task_tgid_nr_ns ( struct task_struct tsk,
struct pid_namespace ns 
)

Definition at line 509 of file pid.c.

void transfer_pid ( struct task_struct old,
struct task_struct new,
enum pid_type  type 
)

Definition at line 397 of file pid.c.

Variable Documentation

struct pid_namespace init_pid_ns
Initial value:
= {
.kref = {
.refcount = ATOMIC_INIT(2),
},
.pidmap = {
},
.last_pid = 0,
.level = 0,
.child_reaper = &init_task,
}

Definition at line 71 of file pid.c.

struct pid init_struct_pid = INIT_STRUCT_PID

Definition at line 44 of file pid.c.

int pid_max = PID_MAX_DEFAULT

Definition at line 46 of file pid.c.

int pid_max_max = PID_MAX_LIMIT

Definition at line 51 of file pid.c.

int pid_max_min = RESERVED_PIDS + 1

Definition at line 50 of file pid.c.