Whamcloud - gitweb
LU-13344 all: Separate debugfs and procfs handling 34/37834/14
authorShaun Tancheff <shaun.tancheff@hpe.com>
Thu, 4 Jun 2020 21:27:44 +0000 (16:27 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Jul 2020 19:29:43 +0000 (19:29 +0000)
Linux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2
proc: decouple proc from VFS with "struct proc_ops"

Separate debugfs usage and procfs usage to prepare for the divergence
of debugfs using file_operations and procfs using proc_ops

HPE-bug-id: LUS-8589
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: I1746e563b55a9e89f90ac01843c304fe6b690d8b
Reviewed-on: https://review.whamcloud.com/37834
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
29 files changed:
lustre/fid/fid_internal.h
lustre/fid/lproc_fid.c
lustre/fld/fld_internal.h
lustre/fld/lproc_fld.c
lustre/include/dt_object.h
lustre/include/lprocfs_status.h
lustre/include/obd.h
lustre/include/obd_class.h
lustre/ldlm/ldlm_internal.h
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_resource.c
lustre/llite/lproc_llite.c
lustre/lod/lproc_lod.c
lustre/mdd/mdd_lproc.c
lustre/mdt/mdt_coordinator.c
lustre/mgc/lproc_mgc.c
lustre/obdclass/dt_object.c
lustre/obdclass/genops.c
lustre/obdclass/lprocfs_status.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c
lustre/osp/lproc_osp.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_delay.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/sec_lproc.c

index 1535ab0..4be0f04 100644 (file)
@@ -55,7 +55,7 @@ enum {
 
 extern struct lu_context_key seq_thread_key;
 
 
 extern struct lu_context_key seq_thread_key;
 
-extern struct lprocfs_vars seq_server_debugfs_list[];
+extern struct ldebugfs_vars seq_server_debugfs_list[];
 
 /* Store API functions. */
 struct dt_device;
 
 /* Store API functions. */
 struct dt_device;
@@ -89,7 +89,7 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
 
 extern struct dentry *seq_debugfs_dir;
 
 
 extern struct dentry *seq_debugfs_dir;
 
-extern struct lprocfs_vars seq_client_debugfs_list[];
+extern struct ldebugfs_vars seq_client_debugfs_list[];
 
 extern const struct file_operations seq_fld_debugfs_seq_fops;
 
 
 extern const struct file_operations seq_fld_debugfs_seq_fops;
 
index 688082e..df896be 100644 (file)
@@ -199,7 +199,7 @@ LDEBUGFS_SEQ_FOPS(ldebugfs_server_fid_space);
 LDEBUGFS_SEQ_FOPS(ldebugfs_server_fid_width);
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_server_fid_server);
 
 LDEBUGFS_SEQ_FOPS(ldebugfs_server_fid_width);
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_server_fid_server);
 
-struct lprocfs_vars seq_server_debugfs_list[] = {
+struct ldebugfs_vars seq_server_debugfs_list[] = {
        { .name =       "space",
          .fops =       &ldebugfs_server_fid_space_fops },
        { .name =       "width",
        { .name =       "space",
          .fops =       &ldebugfs_server_fid_space_fops },
        { .name =       "width",
@@ -608,7 +608,7 @@ LDEBUGFS_SEQ_FOPS(ldebugfs_client_fid_width);
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_server);
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_fid);
 
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_server);
 LDEBUGFS_SEQ_FOPS_RO(ldebugfs_client_fid_fid);
 
-struct lprocfs_vars seq_client_debugfs_list[] = {
+struct ldebugfs_vars seq_client_debugfs_list[] = {
        { .name =       "space",
          .fops =       &ldebugfs_client_fid_space_fops },
        { .name =       "width",
        { .name =       "space",
          .fops =       &ldebugfs_client_fid_space_fops },
        { .name =       "width",
index b8e9590..53b8fc3 100644 (file)
@@ -179,7 +179,7 @@ int fld_client_rpc(struct obd_export *exp,
                    struct lu_seq_range *range, __u32 fld_op,
                   struct ptlrpc_request **reqp);
 
                    struct lu_seq_range *range, __u32 fld_op,
                   struct ptlrpc_request **reqp);
 
-extern struct lprocfs_vars fld_client_debugfs_list[];
+extern struct ldebugfs_vars fld_client_debugfs_list[];
 
 struct fld_cache *fld_cache_init(const char *name,
                                  int cache_size, int cache_threshold);
 
 struct fld_cache *fld_cache_init(const char *name,
                                  int cache_size, int cache_threshold);
index 5edc90d..80f0ae4 100644 (file)
@@ -135,7 +135,7 @@ LDEBUGFS_SEQ_FOPS_RO(fld_debugfs_targets);
 LDEBUGFS_SEQ_FOPS(fld_debugfs_hash);
 LDEBUGFS_FOPS_WR_ONLY(fld, cache_flush);
 
 LDEBUGFS_SEQ_FOPS(fld_debugfs_hash);
 LDEBUGFS_FOPS_WR_ONLY(fld, cache_flush);
 
-struct lprocfs_vars fld_client_debugfs_list[] = {
+struct ldebugfs_vars fld_client_debugfs_list[] = {
        { .name =       "targets",
          .fops =       &fld_debugfs_targets_fops       },
        { .name =       "hash",
        { .name =       "targets",
          .fops =       &fld_debugfs_targets_fops       },
        { .name =       "hash",
index 752ac11..fe778cf 100644 (file)
@@ -2941,7 +2941,7 @@ static inline struct dt_thread_info *dt_info(const struct lu_env *env)
 int dt_global_init(void);
 void dt_global_fini(void);
 int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
 int dt_global_init(void);
 void dt_global_fini(void);
 int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
-                    const char *name, struct lprocfs_vars *list);
+                    const char *name, struct ldebugfs_vars *list);
 int dt_tunables_fini(struct dt_device *dt);
 
 # ifdef CONFIG_PROC_FS
 int dt_tunables_fini(struct dt_device *dt);
 
 # ifdef CONFIG_PROC_FS
index 55af6cd..8611349 100644 (file)
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 
 #include <libcfs/libcfs.h>
 #include <uapi/linux/lustre/lustre_idl.h>
 
+/*
+ * Liuux 5.6 introduces proc_ops with v5.5-8862-gd56c0d45f0e2
+ * Now that proc and debugfs use separate operation vector types
+ * separate containers are also needed.
+ */
 struct lprocfs_vars {
        const char                      *name;
        const struct file_operations    *fops;
        void                            *data;
 struct lprocfs_vars {
        const char                      *name;
        const struct file_operations    *fops;
        void                            *data;
-       /**
-        * /proc file mode.
-        */
+       /** /proc file mode. */
+       mode_t                           proc_mode;
+};
+
+/** Provide a debugfs container */
+struct ldebugfs_vars {
+       const char                      *name;
+       const struct file_operations    *fops;
+       void                            *data;
+       /** debugfs file mode. */
        mode_t                           proc_mode;
 };
 
        mode_t                           proc_mode;
 };
 
@@ -521,13 +533,17 @@ 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
                                        size_t count, loff_t *off);
 extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data);
 #endif
-extern const struct file_operations lprocfs_stats_seq_fops;
 extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
 extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
-                                  struct lprocfs_stats *stats);
+                                 struct lprocfs_stats *stats);
+extern const struct file_operations ldebugfs_stats_seq_fops;
 
 /* lprocfs_status.c */
 
 /* lprocfs_status.c */
-extern void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *var,
+extern void ldebugfs_add_vars(struct dentry *parent, struct ldebugfs_vars *var,
                              void *data);
                              void *data);
+extern struct dentry *ldebugfs_register(const char *name,
+                                       struct dentry *parent,
+                                       struct ldebugfs_vars *list,
+                                       void *data);
 extern int lprocfs_add_vars(struct proc_dir_entry *root,
                            struct lprocfs_vars *var, void *data);
 
 extern int lprocfs_add_vars(struct proc_dir_entry *root,
                            struct lprocfs_vars *var, void *data);
 
@@ -582,8 +598,15 @@ ssize_t ping_show(struct kobject *kobj, struct attribute *attr,
                  char *buffer);
 
 extern ssize_t
                  char *buffer);
 
 extern ssize_t
+ldebugfs_import_seq_write(struct file *file, const char __user *buffer,
+                         size_t count, loff_t *off);
+static inline ssize_t
 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
-                        size_t count, loff_t *off);
+                        size_t count, loff_t *off)
+{
+       return ldebugfs_import_seq_write(file, buffer, count, off);
+}
+
 extern int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data);
 extern ssize_t
 lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer,
 extern int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *data);
 extern ssize_t
 lprocfs_pinger_recov_seq_write(struct file *file, const char __user *buffer,
@@ -972,6 +995,10 @@ lprocfs_ping_seq_write(struct file *file, const char __user *buffer,
                       size_t count, loff_t *off)
 { return 0; }
 static inline ssize_t
                       size_t count, loff_t *off)
 { return 0; }
 static inline ssize_t
+ldebugfs_import_seq_write(struct file *file, const char __user *buffer,
+                         size_t count, loff_t *off)
+{ return 0; }
+static inline ssize_t
 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
                         size_t count, loff_t *off)
 { return 0; }
 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
                         size_t count, loff_t *off)
 { return 0; }
index c0d70c6..e72ec06 100644 (file)
@@ -733,6 +733,7 @@ struct obd_device {
        struct lprocfs_stats    *obd_svc_stats;
        const struct attribute         **obd_attrs;
        struct lprocfs_vars     *obd_vars;
        struct lprocfs_stats    *obd_svc_stats;
        const struct attribute         **obd_attrs;
        struct lprocfs_vars     *obd_vars;
+       struct ldebugfs_vars    *obd_debugfs_vars;
        atomic_t                obd_evict_inprogress;
        wait_queue_head_t       obd_evict_inprogress_waitq;
        struct list_head        obd_evict_list; /* protected with pet_lock */
        atomic_t                obd_evict_inprogress;
        wait_queue_head_t       obd_evict_inprogress_waitq;
        struct list_head        obd_evict_list; /* protected with pet_lock */
index 6e68c1e..afb71e7 100644 (file)
@@ -74,7 +74,7 @@ struct obd_type *class_add_symlinks(const char *name, bool enable_proc);
 #endif
 int class_register_type(const struct obd_ops *dt_ops,
                        const struct md_ops *md_ops, bool enable_proc,
 #endif
 int class_register_type(const struct obd_ops *dt_ops,
                        const struct md_ops *md_ops, bool enable_proc,
-                       struct lprocfs_vars *module_vars,
+                       struct ldebugfs_vars *module_vars,
                        const char *nm, struct lu_device_type *ldt);
 int class_unregister_type(const char *nm);
 
                        const char *nm, struct lu_device_type *ldt);
 int class_unregister_type(const char *nm);
 
index be72ad1..2a6bf95 100644 (file)
@@ -353,7 +353,7 @@ enum ldlm_policy_res {
        struct __##var##__dummy_write {; } /* semicolon catcher */
 
 static inline void
        struct __##var##__dummy_write {; } /* semicolon catcher */
 
 static inline void
-ldlm_add_var(struct lprocfs_vars *vars, struct dentry *debugfs_entry,
+ldlm_add_var(struct ldebugfs_vars *vars, struct dentry *debugfs_entry,
             const char *name, void *data, const struct file_operations *ops)
 {
        vars->name = name;
             const char *name, void *data, const struct file_operations *ops)
 {
        vars->name = name;
index 402d5e0..e59c77c 100644 (file)
@@ -788,7 +788,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
 {
        struct ldlm_namespace *ns = ldlm_pl2ns(pl);
        struct dentry *debugfs_ns_parent;
 {
        struct ldlm_namespace *ns = ldlm_pl2ns(pl);
        struct dentry *debugfs_ns_parent;
-       struct lprocfs_vars pool_vars[2];
+       struct ldebugfs_vars pool_vars[2];
        int rc = 0;
 
        ENTRY;
        int rc = 0;
 
        ENTRY;
@@ -845,7 +845,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
                             LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV,
                             "recalc_timing", "sec");
        debugfs_create_file("stats", 0644, pl->pl_debugfs_entry,
                             LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV,
                             "recalc_timing", "sec");
        debugfs_create_file("stats", 0644, pl->pl_debugfs_entry,
-                           pl->pl_stats, &lprocfs_stats_seq_fops);
+                           pl->pl_stats, &ldebugfs_stats_seq_fops);
 
        EXIT;
 out:
 
        EXIT;
 out:
index a154d85..26a2b08 100644 (file)
@@ -207,7 +207,7 @@ static const struct file_operations ldlm_granted_fops = {
 
 #endif /* HAVE_SERVER_SUPPORT */
 
 
 #endif /* HAVE_SERVER_SUPPORT */
 
-static struct lprocfs_vars ldlm_debugfs_list[] = {
+static struct ldebugfs_vars ldlm_debugfs_list[] = {
        { .name =       "dump_namespaces",
          .fops =       &ldlm_dump_ns_fops,
          .proc_mode =  0222 },
        { .name =       "dump_namespaces",
          .fops =       &ldlm_dump_ns_fops,
          .proc_mode =  0222 },
index 79f352f..6ab8e5a 100644 (file)
@@ -1463,9 +1463,9 @@ out_free_kernbuff:
        OBD_FREE(kernbuf, count + 1);
        return rc ? rc : count;
 }
        OBD_FREE(kernbuf, count + 1);
        return rc ? rc : count;
 }
-LPROC_SEQ_FOPS(ll_pcc);
+LDEBUGFS_SEQ_FOPS(ll_pcc);
 
 
-struct lprocfs_vars lprocfs_llite_obd_vars[] = {
+struct ldebugfs_vars lprocfs_llite_obd_vars[] = {
        { .name =       "site",
          .fops =       &ll_site_stats_fops                     },
        { .name =       "max_cached_mb",
        { .name =       "site",
          .fops =       &ll_site_stats_fops                     },
        { .name =       "max_cached_mb",
@@ -1673,7 +1673,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
        }
 
        debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry,
        }
 
        debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry,
-                           sbi->ll_stats, &lprocfs_stats_seq_fops);
+                           sbi->ll_stats, &ldebugfs_stats_seq_fops);
 
        sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string),
                                               LPROCFS_STATS_FLAG_NONE);
 
        sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string),
                                               LPROCFS_STATS_FLAG_NONE);
@@ -1685,7 +1685,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
                                     ra_stat_string[id], "pages");
 
        debugfs_create_file("read_ahead_stats", 0644, sbi->ll_debugfs_entry,
                                     ra_stat_string[id], "pages");
 
        debugfs_create_file("read_ahead_stats", 0644, sbi->ll_debugfs_entry,
-                           sbi->ll_ra_stats, &lprocfs_stats_seq_fops);
+                           sbi->ll_ra_stats, &ldebugfs_stats_seq_fops);
 
 out_ll_kset:
        /* Yes we also register sysfs mount kset here as well */
 
 out_ll_kset:
        /* Yes we also register sysfs mount kset here as well */
index c4a4572..578305f 100644 (file)
@@ -1075,7 +1075,7 @@ static struct attribute *lod_attrs[] = {
  */
 int lod_procfs_init(struct lod_device *lod)
 {
  */
 int lod_procfs_init(struct lod_device *lod)
 {
-       struct lprocfs_vars ldebugfs_obd_vars[] = { { NULL } };
+       struct ldebugfs_vars ldebugfs_obd_vars[] = { { NULL } };
        struct obd_device *obd = lod2obd(lod);
        struct obd_type *type;
        struct kobject *lov;
        struct obd_device *obd = lod2obd(lod);
        struct obd_type *type;
        struct kobject *lov;
index 392719e..56a3b68 100644 (file)
@@ -644,7 +644,7 @@ static ssize_t append_pool_store(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RW_ATTR(append_pool);
 
 }
 LUSTRE_RW_ATTR(append_pool);
 
-static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
+static struct ldebugfs_vars ldebugfs_mdd_obd_vars[] = {
        { .name =       "changelog_mask",
          .fops =       &mdd_changelog_mask_fops        },
        { .name =       "changelog_users",
        { .name =       "changelog_mask",
          .fops =       &mdd_changelog_mask_fops        },
        { .name =       "changelog_users",
@@ -716,10 +716,10 @@ int mdd_procfs_init(struct mdd_device *mdd, const char *name)
                return rc;
 
        /* Find the type procroot and add the proc entry for this device */
                return rc;
 
        /* Find the type procroot and add the proc entry for this device */
-       obd->obd_vars = lprocfs_mdd_obd_vars;
+       obd->obd_debugfs_vars = ldebugfs_mdd_obd_vars;
        obd->obd_debugfs_entry = debugfs_create_dir(name,
                                                     type->typ_debugfs_entry);
        obd->obd_debugfs_entry = debugfs_create_dir(name,
                                                     type->typ_debugfs_entry);
-       ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_vars, mdd);
+       ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_debugfs_vars, mdd);
 
        RETURN(rc);
 }
 
        RETURN(rc);
 }
index d19a592..ec4efe8 100644 (file)
@@ -47,8 +47,6 @@
 #include <lustre_kernelcomm.h>
 #include "mdt_internal.h"
 
 #include <lustre_kernelcomm.h>
 #include "mdt_internal.h"
 
-static struct lprocfs_vars lprocfs_mdt_hsm_vars[];
-
 /**
  * get obj and HSM attributes on a fid
  * \param mti [IN] context
 /**
  * get obj and HSM attributes on a fid
  * \param mti [IN] context
@@ -2504,7 +2502,7 @@ static ssize_t remove_count_show(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RO_ATTR(remove_count);
 
 }
 LUSTRE_RO_ATTR(remove_count);
 
-static struct lprocfs_vars lprocfs_mdt_hsm_vars[] = {
+static struct ldebugfs_vars ldebugfs_mdt_hsm_vars[] = {
        { .name =       "agents",
          .fops =       &mdt_hsm_agent_fops                     },
        { .name =       "actions",
        { .name =       "agents",
          .fops =       &mdt_hsm_agent_fops                     },
        { .name =       "actions",
@@ -2576,7 +2574,7 @@ int hsm_cdt_tunables_init(struct mdt_device *mdt)
        /* init debugfs entries, failure is not critical */
        cdt->cdt_debugfs_dir = debugfs_create_dir("hsm",
                                                  obd->obd_debugfs_entry);
        /* init debugfs entries, failure is not critical */
        cdt->cdt_debugfs_dir = debugfs_create_dir("hsm",
                                                  obd->obd_debugfs_entry);
-       ldebugfs_add_vars(cdt->cdt_debugfs_dir, lprocfs_mdt_hsm_vars, mdt);
+       ldebugfs_add_vars(cdt->cdt_debugfs_dir, ldebugfs_mdt_hsm_vars, mdt);
 
        return 0;
 }
 
        return 0;
 }
index ec4ba5e..f277d3e 100644 (file)
@@ -54,7 +54,7 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
 
 LDEBUGFS_SEQ_FOPS_RO(mgc_ir_state);
 
 
 LDEBUGFS_SEQ_FOPS_RO(mgc_ir_state);
 
-struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
+struct ldebugfs_vars ldebugfs_mgc_obd_vars[] = {
        { .name =       "connect_flags",
          .fops =       &mgc_connect_flags_fops },
        { .name =       "mgs_server_uuid",
        { .name =       "connect_flags",
          .fops =       &mgc_connect_flags_fops },
        { .name =       "mgs_server_uuid",
@@ -86,7 +86,7 @@ int mgc_tunables_init(struct obd_device *obd)
        int rc;
 
        obd->obd_ktype.default_attrs = mgc_attrs;
        int rc;
 
        obd->obd_ktype.default_attrs = mgc_attrs;
-       obd->obd_vars = lprocfs_mgc_obd_vars;
+       obd->obd_debugfs_vars = ldebugfs_mgc_obd_vars;
        rc = lprocfs_obd_setup(obd, true);
        if (rc)
                return rc;
        rc = lprocfs_obd_setup(obd, true);
        if (rc)
                return rc;
index e14f216..756a3fd 100644 (file)
@@ -1256,7 +1256,7 @@ int dt_tunables_fini(struct dt_device *dt)
 EXPORT_SYMBOL(dt_tunables_fini);
 
 int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
 EXPORT_SYMBOL(dt_tunables_fini);
 
 int dt_tunables_init(struct dt_device *dt, struct obd_type *type,
-                    const char *name, struct lprocfs_vars *list)
+                    const char *name, struct ldebugfs_vars *list)
 {
        int rc;
 
 {
        int rc;
 
index 2223c14..5771e95 100644 (file)
@@ -223,7 +223,7 @@ EXPORT_SYMBOL(class_add_symlinks);
 
 int class_register_type(const struct obd_ops *dt_ops,
                        const struct md_ops *md_ops,
 
 int class_register_type(const struct obd_ops *dt_ops,
                        const struct md_ops *md_ops,
-                       bool enable_proc, struct lprocfs_vars *vars,
+                       bool enable_proc, struct ldebugfs_vars *vars,
                        const char *name, struct lu_device_type *ldt)
 {
        struct obd_type *type;
                        const char *name, struct lu_device_type *ldt)
 {
        struct obd_type *type;
index 3f04296..22f60c4 100644 (file)
@@ -112,9 +112,9 @@ struct proc_dir_entry *lprocfs_add_symlink(const char *name,
 }
 EXPORT_SYMBOL(lprocfs_add_symlink);
 
 }
 EXPORT_SYMBOL(lprocfs_add_symlink);
 
-static const struct file_operations lprocfs_generic_fops = { };
+static const struct file_operations ldebugfs_empty_ops = { };
 
 
-void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list,
+void ldebugfs_add_vars(struct dentry *parent, struct ldebugfs_vars *list,
                       void *data)
 {
        if (IS_ERR_OR_NULL(parent) || IS_ERR_OR_NULL(list))
                       void *data)
 {
        if (IS_ERR_OR_NULL(parent) || IS_ERR_OR_NULL(list))
@@ -133,12 +133,14 @@ void ldebugfs_add_vars(struct dentry *parent, struct lprocfs_vars *list,
                }
                debugfs_create_file(list->name, mode, parent,
                                    list->data ? : data,
                }
                debugfs_create_file(list->name, mode, parent,
                                    list->data ? : data,
-                                   list->fops ? : &lprocfs_generic_fops);
+                                   list->fops ? : &ldebugfs_empty_ops);
                list++;
        }
 }
 EXPORT_SYMBOL_GPL(ldebugfs_add_vars);
 
                list++;
        }
 }
 EXPORT_SYMBOL_GPL(ldebugfs_add_vars);
 
+static const struct file_operations lprocfs_empty_ops = { };
+
 /**
  * Add /proc entries.
  *
 /**
  * Add /proc entries.
  *
@@ -170,7 +172,7 @@ lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
                                mode |= 0200;
                }
                proc = proc_create_data(list->name, mode, root,
                                mode |= 0200;
                }
                proc = proc_create_data(list->name, mode, root,
-                                       list->fops ?: &lprocfs_generic_fops,
+                                       list->fops ?: &lprocfs_empty_ops,
                                        list->data ?: data);
                if (!proc)
                        return -ENOMEM;
                                        list->data ?: data);
                if (!proc)
                        return -ENOMEM;
@@ -1045,7 +1047,7 @@ static void obd_sysfs_release(struct kobject *kobj)
 
 int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
 {
 
 int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
 {
-       struct lprocfs_vars *debugfs_vars = NULL;
+       struct ldebugfs_vars *debugfs_vars = NULL;
        int rc;
 
        if (!obd || obd->obd_magic != OBD_DEVICE_MAGIC)
        int rc;
 
        if (!obd || obd->obd_magic != OBD_DEVICE_MAGIC)
@@ -1077,7 +1079,7 @@ int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only)
        }
 
        if (!obd->obd_type->typ_procroot)
        }
 
        if (!obd->obd_type->typ_procroot)
-               debugfs_vars = obd->obd_vars;
+               debugfs_vars = obd->obd_debugfs_vars;
        obd->obd_debugfs_entry = debugfs_create_dir(
                obd->obd_name, obd->obd_type->typ_debugfs_entry);
        ldebugfs_add_vars(obd->obd_debugfs_entry, debugfs_vars, obd);
        obd->obd_debugfs_entry = debugfs_create_dir(
                obd->obd_name, obd->obd_type->typ_debugfs_entry);
        ldebugfs_add_vars(obd->obd_debugfs_entry, debugfs_vars, obd);
@@ -1398,7 +1400,17 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file)
        return 0;
 }
 
        return 0;
 }
 
-const struct file_operations lprocfs_stats_seq_fops = {
+const struct file_operations ldebugfs_stats_seq_fops = {
+       .owner   = THIS_MODULE,
+       .open    = lprocfs_stats_seq_open,
+       .read    = seq_read,
+       .write   = lprocfs_stats_seq_write,
+       .llseek  = seq_lseek,
+       .release = lprocfs_seq_release,
+};
+EXPORT_SYMBOL(ldebugfs_stats_seq_fops);
+
+static const struct file_operations lprocfs_stats_seq_fops = {
        .owner   = THIS_MODULE,
        .open    = lprocfs_stats_seq_open,
        .read    = seq_read,
        .owner   = THIS_MODULE,
        .open    = lprocfs_stats_seq_open,
        .read    = seq_read,
@@ -1406,7 +1418,6 @@ const struct file_operations lprocfs_stats_seq_fops = {
        .llseek  = seq_lseek,
        .release = lprocfs_seq_release,
 };
        .llseek  = seq_lseek,
        .release = lprocfs_seq_release,
 };
-EXPORT_SYMBOL(lprocfs_stats_seq_fops);
 
 int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
                            struct lprocfs_stats *stats)
 
 int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
                            struct lprocfs_stats *stats)
index 082816b..36e27c6 100644 (file)
@@ -792,7 +792,7 @@ ssize_t index_backup_store(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RW_ATTR(index_backup);
 
 }
 LUSTRE_RW_ATTR(index_backup);
 
-struct lprocfs_vars lprocfs_osd_obd_vars[] = {
+struct ldebugfs_vars ldebugfs_osd_obd_vars[] = {
        { .name =       "oi_scrub",
          .fops =       &ldiskfs_osd_oi_scrub_fops      },
        { .name =       "readcache_max_filesize",
        { .name =       "oi_scrub",
          .fops =       &ldiskfs_osd_oi_scrub_fops      },
        { .name =       "readcache_max_filesize",
@@ -841,7 +841,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
 
        osd->od_dt_dev.dd_ktype.default_attrs = ldiskfs_attrs;
        rc = dt_tunables_init(&osd->od_dt_dev, type, name,
 
        osd->od_dt_dev.dd_ktype.default_attrs = ldiskfs_attrs;
        rc = dt_tunables_init(&osd->od_dt_dev, type, name,
-                             lprocfs_osd_obd_vars);
+                             ldebugfs_osd_obd_vars);
        if (rc) {
                CERROR("%s: cannot setup sysfs / debugfs entry: %d\n",
                       name, rc);
        if (rc) {
                CERROR("%s: cannot setup sysfs / debugfs entry: %d\n",
                       name, rc);
index 7e742fd..c91ccf4 100644 (file)
@@ -422,7 +422,7 @@ static struct attribute *zfs_attrs[] = {
        NULL,
 };
 
        NULL,
 };
 
-struct lprocfs_vars lprocfs_osd_obd_vars[] = {
+struct ldebugfs_vars ldebugfs_osd_obd_vars[] = {
        { .name =       "oi_scrub",
          .fops =       &zfs_osd_oi_scrub_fops          },
        { .name =       "readcache_max_filesize",
        { .name =       "oi_scrub",
          .fops =       &zfs_osd_oi_scrub_fops          },
        { .name =       "readcache_max_filesize",
@@ -450,7 +450,7 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
 
        osd->od_dt_dev.dd_ktype.default_attrs = zfs_attrs;
        rc = dt_tunables_init(&osd->od_dt_dev, type, name,
 
        osd->od_dt_dev.dd_ktype.default_attrs = zfs_attrs;
        rc = dt_tunables_init(&osd->od_dt_dev, type, name,
-                             lprocfs_osd_obd_vars);
+                             ldebugfs_osd_obd_vars);
        if (rc) {
                CERROR("%s: cannot setup sysfs / debugfs entry: %d\n",
                       name, rc);
        if (rc) {
                CERROR("%s: cannot setup sysfs / debugfs entry: %d\n",
                       name, rc);
index d5d7820..08ec720 100644 (file)
@@ -797,7 +797,7 @@ LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, connect_flags);
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, server_uuid);
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, timeouts);
 
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, server_uuid);
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, timeouts);
 
-LPROC_SEQ_FOPS_RW_TYPE(osp, import);
+LDEBUGFS_SEQ_FOPS_RW_TYPE(osp, import);
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, state);
 
 /**
 LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, state);
 
 /**
@@ -955,7 +955,7 @@ static ssize_t force_sync_store(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_WO_ATTR(force_sync);
 
 }
 LUSTRE_WO_ATTR(force_sync);
 
-static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
+static struct ldebugfs_vars ldebugfs_osp_obd_vars[] = {
        { .name =       "connect_flags",
          .fops =       &osp_connect_flags_fops         },
        { .name =       "ost_server_uuid",
        { .name =       "connect_flags",
          .fops =       &osp_connect_flags_fops         },
        { .name =       "ost_server_uuid",
@@ -973,7 +973,7 @@ static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
        { NULL }
 };
 
        { NULL }
 };
 
-static struct lprocfs_vars lprocfs_osp_md_vars[] = {
+static struct ldebugfs_vars ldebugfs_osp_md_vars[] = {
        { .name =       "connect_flags",
          .fops =       &osp_connect_flags_fops         },
        { .name =       "mdt_server_uuid",
        { .name =       "connect_flags",
          .fops =       &osp_connect_flags_fops         },
        { .name =       "mdt_server_uuid",
@@ -1062,10 +1062,10 @@ void osp_tunables_init(struct osp_device *osp)
 
        if (osp->opd_connect_mdt) {
                osp->opd_dt_dev.dd_ktype.default_attrs = osp_md_attrs;
 
        if (osp->opd_connect_mdt) {
                osp->opd_dt_dev.dd_ktype.default_attrs = osp_md_attrs;
-               obd->obd_vars = lprocfs_osp_md_vars;
+               obd->obd_debugfs_vars = ldebugfs_osp_md_vars;
        } else {
                osp->opd_dt_dev.dd_ktype.default_attrs = osp_obd_attrs;
        } else {
                osp->opd_dt_dev.dd_ktype.default_attrs = osp_obd_attrs;
-               obd->obd_vars = lprocfs_osp_obd_vars;
+               obd->obd_debugfs_vars = ldebugfs_osp_obd_vars;
        }
 
        rc = dt_tunables_init(&osp->opd_dt_dev, obd->obd_type, obd->obd_name,
        }
 
        rc = dt_tunables_init(&osp->opd_dt_dev, obd->obd_type, obd->obd_name,
@@ -1081,7 +1081,7 @@ void osp_tunables_init(struct osp_device *osp)
         */
        obd->obd_debugfs_entry = debugfs_create_dir(
                obd->obd_name, obd->obd_type->typ_debugfs_entry);
         */
        obd->obd_debugfs_entry = debugfs_create_dir(
                obd->obd_name, obd->obd_type->typ_debugfs_entry);
-       ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_vars, obd);
+       ldebugfs_add_vars(obd->obd_debugfs_entry, obd->obd_debugfs_vars, obd);
 
        sptlrpc_lprocfs_cliobd_attach(obd);
        ptlrpc_lprocfs_register_obd(obd);
 
        sptlrpc_lprocfs_cliobd_attach(obd);
        ptlrpc_lprocfs_register_obd(obd);
index 29e5c49..01e9757 100644 (file)
@@ -155,7 +155,7 @@ ssize_t sptlrpc_krb5_allow_old_client_csum_seq_write(struct file *file,
 }
 LPROC_SEQ_FOPS(sptlrpc_krb5_allow_old_client_csum);
 
 }
 LPROC_SEQ_FOPS(sptlrpc_krb5_allow_old_client_csum);
 
-static struct lprocfs_vars gss_debugfs_vars[] = {
+static struct ldebugfs_vars gss_debugfs_vars[] = {
        { .name =       "replays",
          .fops =       &gss_proc_oos_fops      },
        { .name =       "init_channel",
        { .name =       "replays",
          .fops =       &gss_proc_oos_fops      },
        { .name =       "init_channel",
@@ -203,7 +203,7 @@ gss_lk_proc_dl_seq_write(struct file *file, const char __user *buffer,
 }
 LDEBUGFS_SEQ_FOPS(gss_lk_proc_dl);
 
 }
 LDEBUGFS_SEQ_FOPS(gss_lk_proc_dl);
 
-static struct lprocfs_vars gss_lk_debugfs_vars[] = {
+static struct ldebugfs_vars gss_lk_debugfs_vars[] = {
        { .name =       "debug_level",
          .fops =       &gss_lk_proc_dl_fops    },
        { NULL }
        { .name =       "debug_level",
          .fops =       &gss_lk_proc_dl_fops    },
        { NULL }
index ee5e8c3..03bb88d 100644 (file)
@@ -254,7 +254,7 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir, char *name,
         }
 
        debugfs_create_file(name, 0644, svc_debugfs_entry, svc_stats,
         }
 
        debugfs_create_file(name, 0644, svc_debugfs_entry, svc_stats,
-                           &lprocfs_stats_seq_fops);
+                           &ldebugfs_stats_seq_fops);
 
        if (dir)
                *debugfs_root_ret = svc_debugfs_entry;
 
        if (dir)
                *debugfs_root_ret = svc_debugfs_entry;
@@ -1190,7 +1190,7 @@ int ptlrpc_sysfs_register_service(struct kset *parent,
 void ptlrpc_ldebugfs_register_service(struct dentry *entry,
                                      struct ptlrpc_service *svc)
 {
 void ptlrpc_ldebugfs_register_service(struct dentry *entry,
                                      struct ptlrpc_service *svc)
 {
-       struct lprocfs_vars lproc_vars[] = {
+       struct ldebugfs_vars ldebugfs_vars[] = {
                { .name = "req_buffer_history_len",
                  .fops = &ptlrpc_lprocfs_req_history_len_fops,
                  .data = svc },
                { .name = "req_buffer_history_len",
                  .fops = &ptlrpc_lprocfs_req_history_len_fops,
                  .data = svc },
@@ -1221,7 +1221,7 @@ void ptlrpc_ldebugfs_register_service(struct dentry *entry,
        if (!svc->srv_debugfs_entry)
                return;
 
        if (!svc->srv_debugfs_entry)
                return;
 
-       ldebugfs_add_vars(svc->srv_debugfs_entry, lproc_vars, NULL);
+       ldebugfs_add_vars(svc->srv_debugfs_entry, ldebugfs_vars, NULL);
 
        debugfs_create_file("req_history", 0400, svc->srv_debugfs_entry, svc,
                            &req_history_fops);
 
        debugfs_create_file("req_history", 0400, svc->srv_debugfs_entry, svc,
                            &req_history_fops);
@@ -1341,8 +1341,8 @@ EXPORT_SYMBOL(ping_store);
  * "echo connection=192.168.0.1@tcp0::instance > .../import".
  */
 ssize_t
  * "echo connection=192.168.0.1@tcp0::instance > .../import".
  */
 ssize_t
-lprocfs_import_seq_write(struct file *file, const char __user *buffer,
-                        size_t count, loff_t *off)
+ldebugfs_import_seq_write(struct file *file, const char __user *buffer,
+                         size_t count, loff_t *off)
 {
        struct seq_file   *m    = file->private_data;
        struct obd_device *obd  = m->private;
 {
        struct seq_file   *m    = file->private_data;
        struct obd_device *obd  = m->private;
@@ -1407,7 +1407,7 @@ out:
        OBD_FREE(kbuf, count + 1);
        return rc ?: count;
 }
        OBD_FREE(kbuf, count + 1);
        return rc ?: count;
 }
-EXPORT_SYMBOL(lprocfs_import_seq_write);
+EXPORT_SYMBOL(ldebugfs_import_seq_write);
 
 int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *n)
 {
 
 int lprocfs_pinger_recov_seq_show(struct seq_file *m, void *n)
 {
index da6e417..41d0cb6 100644 (file)
@@ -786,7 +786,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_crrn_quantum);
  */
 static int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc)
 {
  */
 static int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_vars nrs_crrn_lprocfs_vars[] = {
+       struct ldebugfs_vars nrs_crrn_lprocfs_vars[] = {
                { .name         = "nrs_crrn_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_crrn_quantum_fops,
                  .data = svc },
                { .name         = "nrs_crrn_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_crrn_quantum_fops,
                  .data = svc },
index 936782c..7222c09 100644 (file)
@@ -779,7 +779,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_delay_pct);
 
 static int nrs_delay_lprocfs_init(struct ptlrpc_service *svc)
 {
 
 static int nrs_delay_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_vars nrs_delay_lprocfs_vars[] = {
+       struct ldebugfs_vars nrs_delay_lprocfs_vars[] = {
                { .name         = "nrs_delay_min",
                  .fops         = &ptlrpc_lprocfs_nrs_delay_min_fops,
                  .data         = svc },
                { .name         = "nrs_delay_min",
                  .fops         = &ptlrpc_lprocfs_nrs_delay_min_fops,
                  .data         = svc },
index af10670..9324dbd 100644 (file)
@@ -1866,7 +1866,7 @@ static int nrs_orr_lprocfs_init(struct ptlrpc_service *svc)
 {
        int     i;
 
 {
        int     i;
 
-       struct lprocfs_vars nrs_orr_lprocfs_vars[] = {
+       struct ldebugfs_vars nrs_orr_lprocfs_vars[] = {
                { .name         = "nrs_orr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops  },
                { .name         = "nrs_orr_offset_type",
                { .name         = "nrs_orr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops  },
                { .name         = "nrs_orr_offset_type",
@@ -1919,7 +1919,7 @@ static int nrs_trr_lprocfs_init(struct ptlrpc_service *svc)
 {
        int     i;
 
 {
        int     i;
 
-       struct lprocfs_vars nrs_trr_lprocfs_vars[] = {
+       struct ldebugfs_vars nrs_trr_lprocfs_vars[] = {
                { .name         = "nrs_trr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops },
                { .name         = "nrs_trr_offset_type",
                { .name         = "nrs_trr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops },
                { .name         = "nrs_trr_offset_type",
index 76c8e4c..9521d69 100644 (file)
@@ -3659,7 +3659,7 @@ LDEBUGFS_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
  */
 static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
 {
  */
 static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_vars nrs_tbf_lprocfs_vars[] = {
+       struct ldebugfs_vars nrs_tbf_lprocfs_vars[] = {
                { .name         = "nrs_tbf_rule",
                  .fops         = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
                  .data = svc },
                { .name         = "nrs_tbf_rule",
                  .fops         = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
                  .data = svc },
index 41ef7e0..c09a83e 100644 (file)
@@ -107,7 +107,7 @@ out:
         return 0;
 }
 
         return 0;
 }
 
-LPROC_SEQ_FOPS_RO(sptlrpc_info_lprocfs);
+LDEBUGFS_SEQ_FOPS_RO(sptlrpc_info_lprocfs);
 
 static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
 {
 
 static int sptlrpc_ctxs_lprocfs_seq_show(struct seq_file *seq, void *v)
 {
@@ -134,7 +134,7 @@ out:
         return 0;
 }
 
         return 0;
 }
 
-LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);
+LDEBUGFS_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
 static ssize_t sepol_seq_write_old(struct obd_device *obd,
 
 #if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
 static ssize_t sepol_seq_write_old(struct obd_device *obd,
@@ -218,8 +218,8 @@ out:
 #endif
 
 static ssize_t
 #endif
 
 static ssize_t
-lprocfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
-                               size_t count, void *data)
+ldebugfs_sptlrpc_sepol_seq_write(struct file *file, const char __user *buffer,
+                                size_t count, void *data)
 {
        struct seq_file *seq = file->private_data;
        struct obd_device *obd = seq->private;
 {
        struct seq_file *seq = file->private_data;
        struct obd_device *obd = seq->private;
@@ -310,7 +310,7 @@ out:
 
        return rc ? rc : count;
 }
 
        return rc ? rc : count;
 }
-LPROC_SEQ_FOPS_WR_ONLY(srpc, sptlrpc_sepol);
+LDEBUGFS_FOPS_WR_ONLY(srpc, sptlrpc_sepol);
 
 int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd)
 {
 
 int sptlrpc_lprocfs_cliobd_attach(struct obd_device *obd)
 {
@@ -339,7 +339,7 @@ EXPORT_SYMBOL(sptlrpc_lprocfs_cliobd_attach);
 
 LDEBUGFS_SEQ_FOPS_RO(sptlrpc_proc_enc_pool);
 
 
 LDEBUGFS_SEQ_FOPS_RO(sptlrpc_proc_enc_pool);
 
-static struct lprocfs_vars sptlrpc_lprocfs_vars[] = {
+static struct ldebugfs_vars sptlrpc_lprocfs_vars[] = {
        { .name =       "encrypt_page_pools",
          .fops =       &sptlrpc_proc_enc_pool_fops     },
        { NULL }
        { .name =       "encrypt_page_pools",
          .fops =       &sptlrpc_proc_enc_pool_fops     },
        { NULL }