Whamcloud - gitweb
LU-5275 lprocfs: remove last of non seq data structs and functions. 98/12298/4
authorJames Simmons <uja.ornl@gmail.com>
Mon, 3 Nov 2014 20:55:06 +0000 (15:55 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Dec 2014 13:42:27 +0000 (13:42 +0000)
This patch removes the rest of the non-seq file data structs
and functions. We rename the current seq data structs and
functions to match what is in the upstream lustre client.
Some functions in newer kernels are absent in RHEL6.5 and
SLES11SP3 kernels but lustre has equivalent functions so
they have also been renamed to match what exist in newer
kernels.

Change-Id: Iec17cd214864fe7c004eae8972397be326cdfee4
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/12298
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
64 files changed:
lustre/fid/fid_handler.c
lustre/fid/fid_internal.h
lustre/fid/fid_request.c
lustre/fid/lproc_fid.c
lustre/fld/fld_handler.c
lustre/fld/fld_internal.h
lustre/fld/fld_request.c
lustre/fld/lproc_fld.c
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/llite_internal.h
lustre/llite/lproc_llite.c
lustre/llite/super25.c
lustre/lmv/lmv_internal.h
lustre/lmv/lmv_obd.c
lustre/lmv/lproc_lmv.c
lustre/lod/lod_dev.c
lustre/lod/lproc_lod.c
lustre/lov/lov_internal.h
lustre/lov/lov_obd.c
lustre/lov/lproc_lov.c
lustre/mdc/lproc_mdc.c
lustre/mdc/mdc_internal.h
lustre/mdd/mdd_lproc.c
lustre/mdt/mdt_coordinator.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_lproc.c
lustre/mdt/mdt_mds.c
lustre/mgc/lproc_mgc.c
lustre/mgc/mgc_internal.h
lustre/mgs/lproc_mgs.c
lustre/obdclass/genops.c
lustre/obdclass/linux/linux-module.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/obdclass/obd_config.c
lustre/obdecho/echo.c
lustre/ofd/lproc_ofd.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/osc/lproc_osc.c
lustre/osc/osc_internal.h
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_internal.h
lustre/osd-zfs/osd_lproc.c
lustre/osp/lproc_osp.c
lustre/osp/osp_dev.c
lustre/ost/ost_handler.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/lproc_ptlrpc.c
lustre/ptlrpc/nodemap_lproc.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/sec_lproc.c
lustre/quota/qmt_dev.c
lustre/quota/qmt_pool.c
lustre/quota/qsd_lib.c

index c44f031..a9cf64d 100644 (file)
@@ -414,16 +414,14 @@ static int seq_server_proc_init(struct lu_server_seq *seq)
        int rc;
        ENTRY;
 
-       seq->lss_proc_dir = lprocfs_seq_register(seq->lss_name,
-                                                seq_type_proc_dir,
-                                                NULL, NULL);
+       seq->lss_proc_dir = lprocfs_register(seq->lss_name, seq_type_proc_dir,
+                                            NULL, NULL);
        if (IS_ERR(seq->lss_proc_dir)) {
                rc = PTR_ERR(seq->lss_proc_dir);
                RETURN(rc);
        }
 
-       rc = lprocfs_seq_add_vars(seq->lss_proc_dir,
-                                 seq_server_proc_list, seq);
+       rc = lprocfs_add_vars(seq->lss_proc_dir, seq_server_proc_list, seq);
        if (rc) {
                CERROR("%s: Can't init sequence manager "
                       "proc, rc %d\n", seq->lss_name, rc);
index f8539d8..bb6faa4 100644 (file)
@@ -61,7 +61,7 @@ enum {
 extern struct lu_context_key seq_thread_key;
 
 # ifdef LPROCFS
-extern struct lprocfs_seq_vars seq_server_proc_list[];
+extern struct lprocfs_vars seq_server_proc_list[];
 # endif
 
 /* Store API functions. */
@@ -95,7 +95,7 @@ int seq_client_alloc_super(struct lu_client_seq *seq,
                           const struct lu_env *env);
 
 # ifdef LPROCFS
-extern struct lprocfs_seq_vars seq_client_proc_list[];
+extern struct lprocfs_vars seq_client_proc_list[];
 # endif
 
 extern struct proc_dir_entry *seq_type_proc_dir;
index 520cc63..7ccab9c 100644 (file)
@@ -440,9 +440,8 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
         int rc;
         ENTRY;
 
-       seq->lcs_proc_dir = lprocfs_seq_register(seq->lcs_name,
-                                                seq_type_proc_dir,
-                                                NULL, NULL);
+       seq->lcs_proc_dir = lprocfs_register(seq->lcs_name, seq_type_proc_dir,
+                                            NULL, NULL);
         if (IS_ERR(seq->lcs_proc_dir)) {
                 CERROR("%s: LProcFS failed in seq-init\n",
                        seq->lcs_name);
@@ -450,8 +449,7 @@ static int seq_client_proc_init(struct lu_client_seq *seq)
                 RETURN(rc);
         }
 
-       rc = lprocfs_seq_add_vars(seq->lcs_proc_dir,
-                                 seq_client_proc_list, seq);
+       rc = lprocfs_add_vars(seq->lcs_proc_dir, seq_client_proc_list, seq);
         if (rc) {
                 CERROR("%s: Can't init sequence manager "
                        "proc, rc %d\n", seq->lcs_name, rc);
@@ -574,9 +572,8 @@ struct proc_dir_entry *seq_type_proc_dir;
 
 static int __init fid_mod_init(void)
 {
-       seq_type_proc_dir = lprocfs_seq_register(LUSTRE_SEQ_NAME,
-                                                proc_lustre_root,
-                                                NULL, NULL);
+       seq_type_proc_dir = lprocfs_register(LUSTRE_SEQ_NAME, proc_lustre_root,
+                                            NULL, NULL);
        if (IS_ERR(seq_type_proc_dir))
                return PTR_ERR(seq_type_proc_dir);
 
index 5adbf62..bec325b 100644 (file)
@@ -213,7 +213,7 @@ LPROC_SEQ_FOPS(lprocfs_server_fid_space);
 LPROC_SEQ_FOPS(lprocfs_server_fid_width);
 LPROC_SEQ_FOPS_RO(lprocfs_server_fid_server);
 
-struct lprocfs_seq_vars seq_server_proc_list[] = {
+struct lprocfs_vars seq_server_proc_list[] = {
        { .name =       "space",
          .fops =       &lprocfs_server_fid_space_fops  },
        { .name =       "width",
@@ -636,7 +636,7 @@ LPROC_SEQ_FOPS(lprocfs_client_fid_width);
 LPROC_SEQ_FOPS_RO(lprocfs_client_fid_server);
 LPROC_SEQ_FOPS_RO(lprocfs_client_fid_fid);
 
-struct lprocfs_seq_vars seq_client_proc_list[] = {
+struct lprocfs_vars seq_client_proc_list[] = {
        { .name =       "space",
          .fops =       &lprocfs_client_fid_space_fops  },
        { .name =       "width",
index 0e80de8..7dc26ad 100644 (file)
@@ -402,9 +402,8 @@ static int fld_server_proc_init(struct lu_server_fld *fld)
         int rc = 0;
         ENTRY;
 
-       fld->lsf_proc_dir = lprocfs_seq_register(fld->lsf_name,
-                                                fld_type_proc_dir,
-                                                fld_server_proc_list, fld);
+       fld->lsf_proc_dir = lprocfs_register(fld->lsf_name, fld_type_proc_dir,
+                                            fld_server_proc_list, fld);
        if (IS_ERR(fld->lsf_proc_dir)) {
                rc = PTR_ERR(fld->lsf_proc_dir);
                RETURN(rc);
index 43b2f5b..17f0f0e 100644 (file)
@@ -151,7 +151,7 @@ extern struct lu_fld_hash fld_hash[];
 
 #ifdef LPROCFS
 extern struct proc_dir_entry *fld_type_proc_dir;
-extern struct lprocfs_seq_vars fld_client_proc_list[];
+extern struct lprocfs_vars fld_client_proc_list[];
 #endif
 
 # ifdef HAVE_SERVER_SUPPORT
@@ -189,7 +189,7 @@ int fld_server_read(const struct lu_env *env, struct lu_server_fld *fld,
                    struct lu_seq_range *range, void *data, int data_len);
 #ifdef LPROCFS
 extern const struct file_operations fld_proc_seq_fops;
-extern struct lprocfs_seq_vars fld_server_proc_list[];
+extern struct lprocfs_vars fld_server_proc_list[];
 #endif
 
 # endif /* HAVE_SERVER_SUPPORT */
index 44d5cd0..d10af46 100644 (file)
@@ -235,9 +235,8 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
        int rc;
        ENTRY;
 
-       fld->lcf_proc_dir = lprocfs_seq_register(fld->lcf_name,
-                                                fld_type_proc_dir,
-                                                NULL, NULL);
+       fld->lcf_proc_dir = lprocfs_register(fld->lcf_name, fld_type_proc_dir,
+                                            NULL, NULL);
        if (IS_ERR(fld->lcf_proc_dir)) {
                CERROR("%s: LProcFS failed in fld-init\n",
                       fld->lcf_name);
@@ -245,8 +244,7 @@ static int fld_client_proc_init(struct lu_client_fld *fld)
                RETURN(rc);
        }
 
-       rc = lprocfs_seq_add_vars(fld->lcf_proc_dir,
-                                 fld_client_proc_list, fld);
+       rc = lprocfs_add_vars(fld->lcf_proc_dir, fld_client_proc_list, fld);
        if (rc) {
                CERROR("%s: Can't init FLD proc, rc %d\n",
                       fld->lcf_name, rc);
@@ -525,9 +523,8 @@ struct proc_dir_entry *fld_type_proc_dir;
 
 static int __init fld_mod_init(void)
 {
-       fld_type_proc_dir = lprocfs_seq_register(LUSTRE_FLD_NAME,
-                                                proc_lustre_root,
-                                                NULL, NULL);
+       fld_type_proc_dir = lprocfs_register(LUSTRE_FLD_NAME, proc_lustre_root,
+                                            NULL, NULL);
        if (IS_ERR(fld_type_proc_dir))
                return PTR_ERR(fld_type_proc_dir);
 
index 1eb2346..d915dcd 100644 (file)
@@ -136,7 +136,7 @@ LPROC_SEQ_FOPS_RO(fld_proc_targets);
 LPROC_SEQ_FOPS(fld_proc_hash);
 LPROC_SEQ_FOPS_WO_TYPE(fld, cache_flush);
 
-struct lprocfs_seq_vars fld_client_proc_list[] = {
+struct lprocfs_vars fld_client_proc_list[] = {
        { .name =       "targets",
          .fops =       &fld_proc_targets_fops  },
        { .name =       "hash",
@@ -356,7 +356,7 @@ const struct file_operations fld_proc_seq_fops = {
        .release = fldb_seq_release,
 };
 
-struct lprocfs_seq_vars fld_server_proc_list[] = {
+struct lprocfs_vars fld_server_proc_list[] = {
        { NULL }
 };
 
index 4e992e6..edb85d4 100644 (file)
 #include <lustre/lustre_idl.h>
 #include <libcfs/params_tree.h>
 
-#ifndef HAVE_ONLY_PROCFS_SEQ
 struct lprocfs_vars {
        const char                      *name;
-       read_proc_t                     *read_fptr;
-       write_proc_t                    *write_fptr;
-       void                            *data;
-       const struct file_operations    *fops;
-       /**
-        * /proc file mode.
-        */
-       mode_t                          proc_mode;
-};
-
-struct lprocfs_static_vars {
-       struct lprocfs_vars *module_vars;
-       struct lprocfs_vars *obd_vars;
-};
-
-#endif
-
-struct lprocfs_seq_vars {
-       const char                      *name;
        const struct file_operations    *fops;
        void                            *data;
        /**
@@ -614,32 +594,17 @@ extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
                                   struct lprocfs_stats *stats);
 
 /* lprocfs_status.c */
-#ifndef HAVE_ONLY_PROCFS_SEQ
 extern int lprocfs_add_vars(struct proc_dir_entry *root,
-                            struct lprocfs_vars *var,
-                            void *data);
-
-extern struct proc_dir_entry *lprocfs_register(const char *name,
-                                             struct proc_dir_entry *parent,
-                                             struct lprocfs_vars *list,
-                                             void *data);
-#endif
-extern int lprocfs_seq_add_vars(struct proc_dir_entry *root,
-                               struct lprocfs_seq_vars *var,
-                               void *data);
-
+                           struct lprocfs_vars *var, void *data);
 extern struct proc_dir_entry *
-lprocfs_seq_register(const char *name, struct proc_dir_entry *parent,
-                    struct lprocfs_seq_vars *list, void *data);
+lprocfs_register(const char *name, struct proc_dir_entry *parent,
+                struct lprocfs_vars *list, void *data);
 extern void lprocfs_remove(struct proc_dir_entry **root);
 extern void lprocfs_remove_proc_entry(const char *name,
                                       struct proc_dir_entry *parent);
 #ifndef HAVE_ONLY_PROCFS_SEQ
-extern void lprocfs_try_remove_proc_entry(const char *name,
-                                         struct proc_dir_entry *parent);
-
-extern struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *root,
-                                          const char *name);
+extern void remove_proc_subtree(const char *name,
+                               struct proc_dir_entry *parent);
 #endif
 extern int lprocfs_obd_setup(struct obd_device *dev);
 extern int lprocfs_obd_cleanup(struct obd_device *obd);
@@ -678,19 +643,13 @@ extern int lprocfs_connect_flags_seq_show(struct seq_file *m, void *data);
 extern int lprocfs_num_exports_seq_show(struct seq_file *m, void *data);
 #endif
 struct adaptive_timeout;
-extern int lprocfs_seq_at_hist_helper(struct seq_file *m,
+extern int lprocfs_at_hist_helper(struct seq_file *m,
                                      struct adaptive_timeout *at);
 extern int lprocfs_timeouts_seq_show(struct seq_file *m, void *data);
 extern ssize_t
 lprocfs_timeouts_seq_write(struct file *file, const char *buffer,
                           size_t count, loff_t *off);
 #ifdef HAVE_SERVER_SUPPORT
-#ifndef HAVE_ONLY_PROCFS_SEQ
-extern ssize_t lprocfs_fops_read(struct file *f, char __user *buf,
-                                size_t size, loff_t *ppos);
-extern ssize_t lprocfs_fops_write(struct file *f, const char __user *buf,
-                                 size_t size, loff_t *ppos);
-#endif
 extern ssize_t
 lprocfs_evict_client_seq_write(struct file *file, const char *buffer,
                                size_t count, loff_t *off);
@@ -1007,23 +966,13 @@ static inline struct proc_dir_entry *
 lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
                     const char *format, ...)
 {return NULL; }
-#ifndef HAVE_ONLY_PROCFS_SEQ
-static inline struct proc_dir_entry *
-lprocfs_register(const char *name, struct proc_dir_entry *parent,
-                struct lprocfs_vars *list, void *data)
-{ return NULL; }
 static inline int lprocfs_add_vars(struct proc_dir_entry *root,
-                                   struct lprocfs_vars *var,
-                                   void *data)
-{ return 0; }
-#endif
-static inline int lprocfs_seq_add_vars(struct proc_dir_entry *root,
-                                      struct lprocfs_seq_vars *var,
-                                      void *data)
+                                  struct lprocfs_vars *var,
+                                  void *data)
 { return 0; }
 static inline struct proc_dir_entry *
-lprocfs_seq_register(const char *name, struct proc_dir_entry *parent,
-                    struct lprocfs_seq_vars *list, void *data)
+lprocfs_register(const char *name, struct proc_dir_entry *parent,
+                struct lprocfs_vars *list, void *data)
 { return NULL; }
 static inline void lprocfs_remove(struct proc_dir_entry **root)
 { return; }
@@ -1031,12 +980,9 @@ static inline void lprocfs_remove_proc_entry(const char *name,
                                              struct proc_dir_entry *parent)
 { return; }
 #ifndef HAVE_ONLY_PROCFS_SEQ
-static inline void lprocfs_try_remove_proc_entry(const char *name,
-                                                struct proc_dir_entry *parent)
+static inline void remove_proc_subtree(const char *name,
+                                      struct proc_dir_entry *parent)
 { return; }
-static inline struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *head,
-                                                 const char *name)
-{ return 0; }
 #endif
 static inline int lprocfs_obd_setup(struct obd_device *dev)
 { return 0; }
@@ -1061,8 +1007,8 @@ static inline int lprocfs_num_exports_seq_show(struct seq_file *m, void *data)
 { return 0; }
 #endif
 struct adaptive_timeout;
-static inline int lprocfs_seq_at_hist_helper(struct seq_file *m,
-                                            struct adaptive_timeout *at)
+static inline int lprocfs_at_hist_helper(struct seq_file *m,
+                                        struct adaptive_timeout *at)
 { return 0; }
 static inline int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
 { return 0; }
index 88df7cb..e1d4f0b 100644 (file)
@@ -695,7 +695,7 @@ struct obd_device {
        struct proc_dir_entry   *obd_proc_exports_entry;
        struct proc_dir_entry   *obd_svc_procroot;
        struct lprocfs_stats    *obd_svc_stats;
-       struct lprocfs_seq_vars *obd_vars;
+       struct lprocfs_vars     *obd_vars;
        atomic_t                obd_evict_inprogress;
        wait_queue_head_t       obd_evict_inprogress_waitq;
        struct list_head        obd_evict_list; /* protected with pet_lock */
index 7a76fd5..ff08224 100644 (file)
@@ -75,7 +75,7 @@ struct lu_device_type;
 /* genops.c */
 struct obd_export *class_conn2export(struct lustre_handle *);
 int class_register_type(struct obd_ops *, struct md_ops *, bool enable_proc,
-                       struct lprocfs_seq_vars *module_vars,
+                       struct lprocfs_vars *module_vars,
                        const char *nm, struct lu_device_type *ldt);
 int class_unregister_type(const char *nm);
 
@@ -126,7 +126,7 @@ typedef int (*llog_cb_t)(const struct lu_env *, struct llog_handle *,
 struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
                                     const char *new_name);
 int class_process_config(struct lustre_cfg *lcfg);
-int class_process_proc_param(char *prefix, struct lprocfs_seq_vars *lvars,
+int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                             struct lustre_cfg *lcfg, void *data);
 int class_attach(struct lustre_cfg *lcfg);
 int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
index 6d2fc61..ca1e15d 100644 (file)
@@ -288,13 +288,13 @@ typedef enum ldlm_policy_res ldlm_policy_res_t;
        struct __##var##__dummy_write {;} /* semicolon catcher */
 
 static inline void
-ldlm_add_var(struct lprocfs_seq_vars *vars, struct proc_dir_entry *proc_dir,
+ldlm_add_var(struct lprocfs_vars *vars, struct proc_dir_entry *proc_dir,
             const char *name, void *data, const struct file_operations *ops)
 {
        snprintf((char *)vars->name, MAX_STRING_SIZE, "%s", name);
        vars->data = data;
        vars->fops = ops;
-       lprocfs_seq_add_vars(proc_dir, vars, 0);
+       lprocfs_add_vars(proc_dir, vars, 0);
 }
 
 static inline int is_granted_or_cancelled(struct ldlm_lock *lock)
index a526f08..7f4352f 100644 (file)
@@ -734,7 +734,7 @@ static int ldlm_pool_proc_init(struct ldlm_pool *pl)
 {
        struct ldlm_namespace *ns = ldlm_pl2ns(pl);
        struct proc_dir_entry *parent_ns_proc;
-       struct lprocfs_seq_vars pool_vars[2];
+       struct lprocfs_vars pool_vars[2];
        char *var_name = NULL;
        int rc = 0;
        ENTRY;
@@ -749,8 +749,7 @@ static int ldlm_pool_proc_init(struct ldlm_pool *pl)
                       ldlm_ns_name(ns));
                GOTO(out_free_name, rc = -EINVAL);
        }
-       pl->pl_proc_dir = lprocfs_seq_register("pool", parent_ns_proc,
-                                               NULL, NULL);
+       pl->pl_proc_dir = lprocfs_register("pool", parent_ns_proc, NULL, NULL);
        if (IS_ERR(pl->pl_proc_dir)) {
                rc = PTR_ERR(pl->pl_proc_dir);
                pl->pl_proc_dir = NULL;
index bed49ee..cb5c05f 100644 (file)
@@ -88,7 +88,7 @@ LPROC_SEQ_FOPS_RO_TYPE(ldlm, uint);
 int ldlm_proc_setup(void)
 {
        int rc;
-       struct lprocfs_seq_vars list[] = {
+       struct lprocfs_vars list[] = {
                { .name =       "dump_namespaces",
                  .fops =       &ldlm_dump_ns_fops,
                  .proc_mode =  0222 },
@@ -102,34 +102,31 @@ int ldlm_proc_setup(void)
        ENTRY;
        LASSERT(ldlm_ns_proc_dir == NULL);
 
-       ldlm_type_proc_dir = lprocfs_seq_register(OBD_LDLM_DEVICENAME,
-                                                       proc_lustre_root,
-                                                       NULL, NULL);
+       ldlm_type_proc_dir = lprocfs_register(OBD_LDLM_DEVICENAME,
+                                             proc_lustre_root, NULL, NULL);
        if (IS_ERR(ldlm_type_proc_dir)) {
                CERROR("LProcFS failed in ldlm-init\n");
                rc = PTR_ERR(ldlm_type_proc_dir);
                GOTO(err, rc);
        }
 
-       ldlm_ns_proc_dir = lprocfs_seq_register("namespaces",
-                                               ldlm_type_proc_dir,
-                                               NULL, NULL);
+       ldlm_ns_proc_dir = lprocfs_register("namespaces", ldlm_type_proc_dir,
+                                           NULL, NULL);
        if (IS_ERR(ldlm_ns_proc_dir)) {
                CERROR("LProcFS failed in ldlm-init\n");
                rc = PTR_ERR(ldlm_ns_proc_dir);
                GOTO(err_type, rc);
        }
 
-       ldlm_svc_proc_dir = lprocfs_seq_register("services",
-                                               ldlm_type_proc_dir,
-                                               NULL, NULL);
+       ldlm_svc_proc_dir = lprocfs_register("services", ldlm_type_proc_dir,
+                                            NULL, NULL);
        if (IS_ERR(ldlm_svc_proc_dir)) {
                CERROR("LProcFS failed in ldlm-init\n");
                rc = PTR_ERR(ldlm_svc_proc_dir);
                GOTO(err_ns, rc);
        }
 
-       rc = lprocfs_seq_add_vars(ldlm_type_proc_dir, list, NULL);
+       rc = lprocfs_add_vars(ldlm_type_proc_dir, list, NULL);
        if (rc != 0) {
                CERROR("LProcFS failed in ldlm-init\n");
                GOTO(err_svc, rc);
@@ -326,7 +323,7 @@ void ldlm_namespace_proc_unregister(struct ldlm_namespace *ns)
 
 int ldlm_namespace_proc_register(struct ldlm_namespace *ns)
 {
-       struct lprocfs_seq_vars lock_vars[2];
+       struct lprocfs_vars lock_vars[2];
         char lock_name[MAX_STRING_SIZE + 1];
        struct proc_dir_entry *ns_pde;
 
index b71ab58..fb45474 100644 (file)
@@ -714,7 +714,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                                 struct super_block *sb, char *osc, char *mdc);
 void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi);
 void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count);
-extern struct lprocfs_seq_vars lprocfs_llite_obd_vars[];
+extern struct lprocfs_vars lprocfs_llite_obd_vars[];
 #else
 static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                         struct super_block *sb, char *osc, char *mdc){return 0;}
index a4d374e..154a949 100644 (file)
@@ -959,7 +959,7 @@ static ssize_t ll_nosquash_nids_seq_write(struct file *file,
 }
 LPROC_SEQ_FOPS(ll_nosquash_nids);
 
-struct lprocfs_seq_vars lprocfs_llite_obd_vars[] = {
+struct lprocfs_vars lprocfs_llite_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &ll_sb_uuid_fops                        },
        { .name =       "fstype",
@@ -1122,7 +1122,7 @@ LPROC_SEQ_FOPS_RO_TYPE(llite, uuid);
 int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                                 struct super_block *sb, char *osc, char *mdc)
 {
-       struct lprocfs_seq_vars lvars[2];
+       struct lprocfs_vars lvars[2];
        struct lustre_sb_info *lsi = s2lsi(sb);
        struct ll_sb_info *sbi = ll_s2sbi(sb);
        struct obd_device *obd;
@@ -1150,7 +1150,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
        snprintf(name, MAX_STRING_SIZE, "%.*s-%p", len,
                 lsi->lsi_lmd->lmd_profile, sb);
 
-       sbi->ll_proc_root = lprocfs_seq_register(name, parent, NULL, NULL);
+       sbi->ll_proc_root = lprocfs_register(name, parent, NULL, NULL);
        if (IS_ERR(sbi->ll_proc_root)) {
                err = PTR_ERR(sbi->ll_proc_root);
                sbi->ll_proc_root = NULL;
@@ -1215,7 +1215,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                 GOTO(out, err);
 
 
-       err = lprocfs_seq_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb);
+       err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb);
        if (err)
                GOTO(out, err);
 
@@ -1232,13 +1232,13 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 
        snprintf(name, MAX_STRING_SIZE, "common_name");
        lvars[0].fops = &llite_name_fops;
-       err = lprocfs_seq_add_vars(dir, lvars, obd);
+       err = lprocfs_add_vars(dir, lvars, obd);
        if (err)
                GOTO(out, err);
 
        snprintf(name, MAX_STRING_SIZE, "uuid");
        lvars[0].fops = &llite_uuid_fops;
-       err = lprocfs_seq_add_vars(dir, lvars, obd);
+       err = lprocfs_add_vars(dir, lvars, obd);
        if (err)
                GOTO(out, err);
 
@@ -1255,13 +1255,13 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
 
        snprintf(name, MAX_STRING_SIZE, "common_name");
        lvars[0].fops = &llite_name_fops;
-       err = lprocfs_seq_add_vars(dir, lvars, obd);
+       err = lprocfs_add_vars(dir, lvars, obd);
        if (err)
                GOTO(out, err);
 
        snprintf(name, MAX_STRING_SIZE, "uuid");
        lvars[0].fops = &llite_uuid_fops;
-       err = lprocfs_seq_add_vars(dir, lvars, obd);
+       err = lprocfs_add_vars(dir, lvars, obd);
 out:
        if (err) {
                lprocfs_remove(&sbi->ll_proc_root);
index 6267c54..8ebe89c 100644 (file)
@@ -141,7 +141,7 @@ static int __init init_lustre_lite(void)
        if (ll_rmtperm_hash_cachep == NULL)
                GOTO(out_cache, rc = -ENOMEM);
 
-       entry = lprocfs_seq_register("llite", proc_lustre_root, NULL, NULL);
+       entry = lprocfs_register("llite", proc_lustre_root, NULL, NULL);
        if (IS_ERR(entry)) {
                rc = PTR_ERR(entry);
                CERROR("cannot register '/proc/fs/lustre/llite': rc = %d\n",
index 82780bb..fd4dc79 100644 (file)
@@ -163,7 +163,7 @@ struct lmv_tgt_desc
                struct lu_fid *fid);
 /* lproc_lmv.c */
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_lmv_obd_vars[];
+extern struct lprocfs_vars lprocfs_lmv_obd_vars[];
 #endif
 extern struct file_operations lmv_proc_target_fops;
 
index 2a0746d..540f479 100644 (file)
@@ -234,9 +234,9 @@ static int lmv_connect(const struct lu_env *env,
                 lmv->conn_data = *data;
 
        if (lmv->targets_proc_entry == NULL) {
-               lmv->targets_proc_entry = lprocfs_seq_register("target_obds",
-                                                       obd->obd_proc_entry,
-                                                       NULL, NULL);
+               lmv->targets_proc_entry = lprocfs_register("target_obds",
+                                                          obd->obd_proc_entry,
+                                                          NULL, NULL);
                if (IS_ERR(lmv->targets_proc_entry)) {
                        CERROR("%s: cannot register "
                               "/proc/fs/lustre/%s/%s/target_obds\n",
index 26461c7..ead5670 100644 (file)
@@ -203,7 +203,7 @@ static int lmv_target_seq_open(struct inode *inode, struct file *file)
 
 LPROC_SEQ_FOPS_RO_TYPE(lmv, uuid);
 
-struct lprocfs_seq_vars lprocfs_lmv_obd_vars[] = {
+struct lprocfs_vars lprocfs_lmv_obd_vars[] = {
        { .name =       "numobd",
          .fops =       &lmv_numobd_fops        },
        { .name =       "placement",
index fd51f33..e0f1003 100644 (file)
@@ -1195,8 +1195,8 @@ static int __init lod_mod_init(void)
                return rc;
 
        type = class_search_type(LUSTRE_LOD_NAME);
-       type->typ_procsym = lprocfs_seq_register("lov", proc_lustre_root,
-                                                NULL, NULL);
+       type->typ_procsym = lprocfs_register("lov", proc_lustre_root,
+                                            NULL, NULL);
        if (IS_ERR(type->typ_procsym)) {
                CERROR("lod: can't create compat entry \"lov\": %d\n",
                       (int)PTR_ERR(type->typ_procsym));
index 08c5673..3511dbb 100644 (file)
@@ -705,7 +705,7 @@ lod_lmv_failout_seq_write(struct file *file, const char *buffer,
 }
 LPROC_SEQ_FOPS(lod_lmv_failout);
 
-static struct lprocfs_seq_vars lprocfs_lod_obd_vars[] = {
+static struct lprocfs_vars lprocfs_lod_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &lod_uuid_fops          },
        { .name =       "stripesize",
@@ -733,7 +733,7 @@ static struct lprocfs_seq_vars lprocfs_lod_obd_vars[] = {
        { 0 }
 };
 
-static struct lprocfs_seq_vars lprocfs_lod_osd_vars[] = {
+static struct lprocfs_vars lprocfs_lod_osd_vars[] = {
        { "blocksize",          &lod_dt_blksize_fops            },
        { "kbytestotal",        &lod_dt_kbytestotal_fops        },
        { "kbytesfree",         &lod_dt_kbytesfree_fops         },
@@ -774,8 +774,8 @@ int lod_procfs_init(struct lod_device *lod)
                RETURN(rc);
        }
 
-       rc = lprocfs_seq_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
-                                 &lod->lod_dt_dev);
+       rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_lod_osd_vars,
+                             &lod->lod_dt_dev);
        if (rc) {
                CERROR("%s: cannot setup procfs entry: %d\n",
                       obd->obd_name, rc);
@@ -790,9 +790,9 @@ int lod_procfs_init(struct lod_device *lod)
                GOTO(out, rc);
        }
 
-       lod->lod_pool_proc_entry = lprocfs_seq_register("pools",
-                                                       obd->obd_proc_entry,
-                                                       NULL, NULL);
+       lod->lod_pool_proc_entry = lprocfs_register("pools",
+                                                   obd->obd_proc_entry,
+                                                   NULL, NULL);
        if (IS_ERR(lod->lod_pool_proc_entry)) {
                rc = PTR_ERR(lod->lod_pool_proc_entry);
                lod->lod_pool_proc_entry = NULL;
index 9509ef6..a40b53b 100644 (file)
@@ -212,7 +212,7 @@ void dump_lsm(unsigned int level, const struct lov_stripe_md *lsm);
 /* lproc_lov.c */
 extern struct file_operations lov_proc_target_fops;
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_lov_obd_vars[];
+extern struct lprocfs_vars lprocfs_lov_obd_vars[];
 #endif
 
 /* lov_cl.c */
index 2ef90db..37cd4bd 100644 (file)
@@ -238,9 +238,9 @@ static int lov_connect(const struct lu_env *env,
         if (data)
                 lov->lov_ocd = *data;
 
-       lov->targets_proc_entry = lprocfs_seq_register("target_obds",
-                                                      obd->obd_proc_entry,
-                                                      NULL, NULL);
+       lov->targets_proc_entry = lprocfs_register("target_obds",
+                                                  obd->obd_proc_entry,
+                                                  NULL, NULL);
        if (IS_ERR(lov->targets_proc_entry)) {
                CERROR("%s: cannot register "
                       "/proc/fs/lustre/%s/%s/target_obds\n",
@@ -848,9 +848,9 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         * Instead we use type->typ_procsym as the parent. */
        type = class_search_type(LUSTRE_LOD_NAME);
        if (type != NULL && type->typ_procsym != NULL) {
-               obd->obd_proc_entry = lprocfs_seq_register(obd->obd_name,
-                                                          type->typ_procsym,
-                                                          obd->obd_vars, obd);
+               obd->obd_proc_entry = lprocfs_register(obd->obd_name,
+                                                      type->typ_procsym,
+                                                      obd->obd_vars, obd);
                if (IS_ERR(obd->obd_proc_entry)) {
                        rc = PTR_ERR(obd->obd_proc_entry);
                        CERROR("error %d setting up lprocfs for %s\n", rc,
@@ -867,9 +867,9 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
                if (rc)
                        CWARN("Error adding the target_obd file\n");
 
-               lov->lov_pool_proc_entry = lprocfs_seq_register("pools",
-                                                       obd->obd_proc_entry,
-                                                       NULL, NULL);
+               lov->lov_pool_proc_entry = lprocfs_register("pools",
+                                                           obd->obd_proc_entry,
+                                                           NULL, NULL);
                if (IS_ERR(lov->lov_pool_proc_entry)) {
                        rc = PTR_ERR(lov->lov_pool_proc_entry);
                        CERROR("error %d setting up lprocfs for pools\n", rc);
index e8f9abb..f19d249 100644 (file)
@@ -266,7 +266,7 @@ LPROC_SEQ_FOPS_RO_TYPE(lov, kbytestotal);
 LPROC_SEQ_FOPS_RO_TYPE(lov, kbytesfree);
 LPROC_SEQ_FOPS_RO_TYPE(lov, kbytesavail);
 
-struct lprocfs_seq_vars lprocfs_lov_obd_vars[] = {
+struct lprocfs_vars lprocfs_lov_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &lov_uuid_fops          },
        { .name =       "stripesize",
index d6b9c26..a043c76 100644 (file)
@@ -98,7 +98,7 @@ LPROC_SEQ_FOPS_RO(mdc_obd_max_pages_per_rpc);
 LPROC_SEQ_FOPS_RW_TYPE(mdc, import);
 LPROC_SEQ_FOPS_RW_TYPE(mdc, pinger_recov);
 
-struct lprocfs_seq_vars lprocfs_mdc_obd_vars[] = {
+struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mdc_uuid_fops          },
        { .name =       "ping",
index 56798e1..cd2017e 100644 (file)
@@ -40,7 +40,7 @@
 #include <lustre_mdc.h>
 
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_mdc_obd_vars[];
+extern struct lprocfs_vars lprocfs_mdc_obd_vars[];
 #endif
 
 void mdc_pack_body(struct ptlrpc_request *req, const struct lu_fid *fid,
index ca52771..636d297 100644 (file)
@@ -276,7 +276,7 @@ static int mdd_lfsck_layout_seq_show(struct seq_file *m, void *data)
 }
 LPROC_SEQ_FOPS_RO(mdd_lfsck_layout);
 
-static struct lprocfs_seq_vars lprocfs_mdd_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
        { .name =       "atime_diff",
          .fops =       &mdd_atime_diff_fops            },
        { .name =       "changelog_mask",
@@ -313,8 +313,8 @@ int mdd_procfs_init(struct mdd_device *mdd, const char *name)
 
        /* Find the type procroot and add the proc entry for this device */
        obd->obd_vars = lprocfs_mdd_obd_vars;
-       mdd->mdd_proc_entry = lprocfs_seq_register(name, type->typ_procroot,
-                                                  obd->obd_vars, mdd);
+       mdd->mdd_proc_entry = lprocfs_register(name, type->typ_procroot,
+                                              obd->obd_vars, mdd);
        if (IS_ERR(mdd->mdd_proc_entry)) {
                rc = PTR_ERR(mdd->mdd_proc_entry);
                CERROR("Error %d setting up lprocfs for %s\n",
index ac5518f..f2fd1d6 100644 (file)
@@ -45,7 +45,7 @@
 #include <lustre_log.h>
 #include "mdt_internal.h"
 
-static struct lprocfs_seq_vars lprocfs_mdt_hsm_vars[];
+static struct lprocfs_vars lprocfs_mdt_hsm_vars[];
 
 /**
  * get obj and HSM attributes on a fid
@@ -400,7 +400,7 @@ int hsm_cdt_procfs_init(struct mdt_device *mdt)
        ENTRY;
 
        /* init /proc entries, failure is not critical */
-       cdt->cdt_proc_dir = lprocfs_seq_register("hsm",
+       cdt->cdt_proc_dir = lprocfs_register("hsm",
                                             mdt2obd_dev(mdt)->obd_proc_entry,
                                             lprocfs_mdt_hsm_vars, mdt);
        if (IS_ERR(cdt->cdt_proc_dir)) {
@@ -432,7 +432,7 @@ void  hsm_cdt_procfs_fini(struct mdt_device *mdt)
  * \param none
  * \retval var vector
  */
-struct lprocfs_seq_vars *hsm_cdt_get_proc_vars(void)
+struct lprocfs_vars *hsm_cdt_get_proc_vars(void)
 {
        return lprocfs_mdt_hsm_vars;
 }
@@ -2212,7 +2212,7 @@ LPROC_SEQ_FOPS(mdt_hsm_user_request_mask);
 LPROC_SEQ_FOPS(mdt_hsm_group_request_mask);
 LPROC_SEQ_FOPS(mdt_hsm_other_request_mask);
 
-static struct lprocfs_seq_vars lprocfs_mdt_hsm_vars[] = {
+static struct lprocfs_vars lprocfs_mdt_hsm_vars[] = {
        { .name =       "agents",
          .fops =       &mdt_hsm_agent_fops                     },
        { .name =       "actions",
index 68750e0..25e7d22 100644 (file)
@@ -917,7 +917,7 @@ ssize_t mdt_hsm_cdt_control_seq_write(struct file *file, const char *buffer,
 int mdt_hsm_cdt_control_seq_show(struct seq_file *m, void *data);
 int hsm_cdt_procfs_init(struct mdt_device *mdt);
 void hsm_cdt_procfs_fini(struct mdt_device *mdt);
-struct lprocfs_seq_vars *hsm_cdt_get_proc_vars(void);
+struct lprocfs_vars *hsm_cdt_get_proc_vars(void);
 /* md_hsm helpers */
 struct mdt_object *mdt_hsm_get_md_hsm(struct mdt_thread_info *mti,
                                      const struct lu_fid *fid,
index f8d0c0a..b843ae7 100644 (file)
@@ -825,7 +825,7 @@ LPROC_SEQ_FOPS_RW_TYPE(mdt, ir_factor);
 LPROC_SEQ_FOPS_RW_TYPE(mdt, nid_stats_clear);
 LPROC_SEQ_FOPS(mdt_hsm_cdt_control);
 
-static struct lprocfs_seq_vars lprocfs_mdt_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mdt_uuid_fops                          },
        { .name =       "recovery_status",
index cb28d88..d990f24 100644 (file)
@@ -466,7 +466,7 @@ static struct lu_device *mds_device_free(const struct lu_env *env,
 
 LPROC_SEQ_FOPS_RO_TYPE(mds, uuid);
 
-static struct lprocfs_seq_vars lprocfs_mds_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mds_obd_vars[] = {
        { "uuid",       &mds_uuid_fops  },
        { 0 }
 };
index f818def..8cfbb5c 100644 (file)
@@ -58,7 +58,7 @@ static int mgc_ir_state_seq_show(struct seq_file *m, void *v)
 }
 LPROC_SEQ_FOPS_RO(mgc_ir_state);
 
-struct lprocfs_seq_vars lprocfs_mgc_obd_vars[] = {
+struct lprocfs_vars lprocfs_mgc_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mgc_uuid_fops          },
        { .name =       "ping",
index 292a212..12830b9 100644 (file)
@@ -45,7 +45,7 @@
 #include <lustre_export.h>
 
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_mgc_obd_vars[];
+extern struct lprocfs_vars lprocfs_mgc_obd_vars[];
 int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data);
 #endif  /* LPROCFS */
 
index b2c5df7..1eb6483 100644 (file)
@@ -207,7 +207,7 @@ LPROC_SEQ_FOPS_RO_TYPE(mgs, hash);
 LPROC_SEQ_FOPS_WO_TYPE(mgs, evict_client);
 LPROC_SEQ_FOPS_RW_TYPE(mgs, ir_timeout);
 
-struct lprocfs_seq_vars lprocfs_mgs_obd_vars[] = {
+struct lprocfs_vars lprocfs_mgs_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mgs_uuid_fops          },
        { .name =       "num_exports",
@@ -243,17 +243,17 @@ int lproc_mgs_setup(struct mgs_device *mgs, const char *osd_name)
        if (rc != 0)
                GOTO(out, rc);
 
-       mgs->mgs_proc_live = lprocfs_seq_register("live", obd->obd_proc_entry,
-                                                 NULL, NULL);
+       mgs->mgs_proc_live = lprocfs_register("live", obd->obd_proc_entry,
+                                             NULL, NULL);
         if (IS_ERR(mgs->mgs_proc_live)) {
                 rc = PTR_ERR(mgs->mgs_proc_live);
                 mgs->mgs_proc_live = NULL;
                GOTO(out, rc);
         }
 
-       obd->obd_proc_exports_entry = lprocfs_seq_register("exports",
-                                                          obd->obd_proc_entry,
-                                                          NULL, NULL);
+       obd->obd_proc_exports_entry = lprocfs_register("exports",
+                                                      obd->obd_proc_entry,
+                                                      NULL, NULL);
         if (IS_ERR(obd->obd_proc_exports_entry)) {
                 rc = PTR_ERR(obd->obd_proc_exports_entry);
                 obd->obd_proc_exports_entry = NULL;
index 37c11ad..d7bcecf 100644 (file)
@@ -158,7 +158,7 @@ EXPORT_SYMBOL(class_put_type);
 #define CLASS_MAX_NAME 1024
 
 int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
-                       bool enable_proc, struct lprocfs_seq_vars *vars,
+                       bool enable_proc, struct lprocfs_vars *vars,
                        const char *name, struct lu_device_type *ldt)
 {
         struct obd_type *type;
@@ -196,9 +196,9 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
 
 #ifdef LPROCFS
        if (enable_proc) {
-               type->typ_procroot = lprocfs_seq_register(type->typ_name,
-                                                         proc_lustre_root,
-                                                         vars, type);
+               type->typ_procroot = lprocfs_register(type->typ_name,
+                                                     proc_lustre_root,
+                                                     vars, type);
                if (IS_ERR(type->typ_procroot)) {
                        rc = PTR_ERR(type->typ_procroot);
                        type->typ_procroot = NULL;
@@ -222,15 +222,9 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops,
 failed:
        if (type->typ_name != NULL) {
 #ifdef LPROCFS
-               if (type->typ_procroot != NULL) {
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                       lprocfs_try_remove_proc_entry(type->typ_name,
-                                                     proc_lustre_root);
-#else
+               if (type->typ_procroot != NULL)
                        remove_proc_subtree(type->typ_name, proc_lustre_root);
 #endif
-               }
-#endif
                 OBD_FREE(type->typ_name, strlen(name) + 1);
        }
         if (type->typ_md_ops != NULL)
@@ -266,14 +260,8 @@ int class_unregister_type(const char *name)
         * we can't reference pointer as it can get invalided when another
         * module removes the entry */
 #ifdef LPROCFS
-       if (type->typ_procroot != NULL) {
-#ifndef HAVE_ONLY_PROCFS_SEQ
-               lprocfs_try_remove_proc_entry(type->typ_name, proc_lustre_root);
-#else
+       if (type->typ_procroot != NULL)
                remove_proc_subtree(type->typ_name, proc_lustre_root);
-#endif
-       }
-
        if (type->typ_procsym != NULL)
                lprocfs_remove(&type->typ_procsym);
 #endif
index 8b114d2..53bf615 100644 (file)
@@ -313,7 +313,7 @@ LPROC_SEQ_FOPS(obd_proc_jobid_var);
 struct proc_dir_entry *proc_lustre_root = NULL;
 EXPORT_SYMBOL(proc_lustre_root);
 
-struct lprocfs_seq_vars lprocfs_base[] = {
+struct lprocfs_vars lprocfs_base[] = {
        { .name =       "version",
          .fops =       &obd_proc_version_fops  },
        { .name =       "pinger",
@@ -412,7 +412,7 @@ int class_procfs_init(void)
 
        obd_sysctl_init();
 
-       entry = lprocfs_seq_register("fs/lustre", NULL, lprocfs_base, NULL);
+       entry = lprocfs_register("fs/lustre", NULL, lprocfs_base, NULL);
        if (IS_ERR(entry)) {
                rc = PTR_ERR(entry);
                CERROR("cannot create '/proc/fs/lustre': rc = %d\n", rc);
index b469fad..c52e301 100644 (file)
@@ -117,204 +117,7 @@ struct proc_dir_entry *lprocfs_add_symlink(const char *name,
 }
 EXPORT_SYMBOL(lprocfs_add_symlink);
 
-#ifdef HAVE_ONLY_PROCFS_SEQ
 static const struct file_operations lprocfs_generic_fops = { };
-#else
-
-ssize_t
-lprocfs_fops_read(struct file *f, char __user *buf, size_t size, loff_t *ppos)
-{
-        struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
-        char *page, *start = NULL;
-        int rc = 0, eof = 1, count;
-
-       if (*ppos >= PAGE_CACHE_SIZE)
-                return 0;
-
-        page = (char *)__get_free_page(GFP_KERNEL);
-        if (page == NULL)
-                return -ENOMEM;
-
-       if (LPROCFS_ENTRY_CHECK(dp)) {
-                rc = -ENOENT;
-                goto out;
-        }
-
-        OBD_FAIL_TIMEOUT(OBD_FAIL_LPROC_REMOVE, 10);
-        if (dp->read_proc)
-               rc = dp->read_proc(page, &start, *ppos, PAGE_CACHE_SIZE,
-                                   &eof, dp->data);
-        if (rc <= 0)
-                goto out;
-
-        /* for lustre proc read, the read count must be less than PAGE_SIZE */
-        LASSERT(eof == 1);
-
-        if (start == NULL) {
-                rc -= *ppos;
-                if (rc < 0)
-                        rc = 0;
-                if (rc == 0)
-                        goto out;
-                start = page + *ppos;
-        } else if (start < page) {
-                start = page;
-        }
-
-        count = (rc < size) ? rc : size;
-       if (copy_to_user(buf, start, count)) {
-                rc = -EFAULT;
-                goto out;
-        }
-        *ppos += count;
-
-out:
-        free_page((unsigned long)page);
-        return rc;
-}
-
-ssize_t
-lprocfs_fops_write(struct file *f, const char __user *buf, size_t size,
-                  loff_t *ppos)
-{
-        struct proc_dir_entry *dp = PDE(f->f_dentry->d_inode);
-        int rc = -EIO;
-
-       if (LPROCFS_ENTRY_CHECK(dp))
-                return -ENOENT;
-        if (dp->write_proc)
-                rc = dp->write_proc(f, buf, size, dp->data);
-        return rc;
-}
-
-static struct file_operations lprocfs_generic_fops = {
-        .owner = THIS_MODULE,
-        .read = lprocfs_fops_read,
-        .write = lprocfs_fops_write,
-};
-
-/* for b=10866, global variable */
-DECLARE_RWSEM(_lprocfs_lock);
-EXPORT_SYMBOL(_lprocfs_lock);
-
-static struct proc_dir_entry *__lprocfs_srch(struct proc_dir_entry *head,
-                                            const char *name)
-{
-       struct proc_dir_entry *temp;
-
-       if (head == NULL)
-               return NULL;
-
-       temp = head->subdir;
-       while (temp != NULL) {
-               if (strcmp(temp->name, name) == 0)
-                       return temp;
-               temp = temp->next;
-       }
-       return NULL;
-}
-
-struct proc_dir_entry *lprocfs_srch(struct proc_dir_entry *head,
-                                   const char *name)
-{
-       struct proc_dir_entry *temp;
-
-       LPROCFS_SRCH_ENTRY();
-       temp = __lprocfs_srch(head, name);
-       LPROCFS_SRCH_EXIT();
-       return temp;
-}
-EXPORT_SYMBOL(lprocfs_srch);
-
-static int __lprocfs_add_vars(struct proc_dir_entry *root,
-                             struct lprocfs_vars *list,
-                             void *data)
-{
-        int rc = 0;
-
-        if (root == NULL || list == NULL)
-                return -EINVAL;
-
-        while (list->name != NULL) {
-                struct proc_dir_entry *cur_root, *proc;
-                char *pathcopy, *cur, *next, pathbuf[64];
-                int pathsize = strlen(list->name) + 1;
-
-                proc = NULL;
-                cur_root = root;
-
-                /* need copy of path for strsep */
-                if (strlen(list->name) > sizeof(pathbuf) - 1) {
-                        OBD_ALLOC(pathcopy, pathsize);
-                        if (pathcopy == NULL)
-                                GOTO(out, rc = -ENOMEM);
-                } else {
-                        pathcopy = pathbuf;
-                }
-
-                next = pathcopy;
-                strcpy(pathcopy, list->name);
-
-                while (cur_root != NULL && (cur = strsep(&next, "/"))) {
-                        if (*cur =='\0') /* skip double/trailing "/" */
-                                continue;
-
-                        proc = __lprocfs_srch(cur_root, cur);
-                        CDEBUG(D_OTHER, "cur_root=%s, cur=%s, next=%s, (%s)\n",
-                               cur_root->name, cur, next,
-                               (proc ? "exists" : "new"));
-                        if (next != NULL) {
-                                cur_root = (proc ? proc :
-                                            proc_mkdir(cur, cur_root));
-                        } else if (proc == NULL) {
-                                mode_t mode = 0;
-                                if (list->proc_mode != 0000) {
-                                        mode = list->proc_mode;
-                                } else {
-                                        if (list->read_fptr)
-                                                mode = 0444;
-                                        if (list->write_fptr)
-                                                mode |= 0200;
-                                }
-                                proc = create_proc_entry(cur, mode, cur_root);
-                        }
-                }
-
-                if (pathcopy != pathbuf)
-                        OBD_FREE(pathcopy, pathsize);
-
-                if (cur_root == NULL || proc == NULL) {
-                       CERROR("LprocFS: No memory to create /proc entry %s\n",
-                              list->name);
-                       GOTO(out, rc = -ENOMEM);
-                }
-
-                if (list->fops)
-                        proc->proc_fops = list->fops;
-                else
-                        proc->proc_fops = &lprocfs_generic_fops;
-                proc->read_proc = list->read_fptr;
-                proc->write_proc = list->write_fptr;
-                proc->data = (list->data ? list->data : data);
-                list++;
-        }
-out:
-        return rc;
-}
-
-int lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
-                    void *data)
-{
-       int rc = 0;
-
-       LPROCFS_WRITE_ENTRY();
-       rc = __lprocfs_add_vars(root, list, data);
-       LPROCFS_WRITE_EXIT();
-
-       return rc;
-}
-EXPORT_SYMBOL(lprocfs_add_vars);
-#endif
 
 /**
  * Add /proc entries.
@@ -328,8 +131,8 @@ EXPORT_SYMBOL(lprocfs_add_vars);
  *         < 0 on error
  */
 int
-lprocfs_seq_add_vars(struct proc_dir_entry *root, struct lprocfs_seq_vars *list,
-                    void *data)
+lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list,
+                void *data)
 {
        if (root == NULL || list == NULL)
                return -EINVAL;
@@ -355,9 +158,13 @@ lprocfs_seq_add_vars(struct proc_dir_entry *root, struct lprocfs_seq_vars *list,
        }
        return 0;
 }
-EXPORT_SYMBOL(lprocfs_seq_add_vars);
+EXPORT_SYMBOL(lprocfs_add_vars);
 
 #ifndef HAVE_ONLY_PROCFS_SEQ
+/* for b=10866, global variable */
+DECLARE_RWSEM(_lprocfs_lock);
+EXPORT_SYMBOL(_lprocfs_lock);
+
 void lprocfs_remove_nolock(struct proc_dir_entry **proot)
 {
        struct proc_dir_entry *root = *proot;
@@ -390,31 +197,8 @@ void lprocfs_remove_nolock(struct proc_dir_entry **proot)
                         break;
         }
 }
-#endif
 
-void lprocfs_remove(struct proc_dir_entry **rooth)
-{
-#ifndef HAVE_ONLY_PROCFS_SEQ
-       LPROCFS_WRITE_ENTRY(); /* search vs remove race */
-       lprocfs_remove_nolock(rooth);
-       LPROCFS_WRITE_EXIT();
-#else
-       proc_remove(*rooth);
-       *rooth = NULL;
-#endif
-}
-EXPORT_SYMBOL(lprocfs_remove);
-
-void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent)
-{
-        LASSERT(parent != NULL);
-        remove_proc_entry(name, parent);
-}
-EXPORT_SYMBOL(lprocfs_remove_proc_entry);
-
-#ifndef HAVE_ONLY_PROCFS_SEQ
-void lprocfs_try_remove_proc_entry(const char *name,
-                                  struct proc_dir_entry *parent)
+void remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
 {
        struct proc_dir_entry    *t = NULL;
        struct proc_dir_entry   **p;
@@ -457,43 +241,32 @@ void lprocfs_try_remove_proc_entry(const char *name,
 
        return;
 }
-EXPORT_SYMBOL(lprocfs_try_remove_proc_entry);
+EXPORT_SYMBOL(remove_proc_subtree);
+#endif
 
-struct proc_dir_entry *lprocfs_register(const char *name,
-                                       struct proc_dir_entry *parent,
-                                       struct lprocfs_vars *list, void *data)
+void lprocfs_remove(struct proc_dir_entry **rooth)
 {
-       struct proc_dir_entry *entry;
-       int rc;
-
-       LPROCFS_WRITE_ENTRY();
-       entry = __lprocfs_srch(parent, name);
-       if (entry != NULL) {
-               CERROR("entry '%s' already registered\n", name);
-               GOTO(out, entry = ERR_PTR(-EALREADY));
-       }
-
-       entry = proc_mkdir(name, parent);
-       if (entry == NULL)
-               GOTO(out, entry = ERR_PTR(-ENOMEM));
-
-       if (list != NULL) {
-               rc = __lprocfs_add_vars(entry, list, data);
-               if (rc != 0) {
-                       lprocfs_remove_nolock(&entry);
-                       GOTO(out, entry = ERR_PTR(rc));
-               }
-       }
-out:
+#ifndef HAVE_ONLY_PROCFS_SEQ
+       LPROCFS_WRITE_ENTRY(); /* search vs remove race */
+       lprocfs_remove_nolock(rooth);
        LPROCFS_WRITE_EXIT();
-       return entry;
-}
-EXPORT_SYMBOL(lprocfs_register);
+#else
+       proc_remove(*rooth);
+       *rooth = NULL;
 #endif
+}
+EXPORT_SYMBOL(lprocfs_remove);
+
+void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent)
+{
+       LASSERT(parent != NULL);
+       remove_proc_entry(name, parent);
+}
+EXPORT_SYMBOL(lprocfs_remove_proc_entry);
 
 struct proc_dir_entry *
-lprocfs_seq_register(const char *name, struct proc_dir_entry *parent,
-                    struct lprocfs_seq_vars *list, void *data)
+lprocfs_register(const char *name, struct proc_dir_entry *parent,
+                struct lprocfs_vars *list, void *data)
 {
        struct proc_dir_entry *newchild;
 
@@ -502,7 +275,7 @@ lprocfs_seq_register(const char *name, struct proc_dir_entry *parent,
                return ERR_PTR(-ENOMEM);
 
        if (list != NULL) {
-               int rc = lprocfs_seq_add_vars(newchild, list, data);
+               int rc = lprocfs_add_vars(newchild, list, data);
                if (rc) {
                        lprocfs_remove(&newchild);
                        return ERR_PTR(rc);
@@ -510,7 +283,7 @@ lprocfs_seq_register(const char *name, struct proc_dir_entry *parent,
        }
        return newchild;
 }
-EXPORT_SYMBOL(lprocfs_seq_register);
+EXPORT_SYMBOL(lprocfs_register);
 
 /* Generic callbacks */
 int lprocfs_uint_seq_show(struct seq_file *m, void *data)
@@ -1131,7 +904,7 @@ int lprocfs_state_seq_show(struct seq_file *m, void *data)
 }
 EXPORT_SYMBOL(lprocfs_state_seq_show);
 
-int lprocfs_seq_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at)
+int lprocfs_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at)
 {
        int i;
        for (i = 0; i < AT_BINS; i++)
@@ -1139,7 +912,7 @@ int lprocfs_seq_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at)
        seq_printf(m, "\n");
        return 0;
 }
-EXPORT_SYMBOL(lprocfs_seq_at_hist_helper);
+EXPORT_SYMBOL(lprocfs_at_hist_helper);
 
 /* See also ptlrpc_lprocfs_timeouts_show_seq */
 int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
@@ -1168,7 +941,7 @@ int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
        s2dhms(&ts, now - worstt);
        seq_printf(m, "%-10s : cur %3u  worst %3u (at %ld, "DHMS_FMT" ago) ",
                   "network", cur, worst, worstt, DHMS_VARS(&ts));
-       lprocfs_seq_at_hist_helper(m, &imp->imp_at.iat_net_latency);
+       lprocfs_at_hist_helper(m, &imp->imp_at.iat_net_latency);
 
        for(i = 0; i < IMP_AT_MAX_PORTALS; i++) {
                if (imp->imp_at.iat_portal[i] == 0)
@@ -1180,7 +953,7 @@ int lprocfs_timeouts_seq_show(struct seq_file *m, void *data)
                seq_printf(m, "portal %-2d  : cur %3u  worst %3u (at %ld, "
                           DHMS_FMT" ago) ", imp->imp_at.iat_portal[i],
                           cur, worst, worstt, DHMS_VARS(&ts));
-               lprocfs_seq_at_hist_helper(m, &imp->imp_at.iat_service_estimate[i]);
+               lprocfs_at_hist_helper(m, &imp->imp_at.iat_service_estimate[i]);
        }
 
        LPROCFS_CLIMP_EXIT(obd);
@@ -1212,9 +985,9 @@ lprocfs_obd_setup(struct obd_device *obd)
        LASSERT(obd->obd_magic == OBD_DEVICE_MAGIC);
        LASSERT(obd->obd_type->typ_procroot != NULL);
 
-       obd->obd_proc_entry = lprocfs_seq_register(obd->obd_name,
-                                                  obd->obd_type->typ_procroot,
-                                                  obd->obd_vars, obd);
+       obd->obd_proc_entry = lprocfs_register(obd->obd_name,
+                                              obd->obd_type->typ_procroot,
+                                              obd->obd_vars, obd);
        if (IS_ERR(obd->obd_proc_entry)) {
                rc = PTR_ERR(obd->obd_proc_entry);
                CERROR("error %d setting up lprocfs for %s\n",rc,obd->obd_name);
index f0d0916..b48c80d 100644 (file)
@@ -334,15 +334,9 @@ int lprocfs_exp_setup(struct obd_export *exp, lnet_nid_t *nid, int *newnid)
                GOTO(destroy_new, rc = -ENOMEM);
 
        memcpy(buffer, libcfs_nid2str(*nid), LNET_NIDSTR_SIZE);
-#ifndef HAVE_ONLY_PROCFS_SEQ
        new_stat->nid_proc = lprocfs_register(buffer,
                                              obd->obd_proc_exports_entry,
                                              NULL, NULL);
-#else
-       new_stat->nid_proc = lprocfs_seq_register(buffer,
-                                                 obd->obd_proc_exports_entry,
-                                                 NULL, NULL);
-#endif
        OBD_FREE(buffer, LNET_NIDSTR_SIZE);
 
        if (IS_ERR(new_stat->nid_proc)) {
index aecfbd1..9503180 100644 (file)
@@ -1260,10 +1260,10 @@ out:
 }
 EXPORT_SYMBOL(class_process_config);
 
-int class_process_proc_param(char *prefix, struct lprocfs_seq_vars *lvars,
+int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars,
                             struct lustre_cfg *lcfg, void *data)
 {
-       struct lprocfs_seq_vars *var;
+       struct lprocfs_vars *var;
        struct file fakefile;
        struct seq_file fake_seqfile;
        char *key, *sval;
index db3fa79..930ac33 100644 (file)
@@ -558,7 +558,7 @@ commitrw_cleanup:
 }
 
 LPROC_SEQ_FOPS_RO_TYPE(echo, uuid);
-static struct lprocfs_seq_vars lprocfs_echo_obd_vars[] = {
+static struct lprocfs_vars lprocfs_echo_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &echo_uuid_fops         },
        { 0 }
index 46466a8..029ac5a 100644 (file)
@@ -983,7 +983,7 @@ LPROC_SEQ_FOPS_RO_TYPE(ofd, target_instance);
 LPROC_SEQ_FOPS_RW_TYPE(ofd, ir_factor);
 LPROC_SEQ_FOPS_RW_TYPE(ofd, job_interval);
 
-struct lprocfs_seq_vars lprocfs_ofd_obd_vars[] = {
+struct lprocfs_vars lprocfs_ofd_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &ofd_uuid_fops                  },
        { .name =       "blocksize",
index 698fd7f..25b7118 100644 (file)
@@ -697,8 +697,7 @@ static int ofd_procfs_init(struct ofd_device *ofd)
 
        obd->obd_uses_nid_stats = 1;
 
-       entry = lprocfs_seq_register("exports", obd->obd_proc_entry, NULL,
-                                    NULL);
+       entry = lprocfs_register("exports", obd->obd_proc_entry, NULL, NULL);
        if (IS_ERR(entry)) {
                rc = PTR_ERR(entry);
                CERROR("%s: error %d setting up lprocfs for %s\n",
index 92894cb..692bfef 100644 (file)
@@ -403,7 +403,7 @@ int ofd_txn_stop_cb(const struct lu_env *env, struct thandle *txn,
 
 /* lproc_ofd.c */
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_ofd_obd_vars[];
+extern struct lprocfs_vars lprocfs_ofd_obd_vars[];
 void ofd_stats_counter_init(struct lprocfs_stats *stats);
 #else
 static inline void ofd_stats_counter_init(struct lprocfs_stats *stats) {}
index 7e0c550..5cfc3f0 100644 (file)
@@ -571,7 +571,7 @@ LPROC_SEQ_FOPS_WO_TYPE(osc, ping);
 LPROC_SEQ_FOPS_RW_TYPE(osc, import);
 LPROC_SEQ_FOPS_RW_TYPE(osc, pinger_recov);
 
-struct lprocfs_seq_vars lprocfs_osc_obd_vars[] = {
+struct lprocfs_vars lprocfs_osc_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &osc_uuid_fops                  },
        { .name =       "ping",
index c26e70f..70d96ff 100644 (file)
@@ -141,7 +141,7 @@ int osc_cleanup(struct obd_device *obd);
 int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
 
 #ifdef LPROCFS
-extern struct lprocfs_seq_vars lprocfs_osc_obd_vars[];
+extern struct lprocfs_vars lprocfs_osc_obd_vars[];
 int lproc_osc_attach_seqstat(struct obd_device *dev);
 #else
 static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
index b71705e..ddefa24 100644 (file)
@@ -2952,9 +2952,9 @@ int osc_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
         * tree to type->typ_procsym instead of obd->obd_type->typ_procroot. */
        type = class_search_type(LUSTRE_OSP_NAME);
        if (type && type->typ_procsym) {
-               obd->obd_proc_entry = lprocfs_seq_register(obd->obd_name,
-                                                          type->typ_procsym,
-                                                          obd->obd_vars, obd);
+               obd->obd_proc_entry = lprocfs_register(obd->obd_name,
+                                                      type->typ_procsym,
+                                                      obd->obd_vars, obd);
                if (IS_ERR(obd->obd_proc_entry)) {
                        rc = PTR_ERR(obd->obd_proc_entry);
                        CERROR("error %d setting up lprocfs for %s\n", rc,
index 6d92a31..cacdc38 100644 (file)
@@ -644,8 +644,8 @@ static inline int __osd_xattr_set(struct osd_thread_info *info,
 
 #ifdef LPROCFS
 /* osd_lproc.c */
-extern struct lprocfs_seq_vars lprocfs_osd_obd_vars[];
-extern struct lprocfs_seq_vars lprocfs_osd_module_vars[];
+extern struct lprocfs_vars lprocfs_osd_obd_vars[];
+extern struct lprocfs_vars lprocfs_osd_module_vars[];
 int osd_procfs_init(struct osd_device *osd, const char *name);
 int osd_procfs_fini(struct osd_device *osd);
 void osd_brw_stats_update(struct osd_device *osd, struct osd_iobuf *iobuf);
index c46ef96..9ac7cb0 100644 (file)
@@ -588,7 +588,7 @@ LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_kbytesavail);
 LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_filestotal);
 LPROC_SEQ_FOPS_RO_TYPE(ldiskfs, dt_filesfree);
 
-struct lprocfs_seq_vars lprocfs_osd_obd_vars[] = {
+struct lprocfs_vars lprocfs_osd_obd_vars[] = {
        { .name =       "blocksize",
          .fops =       &ldiskfs_dt_blksize_fops        },
        { .name =       "kbytestotal",
@@ -628,7 +628,7 @@ struct lprocfs_seq_vars lprocfs_osd_obd_vars[] = {
        { 0 }
 };
 
-struct lprocfs_seq_vars lprocfs_osd_module_vars[] = {
+struct lprocfs_vars lprocfs_osd_module_vars[] = {
        { .name =       "track_declares_assert",
          .fops =       &ldiskfs_osd_track_declares_assert_fops         },
        { 0 }
@@ -652,9 +652,9 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
        LASSERT(type != NULL);
 
        /* Find the type procroot and add the proc entry for this device */
-       osd->od_proc_entry = lprocfs_seq_register(name, type->typ_procroot,
-                                                 lprocfs_osd_obd_vars,
-                                                 &osd->od_dt_dev);
+       osd->od_proc_entry = lprocfs_register(name, type->typ_procroot,
+                                             lprocfs_osd_obd_vars,
+                                             &osd->od_dt_dev);
        if (IS_ERR(osd->od_proc_entry)) {
                rc = PTR_ERR(osd->od_proc_entry);
                CERROR("Error %d setting up lprocfs for %s\n",
index 9bb7f98..ac6bd43 100644 (file)
@@ -423,7 +423,7 @@ enum {
 };
 
 /* osd_lproc.c */
-extern struct lprocfs_seq_vars lprocfs_osd_obd_vars[];
+extern struct lprocfs_vars lprocfs_osd_obd_vars[];
 
 int osd_procfs_init(struct osd_device *osd, const char *name);
 int osd_procfs_fini(struct osd_device *osd);
index f3a662c..897c751 100644 (file)
@@ -177,7 +177,7 @@ LPROC_SEQ_FOPS_RO_TYPE(zfs, dt_kbytesavail);
 LPROC_SEQ_FOPS_RO_TYPE(zfs, dt_filestotal);
 LPROC_SEQ_FOPS_RO_TYPE(zfs, dt_filesfree);
 
-struct lprocfs_seq_vars lprocfs_osd_obd_vars[] = {
+struct lprocfs_vars lprocfs_osd_obd_vars[] = {
        { .name =       "blocksize",
          .fops =       &zfs_dt_blksize_fops            },
        { .name =       "kbytestotal",
@@ -217,8 +217,9 @@ int osd_procfs_init(struct osd_device *osd, const char *name)
        LASSERT(name != NULL);
        LASSERT(type != NULL);
 
-       osd->od_proc_entry = lprocfs_seq_register(name, type->typ_procroot,
-                       lprocfs_osd_obd_vars, &osd->od_dt_dev);
+       osd->od_proc_entry = lprocfs_register(name, type->typ_procroot,
+                                             lprocfs_osd_obd_vars,
+                                             &osd->od_dt_dev);
        if (IS_ERR(osd->od_proc_entry)) {
                rc = PTR_ERR(osd->od_proc_entry);
                CERROR("Error %d setting up lprocfs for %s\n", rc, name);
index 1dd26b7..43fe272 100644 (file)
@@ -717,7 +717,7 @@ LPROC_SEQ_FOPS_RO_TYPE(osp, timeouts);
 LPROC_SEQ_FOPS_RW_TYPE(osp, import);
 LPROC_SEQ_FOPS_RO_TYPE(osp, state);
 
-static struct lprocfs_seq_vars lprocfs_osp_obd_vars[] = {
+static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &osp_uuid_fops                  },
        { .name =       "ping",
@@ -783,7 +783,7 @@ LPROC_SEQ_FOPS_RO_TYPE(osp, dt_kbytesavail);
 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filestotal);
 LPROC_SEQ_FOPS_RO_TYPE(osp, dt_filesfree);
 
-static struct lprocfs_seq_vars lprocfs_osp_osd_vars[] = {
+static struct lprocfs_vars lprocfs_osp_osd_vars[] = {
        { .name =       "blocksize",
          .fops =       &osp_dt_blksize_fops            },
        { .name =       "kbytestotal",
@@ -815,8 +815,8 @@ void osp_lprocfs_init(struct osp_device *osp)
        if (lprocfs_obd_setup(obd) != 0)
                return;
 
-       rc = lprocfs_seq_add_vars(obd->obd_proc_entry, lprocfs_osp_osd_vars,
-                                 &osp->opd_dt_dev);
+       rc = lprocfs_add_vars(obd->obd_proc_entry, lprocfs_osp_osd_vars,
+                             &osp->opd_dt_dev);
        if (rc) {
                CERROR("%s: can't register in lprocfs, rc %d\n",
                       obd->obd_name, rc);
index 00e5da0..8fe0bf3 100644 (file)
@@ -1780,8 +1780,8 @@ static int __init osp_mod_init(void)
                return rc;
 
        type = class_search_type(LUSTRE_OSP_NAME);
-       type->typ_procsym = lprocfs_seq_register("osc", proc_lustre_root,
-                                                NULL, NULL);
+       type->typ_procsym = lprocfs_register("osc", proc_lustre_root, NULL,
+                                            NULL);
        if (IS_ERR(type->typ_procsym)) {
                CERROR("osp: can't create compat entry \"osc\": %d\n",
                       (int) PTR_ERR(type->typ_procsym));
index 8a646dc..26a90b1 100644 (file)
@@ -74,7 +74,7 @@ static struct cfs_cpt_table   *ost_io_cptable;
 #ifdef LPROCFS
 LPROC_SEQ_FOPS_RO_TYPE(ost, uuid);
 
-static struct lprocfs_seq_vars lprocfs_ost_obd_vars[] = {
+static struct lprocfs_vars lprocfs_ost_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &ost_uuid_fops  },
        { 0 }
index d05d35b..73e9e66 100644 (file)
@@ -136,7 +136,7 @@ static const struct file_operations gss_proc_secinit = {
        .write = gss_proc_write_secinit,
 };
 
-static struct lprocfs_seq_vars gss_lprocfs_vars[] = {
+static struct lprocfs_vars gss_lprocfs_vars[] = {
        { .name =       "replays",
          .fops =       &gss_proc_oos_fops      },
        { .name =       "init_channel",
@@ -175,7 +175,7 @@ gss_lk_proc_dl_seq_write(struct file *file, const char *buffer,
 }
 LPROC_SEQ_FOPS(gss_lk_proc_dl);
 
-static struct lprocfs_seq_vars gss_lk_lprocfs_vars[] = {
+static struct lprocfs_vars gss_lk_lprocfs_vars[] = {
        { .name =       "debug_level",
          .fops =       &gss_lk_proc_dl_fops    },
        { NULL }
@@ -200,16 +200,16 @@ int gss_init_lproc(void)
 
        spin_lock_init(&gss_stat_oos.oos_lock);
 
-       gss_proc_root = lprocfs_seq_register("gss", sptlrpc_proc_root,
-                                               gss_lprocfs_vars, NULL);
+       gss_proc_root = lprocfs_register("gss", sptlrpc_proc_root,
+                                        gss_lprocfs_vars, NULL);
        if (IS_ERR(gss_proc_root)) {
                rc = PTR_ERR(gss_proc_root);
                gss_proc_root = NULL;
                GOTO(out, rc);
        }
 
-       gss_proc_lk = lprocfs_seq_register("lgss_keyring", gss_proc_root,
-                                               gss_lk_lprocfs_vars, NULL);
+       gss_proc_lk = lprocfs_register("lgss_keyring", gss_proc_root,
+                                      gss_lk_lprocfs_vars, NULL);
        if (IS_ERR(gss_proc_lk)) {
                rc = PTR_ERR(gss_proc_lk);
                gss_proc_lk = NULL;
index 08a2faa..1dc756a 100644 (file)
@@ -202,7 +202,7 @@ void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
                 return;
 
         if (dir) {
-               svc_procroot = lprocfs_seq_register(dir, root, NULL, NULL);
+               svc_procroot = lprocfs_register(dir, root, NULL, NULL);
                 if (IS_ERR(svc_procroot)) {
                         lprocfs_free_stats(&svc_stats);
                         return;
@@ -1022,7 +1022,7 @@ static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n)
                           DHMS_FMT" ago) ", "service",
                           cur, worst, worstt, DHMS_VARS(&ts));
 
-               lprocfs_seq_at_hist_helper(m, &svcpt->scp_at_estimate);
+               lprocfs_at_hist_helper(m, &svcpt->scp_at_estimate);
        }
 
        return 0;
@@ -1062,7 +1062,7 @@ LPROC_SEQ_FOPS(ptlrpc_lprocfs_hp_ratio);
 void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry,
                                      struct ptlrpc_service *svc)
 {
-       struct lprocfs_seq_vars lproc_vars[] = {
+       struct lprocfs_vars lproc_vars[] = {
                { .name = "high_priority_ratio",
                  .fops = &ptlrpc_lprocfs_hp_ratio_fops,
                  .data = svc },
@@ -1105,7 +1105,7 @@ void ptlrpc_lprocfs_register_service(struct proc_dir_entry *entry,
        if (svc->srv_procroot == NULL)
                return;
 
-       lprocfs_seq_add_vars(svc->srv_procroot, lproc_vars, NULL);
+       lprocfs_add_vars(svc->srv_procroot, lproc_vars, NULL);
 
        rc = lprocfs_seq_create(svc->srv_procroot, "req_history",
                                0400, &req_history_fops, svc);
index 1142ec6..0f4cfe4 100644 (file)
@@ -879,7 +879,7 @@ out:
 LPROC_SEQ_FOPS_WO_TYPE(nodemap, del_nodemap_idmap);
 #endif /* NODEMAP_PROC_DEBUG */
 
-static struct lprocfs_seq_vars lprocfs_nm_module_vars[] = {
+static struct lprocfs_vars lprocfs_nm_module_vars[] = {
        {
                .name           = "active",
                .fops           = &nodemap_active_fops,
@@ -948,7 +948,7 @@ const struct file_operations nodemap_exports_fops = {
        .release                = single_release
 };
 
-static struct lprocfs_seq_vars lprocfs_nodemap_vars[] = {
+static struct lprocfs_vars lprocfs_nodemap_vars[] = {
        {
                .name           = "id",
                .fops           = &nodemap_id_fops,
@@ -986,7 +986,7 @@ static struct lprocfs_seq_vars lprocfs_nodemap_vars[] = {
        }
 };
 
-static struct lprocfs_seq_vars lprocfs_default_nodemap_vars[] = {
+static struct lprocfs_vars lprocfs_default_nodemap_vars[] = {
        {
                .name           = "id",
                .fops           = &nodemap_id_fops,
@@ -1025,10 +1025,10 @@ int nodemap_procfs_init(void)
 {
        int rc = 0;
 
-       proc_lustre_nodemap_root = lprocfs_seq_register(LUSTRE_NODEMAP_NAME,
-                                                       proc_lustre_root,
-                                                       lprocfs_nm_module_vars,
-                                                       NULL);
+       proc_lustre_nodemap_root = lprocfs_register(LUSTRE_NODEMAP_NAME,
+                                                   proc_lustre_root,
+                                                   lprocfs_nm_module_vars,
+                                                   NULL);
 
        if (IS_ERR(proc_lustre_nodemap_root)) {
                rc = PTR_ERR(proc_lustre_nodemap_root);
@@ -1052,21 +1052,16 @@ int lprocfs_nodemap_register(const char *name,
                             struct lu_nodemap *nodemap)
 {
        struct proc_dir_entry   *nodemap_proc_entry;
+       struct lprocfs_vars     *vars;
        int                     rc = 0;
 
        if (is_default)
-               nodemap_proc_entry =
-                       lprocfs_seq_register(name,
-                                            proc_lustre_nodemap_root,
-                                            lprocfs_default_nodemap_vars,
-                                            nodemap);
+               vars = lprocfs_default_nodemap_vars;
        else
-               nodemap_proc_entry =
-                       lprocfs_seq_register(name,
-                                            proc_lustre_nodemap_root,
-                                            lprocfs_nodemap_vars,
-                                            nodemap);
+               vars = lprocfs_nodemap_vars;
 
+       nodemap_proc_entry = lprocfs_register(name, proc_lustre_nodemap_root,
+                                             vars, nodemap);
        if (IS_ERR(nodemap_proc_entry)) {
                rc = PTR_ERR(nodemap_proc_entry);
                CERROR("cannot create 'nodemap/%s': rc = %d\n", name, rc);
index bf16216..059f317 100644 (file)
@@ -818,7 +818,7 @@ LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_crrn_quantum);
  */
 int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_seq_vars nrs_crrn_lprocfs_vars[] = {
+       struct lprocfs_vars nrs_crrn_lprocfs_vars[] = {
                { .name         = "nrs_crrn_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_crrn_quantum_fops,
                  .data = svc },
@@ -828,8 +828,7 @@ int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc)
        if (svc->srv_procroot == NULL)
                return 0;
 
-       return lprocfs_seq_add_vars(svc->srv_procroot, nrs_crrn_lprocfs_vars,
-                                   NULL);
+       return lprocfs_add_vars(svc->srv_procroot, nrs_crrn_lprocfs_vars, NULL);
 }
 
 /**
index 8b5428c..a3c8588 100644 (file)
@@ -1858,7 +1858,7 @@ int nrs_orr_lprocfs_init(struct ptlrpc_service *svc)
 {
        int     i;
 
-       struct lprocfs_seq_vars nrs_orr_lprocfs_vars[] = {
+       struct lprocfs_vars nrs_orr_lprocfs_vars[] = {
                { .name         = "nrs_orr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops  },
                { .name         = "nrs_orr_offset_type",
@@ -1876,7 +1876,7 @@ int nrs_orr_lprocfs_init(struct ptlrpc_service *svc)
        for (i = 0; i < ARRAY_SIZE(nrs_orr_lprocfs_vars); i++)
                nrs_orr_lprocfs_vars[i].data = &lprocfs_orr_data;
 
-       return lprocfs_seq_add_vars(svc->srv_procroot, nrs_orr_lprocfs_vars, NULL);
+       return lprocfs_add_vars(svc->srv_procroot, nrs_orr_lprocfs_vars, NULL);
 }
 
 void nrs_orr_lprocfs_fini(struct ptlrpc_service *svc)
@@ -1925,10 +1925,9 @@ struct ptlrpc_nrs_pol_conf nrs_conf_orr = {
 
 int nrs_trr_lprocfs_init(struct ptlrpc_service *svc)
 {
-       int     rc;
        int     i;
 
-       struct lprocfs_seq_vars nrs_trr_lprocfs_vars[] = {
+       struct lprocfs_vars nrs_trr_lprocfs_vars[] = {
                { .name         = "nrs_trr_quantum",
                  .fops         = &ptlrpc_lprocfs_nrs_orr_quantum_fops },
                { .name         = "nrs_trr_offset_type",
@@ -1946,9 +1945,7 @@ int nrs_trr_lprocfs_init(struct ptlrpc_service *svc)
        for (i = 0; i < ARRAY_SIZE(nrs_trr_lprocfs_vars); i++)
                nrs_trr_lprocfs_vars[i].data = &lprocfs_trr_data;
 
-       rc = lprocfs_seq_add_vars(svc->srv_procroot, nrs_trr_lprocfs_vars, NULL);
-
-       return rc;
+       return lprocfs_add_vars(svc->srv_procroot, nrs_trr_lprocfs_vars, NULL);
 }
 
 void nrs_trr_lprocfs_fini(struct ptlrpc_service *svc)
index 6c7b5dc..af7d696 100644 (file)
@@ -1825,7 +1825,7 @@ LPROC_SEQ_FOPS(ptlrpc_lprocfs_nrs_tbf_rule);
  */
 int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
 {
-       struct lprocfs_seq_vars nrs_tbf_lprocfs_vars[] = {
+       struct lprocfs_vars nrs_tbf_lprocfs_vars[] = {
                { .name         = "nrs_tbf_rule",
                  .fops         = &ptlrpc_lprocfs_nrs_tbf_rule_fops,
                  .data = svc },
@@ -1835,8 +1835,7 @@ int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc)
        if (svc->srv_procroot == NULL)
                return 0;
 
-       return lprocfs_seq_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars,
-                                   NULL);
+       return lprocfs_add_vars(svc->srv_procroot, nrs_tbf_lprocfs_vars, NULL);
 }
 
 /**
index 9416f28..e602a63 100644 (file)
@@ -169,7 +169,7 @@ int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
 EXPORT_SYMBOL(sptlrpc_lprocfs_cliobd_attach);
 
 LPROC_SEQ_FOPS_RO(sptlrpc_proc_enc_pool);
-static struct lprocfs_seq_vars sptlrpc_lprocfs_vars[] = {
+static struct lprocfs_vars sptlrpc_lprocfs_vars[] = {
        { .name =       "encrypt_page_pools",
          .fops =       &sptlrpc_proc_enc_pool_fops     },
        { NULL }
@@ -181,8 +181,8 @@ int sptlrpc_lproc_init(void)
 
        LASSERT(sptlrpc_proc_root == NULL);
 
-       sptlrpc_proc_root = lprocfs_seq_register("sptlrpc", proc_lustre_root,
-                                                sptlrpc_lprocfs_vars, NULL);
+       sptlrpc_proc_root = lprocfs_register("sptlrpc", proc_lustre_root,
+                                            sptlrpc_lprocfs_vars, NULL);
        if (IS_ERR(sptlrpc_proc_root)) {
                rc = PTR_ERR(sptlrpc_proc_root);
                sptlrpc_proc_root = NULL;
index 8b501c3..6a819d1 100644 (file)
@@ -257,8 +257,8 @@ static int qmt_device_init0(const struct lu_env *env, struct qmt_device *qmt,
        LASSERT(type != NULL);
 
        /* register proc directory associated with this qmt */
-       qmt->qmt_proc = lprocfs_seq_register(qmt->qmt_svname, type->typ_procroot,
-                                               NULL, NULL);
+       qmt->qmt_proc = lprocfs_register(qmt->qmt_svname, type->typ_procroot,
+                                        NULL, NULL);
        if (IS_ERR(qmt->qmt_proc)) {
                rc = PTR_ERR(qmt->qmt_proc);
                CERROR("%s: failed to create qmt proc entry (%d)\n",
index 30ad195..2189342 100644 (file)
@@ -170,7 +170,7 @@ static int qpi_state_seq_show(struct seq_file *m, void *data)
 }
 LPROC_SEQ_FOPS_RO(qpi_state);
 
-static struct lprocfs_seq_vars lprocfs_quota_qpi_vars[] = {
+static struct lprocfs_vars lprocfs_quota_qpi_vars[] = {
        { .name =       "info",
          .fops =       &qpi_state_fops },
        { NULL }
@@ -213,8 +213,8 @@ static int qmt_pool_alloc(const struct lu_env *env, struct qmt_device *qmt,
 
        /* create pool proc directory */
        sprintf(qti->qti_buf, "%s-0x%x", RES_NAME(pool_type), pool_id);
-       pool->qpi_proc = lprocfs_seq_register(qti->qti_buf, qmt->qmt_proc,
-                                               lprocfs_quota_qpi_vars, pool);
+       pool->qpi_proc = lprocfs_register(qti->qti_buf, qmt->qmt_proc,
+                                         lprocfs_quota_qpi_vars, pool);
        if (IS_ERR(pool->qpi_proc)) {
                rc = PTR_ERR(pool->qpi_proc);
                CERROR("%s: failed to create proc entry for pool %s (%d)\n",
index 8be6f6a..a9307b7 100644 (file)
@@ -207,7 +207,7 @@ qsd_timeout_seq_write(struct file *file, const char *buffer,
 }
 LPROC_SEQ_FOPS(qsd_timeout);
 
-static struct lprocfs_seq_vars lprocfs_quota_qsd_vars[] = {
+static struct lprocfs_vars lprocfs_quota_qsd_vars[] = {
        { .name =       "info",
          .fops =       &qsd_state_fops         },
        { .name =       "enabled",
@@ -617,8 +617,8 @@ struct qsd_instance *qsd_init(const struct lu_env *env, char *svname,
        mutex_unlock(&qsd->qsd_fsinfo->qfs_mutex);
 
        /* register procfs directory */
-       qsd->qsd_proc = lprocfs_seq_register(QSD_DIR, osd_proc,
-                                               lprocfs_quota_qsd_vars, qsd);
+       qsd->qsd_proc = lprocfs_register(QSD_DIR, osd_proc,
+                                       lprocfs_quota_qsd_vars, qsd);
        if (IS_ERR(qsd->qsd_proc)) {
                rc = PTR_ERR(qsd->qsd_proc);
                qsd->qsd_proc = NULL;