Whamcloud - gitweb
LU-8066 obd: Add debugfs root
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index b3eb9d6..fb6bbfa 100644 (file)
@@ -40,6 +40,7 @@
 
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
+#include <linux/debugfs.h>
 #include <linux/rwsem.h>
 #include <linux/spinlock.h>
 #include <linux/seq_file.h>
@@ -355,7 +356,7 @@ enum lprocfs_extra_opc {
 #define EXTRA_FIRST_OPC LDLM_GLIMPSE_ENQUEUE
 /* class_obd.c */
 extern struct proc_dir_entry *proc_lustre_root;
-
+extern struct dentry *debugfs_lustre_root;
 extern struct kobject *lustre_kobj;
 
 struct obd_device;
@@ -503,15 +504,26 @@ lprocfs_nid_stats_clear_seq_write(struct file *file, const char __user *buffer,
                                        size_t count, loff_t *off);
 extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data);
 #endif
+extern int ldebugfs_register_stats(struct dentry *parent, const char *name,
+                                  struct lprocfs_stats *stats);
 extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
                                   struct lprocfs_stats *stats);
 
 /* lprocfs_status.c */
+extern int ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var,
+                            void *data);
 extern int lprocfs_add_vars(struct proc_dir_entry *root,
                            struct lprocfs_vars *var, void *data);
+
+extern struct dentry *ldebugfs_register(const char *name,
+                                       struct dentry *parent,
+                                       struct lprocfs_vars *list,
+                                       void *data);
 extern struct proc_dir_entry *
 lprocfs_register(const char *name, struct proc_dir_entry *parent,
                 struct lprocfs_vars *list, void *data);
+
+extern void ldebugfs_remove(struct dentry **entryp);
 extern void lprocfs_remove(struct proc_dir_entry **root);
 extern void lprocfs_remove_proc_entry(const char *name,
                                       struct proc_dir_entry *parent);
@@ -542,6 +554,11 @@ extern int lprocfs_obd_cleanup(struct obd_device *obd);
 #ifdef HAVE_SERVER_SUPPORT
 extern const struct file_operations lprocfs_evict_client_fops;
 #endif
+
+extern int ldebugfs_seq_create(struct dentry *parent, const char *name,
+                              umode_t mode,
+                              const struct file_operations *seq_fops,
+                              void *data);
 extern int lprocfs_seq_create(struct proc_dir_entry *parent, const char *name,
                              mode_t mode,
                              const struct file_operations *seq_fops,
@@ -664,7 +681,8 @@ static int name##_single_open(struct inode *inode, struct file *file)       \
        if (rc < 0)                                                     \
                return rc;                                              \
                                                                        \
-       return single_open(file, name##_seq_show, PDE_DATA(inode));     \
+       return single_open(file, name##_seq_show,                       \
+                          inode->i_private ? : PDE_DATA(inode));       \
 }                                                                      \
 static const struct file_operations name##_fops = {                    \
        .owner   = THIS_MODULE,                                         \
@@ -709,7 +727,8 @@ static const struct file_operations name##_fops = {                 \
        }                                                               \
        static int name##_##type##_open(struct inode *inode, struct file *file)\
        {                                                               \
-               return single_open(file, NULL, PDE_DATA(inode));        \
+               return single_open(file, NULL,                          \
+                                  inode->i_private ? : PDE_DATA(inode));\
        }                                                               \
        static const struct file_operations name##_##type##_fops = {    \
                .open    = name##_##type##_open,                        \