Whamcloud - gitweb
LU-16231 misc: rename lprocfs_stats functions 47/48847/3
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 13 Oct 2022 06:05:04 +0000 (00:05 -0600)
committerOleg Drokin <green@whamcloud.com>
Tue, 20 Dec 2022 14:43:22 +0000 (14:43 +0000)
Rename lprocfs_{alloc,register,clear,free}_stats() to be
lprocfs_stats_*() so these functions can be found more easily
in relation to struct lprocfs_stats.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I671284a86ee2a1fd3c58da75923f9467e72540e5
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48847
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ellis Wilson <elliswilson@microsoft.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
16 files changed:
lustre/include/lprocfs_status.h
lustre/include/obd_class.h
lustre/ldlm/ldlm_pool.c
lustre/ldlm/ldlm_resource.c
lustre/llite/lproc_llite.c
lustre/mdt/mdt_fs.c
lustre/mgs/mgs_fs.c
lustre/obdclass/class_obd.c
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/obdclass/lu_object.c
lustre/ofd/ofd_obd.c
lustre/osd-ldiskfs/osd_lproc.c
lustre/osd-zfs/osd_lproc.c
lustre/ptlrpc/lproc_ptlrpc.c

index 0c3c388..7231905 100644 (file)
@@ -525,9 +525,9 @@ u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
                            enum lprocfs_fields_flags field);
 
 extern struct lprocfs_stats *
-lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
-extern void lprocfs_clear_stats(struct lprocfs_stats *stats);
-extern void lprocfs_free_stats(struct lprocfs_stats **stats);
+lprocfs_stats_alloc(unsigned int num, enum lprocfs_stats_flags flags);
+extern void lprocfs_stats_clear(struct lprocfs_stats *stats);
+extern void lprocfs_stats_free(struct lprocfs_stats **stats);
 extern void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats);
 extern int lprocfs_alloc_obd_stats(struct obd_device *obd,
                                   unsigned int num_stats);
@@ -567,7 +567,7 @@ lprocfs_nid_stats_clear_seq_write(struct file *file, const char __user *buffer,
                                        size_t count, loff_t *off);
 extern int lprocfs_nid_stats_clear_seq_show(struct seq_file *file, void *data);
 #endif
-extern int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
+extern int lprocfs_stats_register(struct proc_dir_entry *root, const char *name,
                                  struct lprocfs_stats *stats);
 extern const struct file_operations ldebugfs_stats_seq_fops;
 
@@ -946,15 +946,15 @@ static inline __u64 lc_read_helper(struct lprocfs_counter *lc,
 
 /* NB: we return !NULL to satisfy error checker */
 static inline struct lprocfs_stats *
-lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags)
+lprocfs_stats_alloc(unsigned int num, enum lprocfs_stats_flags flags)
 { return (struct lprocfs_stats *)1; }
-static inline void lprocfs_clear_stats(struct lprocfs_stats *stats)
+static inline void lprocfs_stats_clear(struct lprocfs_stats *stats)
 { return; }
-static inline void lprocfs_free_stats(struct lprocfs_stats **stats)
+static inline void lprocfs_stats_free(struct lprocfs_stats **stats)
 { return; }
-static inline int lprocfs_register_stats(struct proc_dir_entry *root,
-                                         const char *name,
-                                         struct lprocfs_stats *stats)
+static inline int lprocfs_stats_register(struct proc_dir_entry *root,
+                                        const char *name,
+                                        struct lprocfs_stats *stats)
 { return 0; }
 static inline void lprocfs_init_ldlm_stats(struct lprocfs_stats *ldlm_stats)
 { return; }
index d33077f..769a902 100644 (file)
@@ -451,14 +451,14 @@ static inline int lprocfs_nid_ldlm_stats_init(struct nid_stat* tmp)
 {
        /* Always add in ldlm_stats */
        tmp->nid_ldlm_stats =
-               lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC,
+               lprocfs_stats_alloc(LDLM_LAST_OPC - LDLM_FIRST_OPC,
                                    LPROCFS_STATS_FLAG_NOPERCPU);
        if (tmp->nid_ldlm_stats == NULL)
                return -ENOMEM;
 
        lprocfs_init_ldlm_stats(tmp->nid_ldlm_stats);
 
-       return lprocfs_register_stats(tmp->nid_proc, "ldlm_stats",
+       return lprocfs_stats_register(tmp->nid_proc, "ldlm_stats",
                                      tmp->nid_ldlm_stats);
 }
 
index dac8f11..197e3da 100644 (file)
@@ -839,7 +839,7 @@ static int ldlm_pool_debugfs_init(struct ldlm_pool *pl)
        ldlm_add_var(&pool_vars[0], pl->pl_debugfs_entry, "state", pl,
                     &lprocfs_pool_state_fops);
 
-       pl->pl_stats = lprocfs_alloc_stats(LDLM_POOL_LAST_STAT -
+       pl->pl_stats = lprocfs_stats_alloc(LDLM_POOL_LAST_STAT -
                                           LDLM_POOL_FIRST_STAT, 0);
        if (!pl->pl_stats)
                GOTO(out, rc = -ENOMEM);
@@ -893,7 +893,7 @@ static void ldlm_pool_sysfs_fini(struct ldlm_pool *pl)
 static void ldlm_pool_debugfs_fini(struct ldlm_pool *pl)
 {
        if (pl->pl_stats != NULL) {
-               lprocfs_free_stats(&pl->pl_stats);
+               lprocfs_stats_free(&pl->pl_stats);
                pl->pl_stats = NULL;
        }
        debugfs_remove_recursive(pl->pl_debugfs_entry);
index 762f104..cf17024 100644 (file)
@@ -717,7 +717,7 @@ static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns)
                debugfs_remove_recursive(ns->ns_debugfs_entry);
 
        if (ns->ns_stats != NULL)
-               lprocfs_free_stats(&ns->ns_stats);
+               lprocfs_stats_free(&ns->ns_stats);
 }
 
 void ldlm_namespace_sysfs_unregister(struct ldlm_namespace *ns)
@@ -735,7 +735,7 @@ int ldlm_namespace_sysfs_register(struct ldlm_namespace *ns)
        err = kobject_init_and_add(&ns->ns_kobj, &ldlm_ns_ktype, NULL,
                                   "%s", ldlm_ns_name(ns));
 
-       ns->ns_stats = lprocfs_alloc_stats(LDLM_NSS_LAST, 0);
+       ns->ns_stats = lprocfs_stats_alloc(LDLM_NSS_LAST, 0);
        if (!ns->ns_stats) {
                kobject_put(&ns->ns_kobj);
                return -ENOMEM;
index b9e9dd6..4ac6033 100644 (file)
@@ -671,7 +671,7 @@ static ssize_t ll_wr_track_id(struct kobject *kobj, const char *buffer,
                sbi->ll_stats_track_type = STATS_TRACK_ALL;
        else
                sbi->ll_stats_track_type = type;
-       lprocfs_clear_stats(sbi->ll_stats);
+       lprocfs_stats_clear(sbi->ll_stats);
        return count;
 }
 
@@ -1927,7 +1927,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
                            &ll_rw_offset_stats_fops);
 
        /* File operations stats */
-       sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
+       sbi->ll_stats = lprocfs_stats_alloc(LPROC_LL_FILE_OPCODES,
                                            LPROCFS_STATS_FLAG_NONE);
        if (sbi->ll_stats == NULL)
                GOTO(out_debugfs, err = -ENOMEM);
@@ -1942,7 +1942,7 @@ int ll_debugfs_register_super(struct super_block *sb, const char *name)
        debugfs_create_file("stats", 0644, sbi->ll_debugfs_entry,
                            sbi->ll_stats, &ldebugfs_stats_seq_fops);
 
-       sbi->ll_ra_stats = lprocfs_alloc_stats(ARRAY_SIZE(ra_stat_string),
+       sbi->ll_ra_stats = lprocfs_stats_alloc(ARRAY_SIZE(ra_stat_string),
                                               LPROCFS_STATS_FLAG_NONE);
        if (sbi->ll_ra_stats == NULL)
                GOTO(out_stats, err = -ENOMEM);
@@ -1971,9 +1971,9 @@ out_ll_kset:
 
        RETURN(0);
 out_ra_stats:
-       lprocfs_free_stats(&sbi->ll_ra_stats);
+       lprocfs_stats_free(&sbi->ll_ra_stats);
 out_stats:
-       lprocfs_free_stats(&sbi->ll_stats);
+       lprocfs_stats_free(&sbi->ll_stats);
 out_debugfs:
        debugfs_remove_recursive(sbi->ll_debugfs_entry);
 
@@ -2000,8 +2000,8 @@ void ll_debugfs_unregister_super(struct super_block *sb)
        kset_unregister(&sbi->ll_kset);
        wait_for_completion(&sbi->ll_kobj_unregister);
 
-       lprocfs_free_stats(&sbi->ll_ra_stats);
-       lprocfs_free_stats(&sbi->ll_stats);
+       lprocfs_stats_free(&sbi->ll_ra_stats);
+       lprocfs_stats_free(&sbi->ll_stats);
 }
 #undef MAX_STRING_SIZE
 
index 7aaf5d1..a1c9011 100644 (file)
@@ -80,16 +80,16 @@ int mdt_export_stats_init(struct obd_device *obd, struct obd_export *exp,
                RETURN(rc == -EALREADY ? 0 : rc);
 
        stats = exp->exp_nid_stats;
-       stats->nid_stats = lprocfs_alloc_stats(LPROC_MDT_LAST,
+       stats->nid_stats = lprocfs_stats_alloc(LPROC_MDT_LAST,
                                                LPROCFS_STATS_FLAG_NOPERCPU);
        if (stats->nid_stats == NULL)
                RETURN(-ENOMEM);
 
        mdt_stats_counter_init(stats->nid_stats, 0, LPROCFS_CNTR_HISTOGRAM);
 
-       rc = lprocfs_register_stats(stats->nid_proc, "stats", stats->nid_stats);
+       rc = lprocfs_stats_register(stats->nid_proc, "stats", stats->nid_stats);
        if (rc != 0) {
-               lprocfs_free_stats(&stats->nid_stats);
+               lprocfs_stats_free(&stats->nid_stats);
                GOTO(out, rc);
        }
 
index 880b374..696bdf8 100644 (file)
@@ -75,16 +75,16 @@ int mgs_export_stats_init(struct obd_device *obd, struct obd_export *exp,
                RETURN(rc == -EALREADY ? 0 : rc);
 
        stats = exp->exp_nid_stats;
-       stats->nid_stats = lprocfs_alloc_stats(LPROC_MGS_LAST,
+       stats->nid_stats = lprocfs_stats_alloc(LPROC_MGS_LAST,
                                               LPROCFS_STATS_FLAG_NOPERCPU);
        if (stats->nid_stats == NULL)
                RETURN(-ENOMEM);
 
        mgs_stats_counter_init(stats->nid_stats);
 
-       rc = lprocfs_register_stats(stats->nid_proc, "stats", stats->nid_stats);
+       rc = lprocfs_stats_register(stats->nid_proc, "stats", stats->nid_stats);
        if (rc != 0) {
-               lprocfs_free_stats(&stats->nid_stats);
+               lprocfs_stats_free(&stats->nid_stats);
                GOTO(out, rc);
        }
 
index f323d15..9db9d2a 100644 (file)
@@ -688,7 +688,7 @@ static int __init obdclass_init(void)
                return err;
 
 #ifdef CONFIG_PROC_FS
-       obd_memory = lprocfs_alloc_stats(OBD_STATS_NUM,
+       obd_memory = lprocfs_stats_alloc(OBD_STATS_NUM,
                                         LPROCFS_STATS_FLAG_NONE |
                                         LPROCFS_STATS_FLAG_IRQ_SAFE);
        if (obd_memory == NULL) {
@@ -803,7 +803,7 @@ cleanup_kkuc:
 
 cleanup_obd_memory:
 #ifdef CONFIG_PROC_FS
-       lprocfs_free_stats(&obd_memory);
+       lprocfs_stats_free(&obd_memory);
 #endif
 
        unregister_oom_notifier(&obdclass_oom);
@@ -867,7 +867,7 @@ static void __exit obdclass_exit(void)
        memory_leaked = obd_memory_sum();
        memory_max = obd_memory_max();
 
-       lprocfs_free_stats(&obd_memory);
+       lprocfs_stats_free(&obd_memory);
        /* the below message is checked in test-framework.sh check_mem_leak() */
        CDEBUG((memory_leaked) ? D_ERROR : D_INFO,
               "obd_memory max: %llu, leaked: %llu\n",
index 2bd6039..4f14251 100644 (file)
@@ -114,7 +114,7 @@ static void job_free(struct job_stat *job)
        list_del_init(&job->js_list);
        write_unlock(&job->js_jobstats->ojs_lock);
 
-       lprocfs_free_stats(&job->js_stats);
+       lprocfs_stats_free(&job->js_stats);
        OBD_FREE_PTR(job);
 }
 
@@ -254,7 +254,7 @@ static struct job_stat *job_alloc(char *jobid, struct obd_job_stats *jobs)
        if (job == NULL)
                return NULL;
 
-       job->js_stats = lprocfs_alloc_stats(jobs->ojs_cntr_num, 0);
+       job->js_stats = lprocfs_stats_alloc(jobs->ojs_cntr_num, 0);
        if (job->js_stats == NULL) {
                OBD_FREE_PTR(job);
                return NULL;
index c61033f..af73986 100644 (file)
@@ -1197,7 +1197,7 @@ int lprocfs_stats_alloc_one(struct lprocfs_stats *stats, unsigned int cpuid)
        return rc;
 }
 
-struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
+struct lprocfs_stats *lprocfs_stats_alloc(unsigned int num,
                                           enum lprocfs_stats_flags flags)
 {
        struct lprocfs_stats *stats;
@@ -1248,12 +1248,12 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
        return stats;
 
 fail:
-       lprocfs_free_stats(&stats);
+       lprocfs_stats_free(&stats);
        return NULL;
 }
-EXPORT_SYMBOL(lprocfs_alloc_stats);
+EXPORT_SYMBOL(lprocfs_stats_alloc);
 
-void lprocfs_free_stats(struct lprocfs_stats **statsh)
+void lprocfs_stats_free(struct lprocfs_stats **statsh)
 {
        struct lprocfs_stats *stats = *statsh;
        unsigned int num_entry;
@@ -1283,7 +1283,7 @@ void lprocfs_free_stats(struct lprocfs_stats **statsh)
 
        LIBCFS_FREE(stats, offsetof(typeof(*stats), ls_percpu[num_entry]));
 }
-EXPORT_SYMBOL(lprocfs_free_stats);
+EXPORT_SYMBOL(lprocfs_stats_free);
 
 u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
                            enum lprocfs_fields_flags field)
@@ -1311,12 +1311,12 @@ u64 lprocfs_stats_collector(struct lprocfs_stats *stats, int idx,
 }
 EXPORT_SYMBOL(lprocfs_stats_collector);
 
-void lprocfs_clear_stats(struct lprocfs_stats *stats)
+void lprocfs_stats_clear(struct lprocfs_stats *stats)
 {
        struct lprocfs_counter *percpu_cntr;
-       int i, j;
        unsigned int num_entry;
        unsigned long flags = 0;
+       int i, j;
 
        num_entry = lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
 
@@ -1346,7 +1346,7 @@ void lprocfs_clear_stats(struct lprocfs_stats *stats)
 
        lprocfs_stats_unlock(stats, LPROCFS_GET_NUM_CPU, &flags);
 }
-EXPORT_SYMBOL(lprocfs_clear_stats);
+EXPORT_SYMBOL(lprocfs_stats_clear);
 
 static ssize_t lprocfs_stats_seq_write(struct file *file,
                                       const char __user *buf,
@@ -1355,7 +1355,7 @@ static ssize_t lprocfs_stats_seq_write(struct file *file,
        struct seq_file *seq = file->private_data;
        struct lprocfs_stats *stats = seq->private;
 
-       lprocfs_clear_stats(stats);
+       lprocfs_stats_clear(stats);
 
        return len;
 }
@@ -1485,19 +1485,20 @@ static const struct proc_ops lprocfs_stats_seq_fops = {
        .proc_release   = lprocfs_seq_release,
 };
 
-int lprocfs_register_stats(struct proc_dir_entry *root, const char *name,
-                           struct lprocfs_stats *stats)
+int lprocfs_stats_register(struct proc_dir_entry *root, const char *name,
+                          struct lprocfs_stats *stats)
 {
        struct proc_dir_entry *entry;
-       LASSERT(root != NULL);
 
+       LASSERT(root != NULL);
        entry = proc_create_data(name, 0644, root,
                                 &lprocfs_stats_seq_fops, stats);
        if (!entry)
                return -ENOMEM;
+
        return 0;
 }
-EXPORT_SYMBOL(lprocfs_register_stats);
+EXPORT_SYMBOL(lprocfs_stats_register);
 
 static const char *lprocfs_counter_config_units(const char *name,
                                         enum lprocfs_counter_config config)
@@ -1616,7 +1617,7 @@ int lprocfs_alloc_md_stats(struct obd_device *obd,
        LASSERT(obd->obd_md_stats == NULL);
 
        num_stats = ARRAY_SIZE(mps_stats) + num_private_stats;
-       stats = lprocfs_alloc_stats(num_stats, 0);
+       stats = lprocfs_stats_alloc(num_stats, 0);
        if (!stats)
                return -ENOMEM;
 
@@ -1630,9 +1631,9 @@ int lprocfs_alloc_md_stats(struct obd_device *obd,
                }
        }
 
-       rc = lprocfs_register_stats(obd->obd_proc_entry, "md_stats", stats);
+       rc = lprocfs_stats_register(obd->obd_proc_entry, "md_stats", stats);
        if (rc < 0) {
-               lprocfs_free_stats(&stats);
+               lprocfs_stats_free(&stats);
        } else {
                obd->obd_md_stats = stats;
        }
@@ -1647,7 +1648,7 @@ void lprocfs_free_md_stats(struct obd_device *obd)
 
        if (stats) {
                obd->obd_md_stats = NULL;
-               lprocfs_free_stats(&stats);
+               lprocfs_stats_free(&stats);
        }
 }
 EXPORT_SYMBOL(lprocfs_free_md_stats);
index 24b2bbf..5dbb806 100644 (file)
@@ -288,10 +288,10 @@ static void lprocfs_free_client_stats(struct nid_stat *client_stat)
                lprocfs_remove(&client_stat->nid_proc);
 
        if (client_stat->nid_stats)
-               lprocfs_free_stats(&client_stat->nid_stats);
+               lprocfs_stats_free(&client_stat->nid_stats);
 
        if (client_stat->nid_ldlm_stats)
-               lprocfs_free_stats(&client_stat->nid_ldlm_stats);
+               lprocfs_stats_free(&client_stat->nid_ldlm_stats);
 
        OBD_FREE_PTR(client_stat);
 }
@@ -484,7 +484,7 @@ static int lprocfs_nid_stats_clear_write_cb(void *obj, void *data)
        }
        /* we has reference to object - only clear data*/
        if (stat->nid_stats)
-               lprocfs_clear_stats(stat->nid_stats);
+               lprocfs_stats_clear(stat->nid_stats);
 
        RETURN(0);
 }
@@ -682,13 +682,13 @@ int lprocfs_alloc_obd_stats(struct obd_device *obd, unsigned int num_stats)
        LASSERT(obd->obd_stats == NULL);
        LASSERT(obd->obd_proc_entry != NULL);
 
-       stats = lprocfs_alloc_stats(num_stats, 0);
+       stats = lprocfs_stats_alloc(num_stats, 0);
        if (stats == NULL)
                return -ENOMEM;
 
-       rc = lprocfs_register_stats(obd->obd_proc_entry, "stats", stats);
+       rc = lprocfs_stats_register(obd->obd_proc_entry, "stats", stats);
        if (rc < 0)
-               lprocfs_free_stats(&stats);
+               lprocfs_stats_free(&stats);
        else
                obd->obd_stats = stats;
 
@@ -699,7 +699,7 @@ EXPORT_SYMBOL(lprocfs_alloc_obd_stats);
 void lprocfs_free_obd_stats(struct obd_device *obd)
 {
        if (obd->obd_stats)
-               lprocfs_free_stats(&obd->obd_stats);
+               lprocfs_stats_free(&obd->obd_stats);
 }
 EXPORT_SYMBOL(lprocfs_free_obd_stats);
 
index 773e7f2..d2fbbd9 100644 (file)
@@ -1152,7 +1152,7 @@ int lu_site_init(struct lu_site *s, struct lu_device *top)
                init_waitqueue_head(&bkt->lsb_waitq);
        }
 
-       s->ls_stats = lprocfs_alloc_stats(LU_SS_LAST_STAT, 0);
+       s->ls_stats = lprocfs_stats_alloc(LU_SS_LAST_STAT, 0);
        if (s->ls_stats == NULL) {
                OBD_FREE_PTR_ARRAY_LARGE(s->ls_bkts, s->ls_bkt_cnt);
                s->ls_bkts = NULL;
@@ -1200,15 +1200,15 @@ void lu_site_fini(struct lu_site *s)
                s->ls_bkts = NULL;
        }
 
-        if (s->ls_top_dev != NULL) {
-                s->ls_top_dev->ld_site = NULL;
-                lu_ref_del(&s->ls_top_dev->ld_reference, "site-top", s);
-                lu_device_put(s->ls_top_dev);
-                s->ls_top_dev = NULL;
-        }
+       if (s->ls_top_dev != NULL) {
+               s->ls_top_dev->ld_site = NULL;
+               lu_ref_del(&s->ls_top_dev->ld_reference, "site-top", s);
+               lu_device_put(s->ls_top_dev);
+               s->ls_top_dev = NULL;
+       }
 
-        if (s->ls_stats != NULL)
-                lprocfs_free_stats(&s->ls_stats);
+       if (s->ls_stats != NULL)
+               lprocfs_stats_free(&s->ls_stats);
 }
 EXPORT_SYMBOL(lu_site_fini);
 
@@ -1217,13 +1217,15 @@ EXPORT_SYMBOL(lu_site_fini);
  */
 int lu_site_init_finish(struct lu_site *s)
 {
-        int result;
+       int result;
+
        down_write(&lu_sites_guard);
-        result = lu_context_refill(&lu_shrink_env.le_ctx);
-        if (result == 0)
+       result = lu_context_refill(&lu_shrink_env.le_ctx);
+       if (result == 0)
                list_add(&s->ls_linkage, &lu_sites);
        up_write(&lu_sites_guard);
-        return result;
+
+       return result;
 }
 EXPORT_SYMBOL(lu_site_init_finish);
 
index c921a21..166cee3 100644 (file)
@@ -88,16 +88,16 @@ static int ofd_export_stats_init(struct ofd_device *ofd,
                RETURN(rc == -EALREADY ? 0 : rc);
 
        stats = exp->exp_nid_stats;
-       stats->nid_stats = lprocfs_alloc_stats(LPROC_OFD_STATS_LAST,
+       stats->nid_stats = lprocfs_stats_alloc(LPROC_OFD_STATS_LAST,
                                               LPROCFS_STATS_FLAG_NOPERCPU);
        if (!stats->nid_stats)
                RETURN(-ENOMEM);
 
        ofd_stats_counter_init(stats->nid_stats, 0, LPROCFS_CNTR_HISTOGRAM);
 
-       rc = lprocfs_register_stats(stats->nid_proc, "stats", stats->nid_stats);
+       rc = lprocfs_stats_register(stats->nid_proc, "stats", stats->nid_stats);
        if (rc != 0) {
-               lprocfs_free_stats(&stats->nid_stats);
+               lprocfs_stats_free(&stats->nid_stats);
                GOTO(out, rc);
        }
 
index 6f67f0f..1984700 100644 (file)
@@ -82,7 +82,7 @@ static int osd_stats_init(struct osd_device *osd)
        int result = -ENOMEM;
 
        ENTRY;
-        osd->od_stats = lprocfs_alloc_stats(LPROC_OSD_LAST, 0);
+       osd->od_stats = lprocfs_stats_alloc(LPROC_OSD_LAST, 0);
        if (osd->od_stats) {
                lprocfs_counter_init(osd->od_stats, LPROC_OSD_GET_PAGE,
                                     LPROCFS_TYPE_LATENCY, "get_page");
@@ -872,7 +872,7 @@ int osd_procfs_fini(struct osd_device *osd)
        lprocfs_fini_brw_stats(&osd->od_brw_stats);
 
        if (osd->od_stats)
-               lprocfs_free_stats(&osd->od_stats);
+               lprocfs_stats_free(&osd->od_stats);
 
        if (osd->od_proc_entry)
                lprocfs_remove(&osd->od_proc_entry);
index 01f792d..317101f 100644 (file)
@@ -48,7 +48,7 @@ static int osd_stats_init(struct osd_device *osd)
        int result = -ENOMEM;
 
        ENTRY;
-       osd->od_stats = lprocfs_alloc_stats(LPROC_OSD_LAST, 0);
+       osd->od_stats = lprocfs_stats_alloc(LPROC_OSD_LAST, 0);
        if (osd->od_stats) {
                lprocfs_counter_init(osd->od_stats, LPROC_OSD_GET_PAGE,
                                LPROCFS_CNTR_AVGMINMAX | LPROCFS_CNTR_STDDEV |
@@ -410,7 +410,7 @@ int osd_procfs_fini(struct osd_device *osd)
        lprocfs_fini_brw_stats(&osd->od_brw_stats);
 
        if (osd->od_stats)
-               lprocfs_free_stats(&osd->od_stats);
+               lprocfs_stats_free(&osd->od_stats);
 
        if (osd->od_proc_entry) {
                lprocfs_remove(&osd->od_proc_entry);
index 92c1325..adcda47 100644 (file)
@@ -214,7 +214,7 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir, char *name,
        LASSERT(!*debugfs_root_ret);
        LASSERT(!*stats_ret);
 
-       svc_stats = lprocfs_alloc_stats(EXTRA_MAX_OPCODES + LUSTRE_MAX_OPCODES,
+       svc_stats = lprocfs_stats_alloc(EXTRA_MAX_OPCODES + LUSTRE_MAX_OPCODES,
                                        0);
        if (!svc_stats)
                return;
@@ -1309,7 +1309,7 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
        debugfs_remove_recursive(svc->srv_debugfs_entry);
 
        if (svc->srv_stats)
-               lprocfs_free_stats(&svc->srv_stats);
+               lprocfs_stats_free(&svc->srv_stats);
 }
 
 void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
@@ -1322,7 +1322,7 @@ void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
        debugfs_remove_recursive(obd->obd_svc_debugfs_entry);
 
        if (obd->obd_svc_stats)
-               lprocfs_free_stats(&obd->obd_svc_stats);
+               lprocfs_stats_free(&obd->obd_svc_stats);
 }
 EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);