~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/proc_ns.h

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * procfs namespace bits
  3  */
  4 #ifndef _LINUX_PROC_NS_H
  5 #define _LINUX_PROC_NS_H
  6 
  7 struct pid_namespace;
  8 struct nsproxy;
  9 
 10 struct proc_ns_operations {
 11         const char *name;
 12         int type;
 13         void *(*get)(struct task_struct *task);
 14         void (*put)(void *ns);
 15         int (*install)(struct nsproxy *nsproxy, void *ns);
 16         unsigned int (*inum)(void *ns);
 17 };
 18 
 19 struct proc_ns {
 20         void *ns;
 21         const struct proc_ns_operations *ns_ops;
 22 };
 23 
 24 extern const struct proc_ns_operations netns_operations;
 25 extern const struct proc_ns_operations utsns_operations;
 26 extern const struct proc_ns_operations ipcns_operations;
 27 extern const struct proc_ns_operations pidns_operations;
 28 extern const struct proc_ns_operations userns_operations;
 29 extern const struct proc_ns_operations mntns_operations;
 30 
 31 /*
 32  * We always define these enumerators
 33  */
 34 enum {
 35         PROC_ROOT_INO           = 1,
 36         PROC_IPC_INIT_INO       = 0xEFFFFFFFU,
 37         PROC_UTS_INIT_INO       = 0xEFFFFFFEU,
 38         PROC_USER_INIT_INO      = 0xEFFFFFFDU,
 39         PROC_PID_INIT_INO       = 0xEFFFFFFCU,
 40 };
 41 
 42 #ifdef CONFIG_PROC_FS
 43 
 44 extern int pid_ns_prepare_proc(struct pid_namespace *ns);
 45 extern void pid_ns_release_proc(struct pid_namespace *ns);
 46 extern struct file *proc_ns_fget(int fd);
 47 extern struct proc_ns *get_proc_ns(struct inode *);
 48 extern int proc_alloc_inum(unsigned int *pino);
 49 extern void proc_free_inum(unsigned int inum);
 50 extern bool proc_ns_inode(struct inode *inode);
 51 
 52 #else /* CONFIG_PROC_FS */
 53 
 54 static inline int pid_ns_prepare_proc(struct pid_namespace *ns) { return 0; }
 55 static inline void pid_ns_release_proc(struct pid_namespace *ns) {}
 56 
 57 static inline struct file *proc_ns_fget(int fd)
 58 {
 59         return ERR_PTR(-EINVAL);
 60 }
 61 
 62 static inline struct proc_ns *get_proc_ns(struct inode *inode) { return NULL; }
 63 
 64 static inline int proc_alloc_inum(unsigned int *inum)
 65 {
 66         *inum = 1;
 67         return 0;
 68 }
 69 static inline void proc_free_inum(unsigned int inum) {}
 70 static inline bool proc_ns_inode(struct inode *inode) { return false; }
 71 
 72 #endif /* CONFIG_PROC_FS */
 73 
 74 #endif /* _LINUX_PROC_NS_H */
 75 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp