]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/proc_fs.h
Allocate and free vmalloc areas
[karo-tx-linux.git] / include / linux / proc_fs.h
index f4f7a63cae1f858f3779adf9b607d526b3fa038b..28e3664fdf1b860155157b3e1317b83a0203864f 100644 (file)
@@ -7,6 +7,8 @@
 #include <linux/magic.h>
 #include <asm/atomic.h>
 
+struct completion;
+
 /*
  * The proc filesystem constants/structures
  */
@@ -56,6 +58,14 @@ struct proc_dir_entry {
        gid_t gid;
        loff_t size;
        const struct inode_operations *proc_iops;
+       /*
+        * NULL ->proc_fops means "PDE is going away RSN" or
+        * "PDE is just created". In either case, e.g. ->read_proc won't be
+        * called because it's too late or too early, respectively.
+        *
+        * If you're allocating ->proc_fops dynamically, save a pointer
+        * somewhere.
+        */
        const struct file_operations *proc_fops;
        get_info_t *get_info;
        struct module *owner;
@@ -66,6 +76,9 @@ struct proc_dir_entry {
        atomic_t count;         /* use count */
        int deleted;            /* delete flag */
        void *set;
+       int pde_users;  /* number of callers into module in progress */
+       spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
+       struct completion *pde_unload_completion;
 };
 
 struct kcore_list {
@@ -106,6 +119,9 @@ int task_statm(struct mm_struct *, int *, int *, int *, int *);
 char *task_mem(struct mm_struct *, char *);
 void clear_refs_smap(struct mm_struct *mm);
 
+struct proc_dir_entry *de_get(struct proc_dir_entry *de);
+void de_put(struct proc_dir_entry *de);
+
 extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode,
                                                struct proc_dir_entry *parent);
 extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent);