proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
Move non-public declarations and definitions from linux/proc_fs.h to fs/proc/internal.h. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
		
					parent
					
						
							
								c30480b92c
							
						
					
				
			
			
				commit
				
					
						59d8053f1e
					
				
			
		
					 3 changed files with 233 additions and 221 deletions
				
			
		|  | @ -1,4 +1,4 @@ | ||||||
| /* internal.h: internal procfs definitions
 | /* Internal procfs definitions
 | ||||||
|  * |  * | ||||||
|  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. |  * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. | ||||||
|  * Written by David Howells (dhowells@redhat.com) |  * Written by David Howells (dhowells@redhat.com) | ||||||
|  | @ -9,81 +9,66 @@ | ||||||
|  * 2 of the License, or (at your option) any later version. |  * 2 of the License, or (at your option) any later version. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include <linux/sched.h> |  | ||||||
| #include <linux/proc_fs.h> | #include <linux/proc_fs.h> | ||||||
|  | #include <linux/proc_ns.h> | ||||||
|  | #include <linux/spinlock.h> | ||||||
|  | #include <linux/atomic.h> | ||||||
| #include <linux/binfmts.h> | #include <linux/binfmts.h> | ||||||
|  | 
 | ||||||
| struct ctl_table_header; | struct ctl_table_header; | ||||||
| struct mempolicy; | struct mempolicy; | ||||||
| 
 | 
 | ||||||
| extern struct proc_dir_entry proc_root; | /*
 | ||||||
| extern void proc_self_init(void); |  * This is not completely implemented yet. The idea is to | ||||||
| #ifdef CONFIG_PROC_SYSCTL |  * create an in-memory tree (like the actual /proc filesystem | ||||||
| extern int proc_sys_init(void); |  * tree) of these proc_dir_entries, so that we can dynamically | ||||||
| extern void sysctl_head_put(struct ctl_table_header *head); |  * add new files to /proc. | ||||||
| #else |  * | ||||||
| static inline void proc_sys_init(void) { } |  * The "next" pointer creates a linked list of one /proc directory, | ||||||
| static inline void sysctl_head_put(struct ctl_table_header *head) { } |  * while parent/subdir create the directory structure (every | ||||||
| #endif |  * /proc file has a parent, but "subdir" is NULL for all | ||||||
| #ifdef CONFIG_NET |  * non-directory entries). | ||||||
| extern int proc_net_init(void); |  */ | ||||||
| #else | struct proc_dir_entry { | ||||||
| static inline int proc_net_init(void) { return 0; } | 	unsigned int low_ino; | ||||||
| #endif | 	umode_t mode; | ||||||
| 
 | 	nlink_t nlink; | ||||||
| struct vmalloc_info { | 	kuid_t uid; | ||||||
| 	unsigned long	used; | 	kgid_t gid; | ||||||
| 	unsigned long	largest_chunk; | 	loff_t size; | ||||||
|  | 	const struct inode_operations *proc_iops; | ||||||
|  | 	const struct file_operations *proc_fops; | ||||||
|  | 	struct proc_dir_entry *next, *parent, *subdir; | ||||||
|  | 	void *data; | ||||||
|  | 	atomic_t count;		/* use count */ | ||||||
|  | 	atomic_t in_use;	/* number of callers into module in progress; */ | ||||||
|  | 			/* negative -> it's going away RSN */ | ||||||
|  | 	struct completion *pde_unload_completion; | ||||||
|  | 	struct list_head pde_openers;	/* who did ->open, but not ->release */ | ||||||
|  | 	spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ | ||||||
|  | 	u8 namelen; | ||||||
|  | 	char name[]; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_MMU | union proc_op { | ||||||
| #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) | 	int (*proc_get_link)(struct dentry *, struct path *); | ||||||
| extern void get_vmalloc_info(struct vmalloc_info *vmi); | 	int (*proc_read)(struct task_struct *task, char *page); | ||||||
| #else | 	int (*proc_show)(struct seq_file *m, | ||||||
|  | 		struct pid_namespace *ns, struct pid *pid, | ||||||
|  | 		struct task_struct *task); | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| #define VMALLOC_TOTAL 0UL | struct proc_inode { | ||||||
| #define get_vmalloc_info(vmi)			\ |  | ||||||
| do {						\ |  | ||||||
| 	(vmi)->used = 0;			\ |  | ||||||
| 	(vmi)->largest_chunk = 0;		\ |  | ||||||
| } while(0) |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| extern int proc_tid_stat(struct seq_file *m, struct pid_namespace *ns, |  | ||||||
| 				struct pid *pid, struct task_struct *task); |  | ||||||
| extern int proc_tgid_stat(struct seq_file *m, struct pid_namespace *ns, |  | ||||||
| 				struct pid *pid, struct task_struct *task); |  | ||||||
| extern int proc_pid_status(struct seq_file *m, struct pid_namespace *ns, |  | ||||||
| 				struct pid *pid, struct task_struct *task); |  | ||||||
| extern int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, |  | ||||||
| 				struct pid *pid, struct task_struct *task); |  | ||||||
| extern loff_t mem_lseek(struct file *file, loff_t offset, int orig); |  | ||||||
| 
 |  | ||||||
| extern const struct file_operations proc_tid_children_operations; |  | ||||||
| extern const struct file_operations proc_pid_maps_operations; |  | ||||||
| extern const struct file_operations proc_tid_maps_operations; |  | ||||||
| extern const struct file_operations proc_pid_numa_maps_operations; |  | ||||||
| extern const struct file_operations proc_tid_numa_maps_operations; |  | ||||||
| extern const struct file_operations proc_pid_smaps_operations; |  | ||||||
| extern const struct file_operations proc_tid_smaps_operations; |  | ||||||
| extern const struct file_operations proc_clear_refs_operations; |  | ||||||
| extern const struct file_operations proc_pagemap_operations; |  | ||||||
| extern const struct file_operations proc_net_operations; |  | ||||||
| extern const struct inode_operations proc_net_inode_operations; |  | ||||||
| extern const struct inode_operations proc_pid_link_inode_operations; |  | ||||||
| 
 |  | ||||||
| struct proc_maps_private { |  | ||||||
| 	struct pid *pid; | 	struct pid *pid; | ||||||
| 	struct task_struct *task; | 	int fd; | ||||||
| #ifdef CONFIG_MMU | 	union proc_op op; | ||||||
| 	struct vm_area_struct *tail_vma; | 	struct proc_dir_entry *pde; | ||||||
| #endif | 	struct ctl_table_header *sysctl; | ||||||
| #ifdef CONFIG_NUMA | 	struct ctl_table *sysctl_entry; | ||||||
| 	struct mempolicy *task_mempolicy; | 	struct proc_ns ns; | ||||||
| #endif | 	struct inode vfs_inode; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| void proc_init_inodecache(void); |  | ||||||
| 
 |  | ||||||
| /*
 | /*
 | ||||||
|  * General functions |  * General functions | ||||||
|  */ |  */ | ||||||
|  | @ -149,16 +134,68 @@ out: | ||||||
| 	return ~0U; | 	return ~0U; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | /*
 | ||||||
|  |  * Offset of the first process in the /proc root directory.. | ||||||
|  |  */ | ||||||
|  | #define FIRST_PROCESS_ENTRY 256 | ||||||
|  | 
 | ||||||
|  | /* Worst case buffer size needed for holding an integer. */ | ||||||
|  | #define PROC_NUMBUF 13 | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * array.c | ||||||
|  |  */ | ||||||
|  | extern const struct file_operations proc_tid_children_operations; | ||||||
|  | 
 | ||||||
|  | extern int proc_tid_stat(struct seq_file *, struct pid_namespace *, | ||||||
|  | 			 struct pid *, struct task_struct *); | ||||||
|  | extern int proc_tgid_stat(struct seq_file *, struct pid_namespace *, | ||||||
|  | 			  struct pid *, struct task_struct *); | ||||||
|  | extern int proc_pid_status(struct seq_file *, struct pid_namespace *, | ||||||
|  | 			   struct pid *, struct task_struct *); | ||||||
|  | extern int proc_pid_statm(struct seq_file *, struct pid_namespace *, | ||||||
|  | 			  struct pid *, struct task_struct *); | ||||||
|  | 
 | ||||||
| /*
 | /*
 | ||||||
|  * base.c |  * base.c | ||||||
|  */ |  */ | ||||||
|  | extern const struct dentry_operations pid_dentry_operations; | ||||||
|  | extern int pid_getattr(struct vfsmount *, struct dentry *, struct kstat *); | ||||||
|  | extern int proc_setattr(struct dentry *, struct iattr *); | ||||||
|  | extern struct inode *proc_pid_make_inode(struct super_block *, struct task_struct *); | ||||||
|  | extern int pid_revalidate(struct dentry *, unsigned int); | ||||||
| extern int pid_delete_dentry(const struct dentry *); | extern int pid_delete_dentry(const struct dentry *); | ||||||
|  | extern int proc_pid_readdir(struct file *, void *, filldir_t); | ||||||
|  | extern struct dentry *proc_pid_lookup(struct inode *, struct dentry *, unsigned int); | ||||||
|  | extern loff_t mem_lseek(struct file *, loff_t, int); | ||||||
| 
 | 
 | ||||||
| struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *ino, | /* Lookups */ | ||||||
| 		struct dentry *dentry); | typedef struct dentry *instantiate_t(struct inode *, struct dentry *, | ||||||
| int proc_readdir_de(struct proc_dir_entry *de, struct file *filp, void *dirent, | 				     struct task_struct *, const void *); | ||||||
| 		filldir_t filldir); | extern int proc_fill_cache(struct file *, void *, filldir_t, const char *, int, | ||||||
|  | 			   instantiate_t, struct task_struct *, const void *); | ||||||
| 
 | 
 | ||||||
|  | /*
 | ||||||
|  |  * generic.c | ||||||
|  |  */ | ||||||
|  | extern spinlock_t proc_subdir_lock; | ||||||
|  | 
 | ||||||
|  | extern struct dentry *proc_lookup(struct inode *, struct dentry *, unsigned int); | ||||||
|  | extern struct dentry *proc_lookup_de(struct proc_dir_entry *, struct inode *, | ||||||
|  | 				     struct dentry *); | ||||||
|  | extern int proc_readdir(struct file *, void *, filldir_t); | ||||||
|  | extern int proc_readdir_de(struct proc_dir_entry *, struct file *, void *, filldir_t); | ||||||
|  | 
 | ||||||
|  | static inline struct proc_dir_entry *pde_get(struct proc_dir_entry *pde) | ||||||
|  | { | ||||||
|  | 	atomic_inc(&pde->count); | ||||||
|  | 	return pde; | ||||||
|  | } | ||||||
|  | extern void pde_put(struct proc_dir_entry *); | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * inode.c | ||||||
|  |  */ | ||||||
| struct pde_opener { | struct pde_opener { | ||||||
| 	struct file *file; | 	struct file *file; | ||||||
| 	struct list_head lh; | 	struct list_head lh; | ||||||
|  | @ -166,63 +203,74 @@ struct pde_opener { | ||||||
| 	struct completion *c; | 	struct completion *c; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| void proc_entry_rundown(struct proc_dir_entry *); | extern const struct inode_operations proc_pid_link_inode_operations; | ||||||
| 
 | 
 | ||||||
| extern spinlock_t proc_subdir_lock; | extern void proc_init_inodecache(void); | ||||||
| 
 | extern struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *); | ||||||
| struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, unsigned int); | extern int proc_fill_super(struct super_block *); | ||||||
| int proc_pid_readdir(struct file * filp, void * dirent, filldir_t filldir); | extern void proc_entry_rundown(struct proc_dir_entry *); | ||||||
| unsigned long task_vsize(struct mm_struct *); |  | ||||||
| unsigned long task_statm(struct mm_struct *, |  | ||||||
| 	unsigned long *, unsigned long *, unsigned long *, unsigned long *); |  | ||||||
| void task_mem(struct seq_file *, struct mm_struct *); |  | ||||||
| 
 |  | ||||||
| static inline struct proc_dir_entry *pde_get(struct proc_dir_entry *pde) |  | ||||||
| { |  | ||||||
| 	atomic_inc(&pde->count); |  | ||||||
| 	return pde; |  | ||||||
| } |  | ||||||
| void pde_put(struct proc_dir_entry *pde); |  | ||||||
| 
 |  | ||||||
| int proc_fill_super(struct super_block *); |  | ||||||
| struct inode *proc_get_inode(struct super_block *, struct proc_dir_entry *); |  | ||||||
| int proc_remount(struct super_block *sb, int *flags, char *data); |  | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * These are generic /proc routines that use the internal |  * mmu.c | ||||||
|  * "struct proc_dir_entry" tree to traverse the filesystem. |  | ||||||
|  * |  | ||||||
|  * The /proc root directory has extended versions to take care |  | ||||||
|  * of the /proc/<pid> subdirectories. |  | ||||||
|  */ |  */ | ||||||
| int proc_readdir(struct file *, void *, filldir_t); | struct vmalloc_info { | ||||||
| struct dentry *proc_lookup(struct inode *, struct dentry *, unsigned int); | 	unsigned long	used; | ||||||
|  | 	unsigned long	largest_chunk; | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
|  | #ifdef CONFIG_MMU | ||||||
|  | #define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START) | ||||||
|  | extern void get_vmalloc_info(struct vmalloc_info *); | ||||||
| 
 | 
 | ||||||
| 
 | #else | ||||||
| /* Lookups */ | #define VMALLOC_TOTAL 0UL | ||||||
| typedef struct dentry *instantiate_t(struct inode *, struct dentry *, | static inline void get_vmalloc_info(struct vmalloc_info *vmi) | ||||||
| 				struct task_struct *, const void *); | { | ||||||
| int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir, | 	vmi->used = 0; | ||||||
| 	const char *name, int len, | 	vmi->largest_chunk = 0; | ||||||
| 	instantiate_t instantiate, struct task_struct *task, const void *ptr); | } | ||||||
| int pid_revalidate(struct dentry *dentry, unsigned int flags); | #endif | ||||||
| struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task); |  | ||||||
| extern const struct dentry_operations pid_dentry_operations; |  | ||||||
| int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); |  | ||||||
| int proc_setattr(struct dentry *dentry, struct iattr *attr); |  | ||||||
| 
 |  | ||||||
| extern const struct inode_operations proc_ns_dir_inode_operations; |  | ||||||
| extern const struct file_operations proc_ns_dir_operations; |  | ||||||
| 
 |  | ||||||
| extern int proc_setup_self(struct super_block *); |  | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * proc_devtree.c |  * proc_devtree.c | ||||||
|  */ |  */ | ||||||
| #ifdef CONFIG_PROC_DEVICETREE | #ifdef CONFIG_PROC_DEVICETREE | ||||||
| extern void proc_device_tree_init(void); | extern void proc_device_tree_init(void); | ||||||
| #endif /* CONFIG_PROC_DEVICETREE */ | #endif | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * proc_namespaces.c | ||||||
|  |  */ | ||||||
|  | extern const struct inode_operations proc_ns_dir_inode_operations; | ||||||
|  | extern const struct file_operations proc_ns_dir_operations; | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * proc_net.c | ||||||
|  |  */ | ||||||
|  | extern const struct file_operations proc_net_operations; | ||||||
|  | extern const struct inode_operations proc_net_inode_operations; | ||||||
|  | 
 | ||||||
|  | #ifdef CONFIG_NET | ||||||
|  | extern int proc_net_init(void); | ||||||
|  | #else | ||||||
|  | static inline int proc_net_init(void) { return 0; } | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * proc_self.c | ||||||
|  |  */ | ||||||
|  | extern int proc_setup_self(struct super_block *); | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * proc_sysctl.c | ||||||
|  |  */ | ||||||
|  | #ifdef CONFIG_PROC_SYSCTL | ||||||
|  | extern int proc_sys_init(void); | ||||||
|  | extern void sysctl_head_put(struct ctl_table_header *); | ||||||
|  | #else | ||||||
|  | static inline void proc_sys_init(void) { } | ||||||
|  | static inline void sysctl_head_put(struct ctl_table_header *head) { } | ||||||
|  | #endif | ||||||
| 
 | 
 | ||||||
| /*
 | /*
 | ||||||
|  * proc_tty.c |  * proc_tty.c | ||||||
|  | @ -232,3 +280,40 @@ extern void proc_tty_init(void); | ||||||
| #else | #else | ||||||
| static inline void proc_tty_init(void) {} | static inline void proc_tty_init(void) {} | ||||||
| #endif | #endif | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * root.c | ||||||
|  |  */ | ||||||
|  | extern struct proc_dir_entry proc_root; | ||||||
|  | 
 | ||||||
|  | extern void proc_self_init(void); | ||||||
|  | extern int proc_remount(struct super_block *, int *, char *); | ||||||
|  | 
 | ||||||
|  | /*
 | ||||||
|  |  * task_[no]mmu.c | ||||||
|  |  */ | ||||||
|  | struct proc_maps_private { | ||||||
|  | 	struct pid *pid; | ||||||
|  | 	struct task_struct *task; | ||||||
|  | #ifdef CONFIG_MMU | ||||||
|  | 	struct vm_area_struct *tail_vma; | ||||||
|  | #endif | ||||||
|  | #ifdef CONFIG_NUMA | ||||||
|  | 	struct mempolicy *task_mempolicy; | ||||||
|  | #endif | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | extern const struct file_operations proc_pid_maps_operations; | ||||||
|  | extern const struct file_operations proc_tid_maps_operations; | ||||||
|  | extern const struct file_operations proc_pid_numa_maps_operations; | ||||||
|  | extern const struct file_operations proc_tid_numa_maps_operations; | ||||||
|  | extern const struct file_operations proc_pid_smaps_operations; | ||||||
|  | extern const struct file_operations proc_tid_smaps_operations; | ||||||
|  | extern const struct file_operations proc_clear_refs_operations; | ||||||
|  | extern const struct file_operations proc_pagemap_operations; | ||||||
|  | 
 | ||||||
|  | extern unsigned long task_vsize(struct mm_struct *); | ||||||
|  | extern unsigned long task_statm(struct mm_struct *, | ||||||
|  | 				unsigned long *, unsigned long *, | ||||||
|  | 				unsigned long *, unsigned long *); | ||||||
|  | extern void task_mem(struct seq_file *, struct mm_struct *); | ||||||
|  |  | ||||||
|  | @ -28,6 +28,7 @@ | ||||||
| #include <linux/ioport.h> | #include <linux/ioport.h> | ||||||
| #include <linux/memory.h> | #include <linux/memory.h> | ||||||
| #include <asm/sections.h> | #include <asm/sections.h> | ||||||
|  | #include "internal.h" | ||||||
| 
 | 
 | ||||||
| #define CORE_STR "CORE" | #define CORE_STR "CORE" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,86 +1,35 @@ | ||||||
| #ifndef _LINUX_PROC_FS_H |  | ||||||
| #define _LINUX_PROC_FS_H |  | ||||||
| 
 |  | ||||||
| #include <linux/slab.h> |  | ||||||
| #include <linux/fs.h> |  | ||||||
| #include <linux/spinlock.h> |  | ||||||
| #include <linux/magic.h> |  | ||||||
| #include <linux/atomic.h> |  | ||||||
| #include <linux/proc_ns.h> |  | ||||||
| 
 |  | ||||||
| struct net; |  | ||||||
| struct completion; |  | ||||||
| struct mm_struct; |  | ||||||
| 
 |  | ||||||
| /*
 | /*
 | ||||||
|  * The proc filesystem constants/structures |  * The proc filesystem constants/structures | ||||||
|  */ |  */ | ||||||
|  | #ifndef _LINUX_PROC_FS_H | ||||||
|  | #define _LINUX_PROC_FS_H | ||||||
| 
 | 
 | ||||||
| /*
 | #include <linux/types.h> | ||||||
|  * Offset of the first process in the /proc root directory.. | #include <linux/fs.h> | ||||||
|  */ |  | ||||||
| #define FIRST_PROCESS_ENTRY 256 |  | ||||||
| 
 | 
 | ||||||
| /* Worst case buffer size needed for holding an integer. */ | struct proc_dir_entry; | ||||||
| #define PROC_NUMBUF 13 |  | ||||||
| 
 |  | ||||||
| /*
 |  | ||||||
|  * This is not completely implemented yet. The idea is to |  | ||||||
|  * create an in-memory tree (like the actual /proc filesystem |  | ||||||
|  * tree) of these proc_dir_entries, so that we can dynamically |  | ||||||
|  * add new files to /proc. |  | ||||||
|  * |  | ||||||
|  * The "next" pointer creates a linked list of one /proc directory, |  | ||||||
|  * while parent/subdir create the directory structure (every |  | ||||||
|  * /proc file has a parent, but "subdir" is NULL for all |  | ||||||
|  * non-directory entries). |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| struct proc_dir_entry { |  | ||||||
| 	unsigned int low_ino; |  | ||||||
| 	umode_t mode; |  | ||||||
| 	nlink_t nlink; |  | ||||||
| 	kuid_t uid; |  | ||||||
| 	kgid_t gid; |  | ||||||
| 	loff_t size; |  | ||||||
| 	const struct inode_operations *proc_iops; |  | ||||||
| 	const struct file_operations *proc_fops; |  | ||||||
| 	struct proc_dir_entry *next, *parent, *subdir; |  | ||||||
| 	void *data; |  | ||||||
| 	atomic_t count;		/* use count */ |  | ||||||
| 	atomic_t in_use;	/* number of callers into module in progress; */ |  | ||||||
| 			/* negative -> it's going away RSN */ |  | ||||||
| 	struct completion *pde_unload_completion; |  | ||||||
| 	struct list_head pde_openers;	/* who did ->open, but not ->release */ |  | ||||||
| 	spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */ |  | ||||||
| 	u8 namelen; |  | ||||||
| 	char name[]; |  | ||||||
| }; |  | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_PROC_FS | #ifdef CONFIG_PROC_FS | ||||||
| 
 | 
 | ||||||
| extern void proc_root_init(void); | extern void proc_root_init(void); | ||||||
| 
 | extern void proc_flush_task(struct task_struct *); | ||||||
| void proc_flush_task(struct task_struct *task); |  | ||||||
| 
 |  | ||||||
| struct proc_dir_entry *proc_create_data(const char *name, umode_t mode, |  | ||||||
| 				struct proc_dir_entry *parent, |  | ||||||
| 				const struct file_operations *proc_fops, |  | ||||||
| 				void *data); |  | ||||||
| extern void proc_remove(struct proc_dir_entry *); |  | ||||||
| extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); |  | ||||||
| extern int remove_proc_subtree(const char *name, struct proc_dir_entry *parent); |  | ||||||
| 
 | 
 | ||||||
| extern struct proc_dir_entry *proc_symlink(const char *, | extern struct proc_dir_entry *proc_symlink(const char *, | ||||||
| 		struct proc_dir_entry *, const char *); | 		struct proc_dir_entry *, const char *); | ||||||
| extern struct proc_dir_entry *proc_mkdir(const char *,struct proc_dir_entry *); | extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *); | ||||||
| extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, | extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t, | ||||||
| 					      struct proc_dir_entry *, void *); | 					      struct proc_dir_entry *, void *); | ||||||
| extern struct proc_dir_entry *proc_mkdir_mode(const char *name, umode_t mode, | extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t, | ||||||
| 			struct proc_dir_entry *parent); | 					      struct proc_dir_entry *); | ||||||
|   |   | ||||||
| static inline struct proc_dir_entry *proc_create(const char *name, umode_t mode, | extern struct proc_dir_entry *proc_create_data(const char *, umode_t, | ||||||
| 	struct proc_dir_entry *parent, const struct file_operations *proc_fops) | 					       struct proc_dir_entry *, | ||||||
|  | 					       const struct file_operations *, | ||||||
|  | 					       void *); | ||||||
|  | 
 | ||||||
|  | static inline struct proc_dir_entry *proc_create( | ||||||
|  | 	const char *name, umode_t mode, struct proc_dir_entry *parent, | ||||||
|  | 	const struct file_operations *proc_fops) | ||||||
| { | { | ||||||
| 	return proc_create_data(name, mode, parent, proc_fops, NULL); | 	return proc_create_data(name, mode, parent, proc_fops, NULL); | ||||||
| } | } | ||||||
|  | @ -89,61 +38,38 @@ extern void proc_set_size(struct proc_dir_entry *, loff_t); | ||||||
| extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t); | extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t); | ||||||
| extern void *PDE_DATA(const struct inode *); | extern void *PDE_DATA(const struct inode *); | ||||||
| extern void *proc_get_parent_data(const struct inode *); | extern void *proc_get_parent_data(const struct inode *); | ||||||
| #else | extern void proc_remove(struct proc_dir_entry *); | ||||||
|  | extern void remove_proc_entry(const char *, struct proc_dir_entry *); | ||||||
|  | extern int remove_proc_subtree(const char *, struct proc_dir_entry *); | ||||||
|  | 
 | ||||||
|  | #else /* CONFIG_PROC_FS */ | ||||||
| 
 | 
 | ||||||
| static inline void proc_flush_task(struct task_struct *task) | static inline void proc_flush_task(struct task_struct *task) | ||||||
| { | { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #define proc_create(name, mode, parent, fops)  ({ (void)(mode), NULL; }) |  | ||||||
| 
 |  | ||||||
| static inline struct proc_dir_entry *proc_create_data(const char *name, |  | ||||||
| 	umode_t mode, struct proc_dir_entry *parent, |  | ||||||
| 	const struct file_operations *proc_fops, void *data) |  | ||||||
| { |  | ||||||
| 	return NULL; |  | ||||||
| } |  | ||||||
| static inline void proc_remove(struct proc_dir_entry *de) {} |  | ||||||
| #define remove_proc_entry(name, parent) do {} while (0) |  | ||||||
| #define remove_proc_subtree(name, parent) do {} while (0) |  | ||||||
| 
 |  | ||||||
| static inline struct proc_dir_entry *proc_symlink(const char *name, | static inline struct proc_dir_entry *proc_symlink(const char *name, | ||||||
| 		struct proc_dir_entry *parent,const char *dest) {return NULL;} | 		struct proc_dir_entry *parent,const char *dest) { return NULL;} | ||||||
| static inline struct proc_dir_entry *proc_mkdir(const char *name, | static inline struct proc_dir_entry *proc_mkdir(const char *name, | ||||||
| 	struct proc_dir_entry *parent) {return NULL;} | 	struct proc_dir_entry *parent) {return NULL;} | ||||||
| static inline struct proc_dir_entry *proc_mkdir_data(const char *name, | static inline struct proc_dir_entry *proc_mkdir_data(const char *name, | ||||||
| 	umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } | 	umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; } | ||||||
| static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, | static inline struct proc_dir_entry *proc_mkdir_mode(const char *name, | ||||||
| 	umode_t mode, struct proc_dir_entry *parent) { return NULL; } | 	umode_t mode, struct proc_dir_entry *parent) { return NULL; } | ||||||
|  | #define proc_create(name, mode, parent, proc_fops) ({NULL;}) | ||||||
|  | #define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;}) | ||||||
|  | 
 | ||||||
| static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {} | static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {} | ||||||
| static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {} | static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {} | ||||||
| static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;} | static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;} | ||||||
|  | static inline void *proc_get_parent_data(const struct inode *inode) { BUG(); return NULL; } | ||||||
|  | 
 | ||||||
|  | static inline void proc_remove(struct proc_dir_entry *de) {} | ||||||
|  | #define remove_proc_entry(name, parent) do {} while (0) | ||||||
|  | static inline int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) { return 0; } | ||||||
| 
 | 
 | ||||||
| #endif /* CONFIG_PROC_FS */ | #endif /* CONFIG_PROC_FS */ | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| union proc_op { |  | ||||||
| 	int (*proc_get_link)(struct dentry *, struct path *); |  | ||||||
| 	int (*proc_read)(struct task_struct *task, char *page); |  | ||||||
| 	int (*proc_show)(struct seq_file *m, |  | ||||||
| 		struct pid_namespace *ns, struct pid *pid, |  | ||||||
| 		struct task_struct *task); |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| struct ctl_table_header; |  | ||||||
| struct ctl_table; |  | ||||||
| 
 |  | ||||||
| struct proc_inode { |  | ||||||
| 	struct pid *pid; |  | ||||||
| 	int fd; |  | ||||||
| 	union proc_op op; |  | ||||||
| 	struct proc_dir_entry *pde; |  | ||||||
| 	struct ctl_table_header *sysctl; |  | ||||||
| 	struct ctl_table *sysctl_entry; |  | ||||||
| 	struct proc_ns ns; |  | ||||||
| 	struct inode vfs_inode; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| static inline struct proc_dir_entry *proc_net_mkdir( | static inline struct proc_dir_entry *proc_net_mkdir( | ||||||
| 	struct net *net, const char *name, struct proc_dir_entry *parent) | 	struct net *net, const char *name, struct proc_dir_entry *parent) | ||||||
| { | { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Howells
				David Howells