Whamcloud - gitweb
b=14184
authorkomaln <komaln>
Thu, 3 Jan 2008 06:31:16 +0000 (06:31 +0000)
committerkomaln <komaln>
Thu, 3 Jan 2008 06:31:16 +0000 (06:31 +0000)
r=Nathan, Adilger

to remove the use of LPROCFS_INIT_VARS and related macros

35 files changed:
lustre/include/lprocfs_status.h
lustre/include/obd_class.h
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/lov/lov_internal.h
lustre/lov/lov_obd.c
lustre/lov/lproc_lov.c
lustre/lvfs/lustre_quota_fmt.h
lustre/lvfs/quotafmt_test.c
lustre/mdc/lproc_mdc.c
lustre/mdc/mdc_internal.h
lustre/mdc/mdc_request.c
lustre/mds/handler.c
lustre/mds/lproc_mds.c
lustre/mds/mds_internal.h
lustre/mgs/lproc_mgs.c
lustre/mgs/mgs_handler.c
lustre/mgs/mgs_internal.h
lustre/obdclass/llog_test.c
lustre/obdecho/echo.c
lustre/obdecho/echo_client.c
lustre/obdecho/lproc_echo.c
lustre/obdfilter/filter.c
lustre/obdfilter/filter_internal.h
lustre/obdfilter/lproc_obdfilter.c
lustre/osc/lproc_osc.c
lustre/osc/osc_internal.h
lustre/osc/osc_request.c
lustre/ost/lproc_ost.c
lustre/ost/ost_handler.c
lustre/ost/ost_internal.h
lustre/quota/quota_internal.h
lustre/quota/quotacheck_test.c
lustre/quota/quotactl_test.c

index 711788c..2b07050 100644 (file)
@@ -320,19 +320,6 @@ extern int lprocfs_add_simple(struct proc_dir_entry *root,
 extern int lprocfs_register_stats(cfs_proc_dir_entry_t *root, const char *name,
                                   struct lprocfs_stats *stats);
 
-#define LPROCFS_INIT_VARS(name, vclass, vinstance)           \
-void lprocfs_##name##_init_vars(struct lprocfs_static_vars *x)  \
-{                                                      \
-        x->module_vars = vclass;                       \
-        x->obd_vars = vinstance;                       \
-}                                                      \
-
-#define lprocfs_init_vars(NAME, VAR)     \
-do {      \
-        extern void lprocfs_##NAME##_init_vars(struct lprocfs_static_vars *);  \
-        lprocfs_##NAME##_init_vars(VAR);                                       \
-} while (0)
-
 /* lprocfs_status.c */
 extern int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
                             struct lprocfs_vars *var,
@@ -592,8 +579,6 @@ int lprocfs_nid_stats_clear_read(char *page, char **start, off_t off,
 static inline cfs_proc_dir_entry_t *
 lprocfs_register(const char *name, cfs_proc_dir_entry_t *parent,
                  struct lprocfs_vars *list, void *data) { return NULL; }
-#define LPROCFS_INIT_VARS(name, vclass, vinstance)
-#define lprocfs_init_vars(...) do {} while (0)
 static inline int lprocfs_add_vars(cfs_proc_dir_entry_t *root,
                                    struct lprocfs_vars *var,
                                    void *data) { return 0; }
index 57edb95..5820128 100644 (file)
@@ -95,6 +95,16 @@ int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg);
 struct obd_device *class_incref(struct obd_device *obd);
 void class_decref(struct obd_device *obd);
 
+/*obdecho*/
+#ifdef LPROCFS
+extern void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static inline void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+#endif
+
 #define CFG_F_START     0x01   /* Set when we start updating from a log */
 #define CFG_F_MARKER    0x02   /* We are within a maker */
 #define CFG_F_SKIP      0x04   /* We should ignore this cfg command */
index 88e9333..f6f6642 100644 (file)
@@ -450,11 +450,16 @@ 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);
+void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars);
 #else
 static inline int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                         struct super_block *sb, char *osc, char *mdc){return 0;}
 static inline void lprocfs_unregister_mountpoint(struct ll_sb_info *sbi) {}
 static void ll_stats_ops_tally(struct ll_sb_info *sbi, int op, int count) {}
+static void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
 #endif
 
 
index 66dc80f..1a1e47c 100644 (file)
@@ -2155,7 +2155,7 @@ int ll_process_config(struct lustre_cfg *lcfg)
         unsigned long x;
         int rc = 0;
 
-        lprocfs_init_vars(llite, &lvars);
+        lprocfs_llite_init_vars(&lvars);
 
         /* The instance name contains the sb: lustre-client-aacfe000 */
         ptr = strrchr(lustre_cfg_string(lcfg, 0), '-');
index 15759e8..4e48ebc 100644 (file)
@@ -510,7 +510,7 @@ static int ll_rd_statahead_stats(char *page, char **start, off_t off,
                         sbi->ll_sa_blocked + sbi->ll_sa_cached);
 }
 
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_llite_obd_vars[] = {
         { "uuid",         ll_rd_sb_uuid,          0, 0 },
         //{ "mntpt_path",   ll_rd_path,             0, 0 },
         { "fstype",       ll_rd_fstype,           0, 0 },
@@ -710,7 +710,7 @@ int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
         if (err)
                 GOTO(out, err);
 
-        err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_obd_vars, sb);
+        err = lprocfs_add_vars(sbi->ll_proc_root, lprocfs_llite_obd_vars, sb);
         if (err)
                 GOTO(out, err);
 
@@ -1341,5 +1341,9 @@ static ssize_t ll_rw_offset_stats_seq_write(struct file *file, const char *buf,
 
 LPROC_SEQ_FOPS(ll_rw_offset_stats);
 
-LPROCFS_INIT_VARS(llite, NULL, lprocfs_obd_vars)
+void lprocfs_llite_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = NULL;
+    lvars->obd_vars     = lprocfs_llite_obd_vars;
+}
 #endif /* LPROCFS */
index 57d9ba3..164ff8d 100644 (file)
@@ -262,5 +262,13 @@ int lovea_destroy_object(struct lov_obd *lov, struct lov_stripe_md *lsm,
                          struct obdo *oa, void *data);
 /* lproc_lov.c */
 extern struct file_operations lov_proc_target_fops;
+#ifdef LPROCFS
+void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static inline void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+#endif
 
 #endif
index 2975dab..6ac98ce 100644 (file)
@@ -797,7 +797,7 @@ void lov_fix_desc(struct lov_desc *desc)
 
 static int lov_setup(struct obd_device *obd, obd_count len, void *buf)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         struct lustre_cfg *lcfg = buf;
         struct lov_desc *desc;
         struct lov_obd *lov = &obd->u.lov;
@@ -855,7 +855,7 @@ static int lov_setup(struct obd_device *obd, obd_count len, void *buf)
         /* Default priority is toward free space balance */
         lov->lov_qos.lq_prio_free = 232;
 
-        lprocfs_init_vars(lov, &lvars);
+        lprocfs_lov_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 #ifdef LPROCFS
         {
@@ -969,13 +969,13 @@ static int lov_process_config(struct obd_device *obd, obd_count len, void *buf)
                 GOTO(out, rc);
         }
         case LCFG_PARAM: {
-                struct lprocfs_static_vars lvars;
+                struct lprocfs_static_vars lvars = { 0 };
                 struct lov_desc *desc = &(obd->u.lov.desc);
                 
                 if (!desc)
                         GOTO(out, rc = -EINVAL);
                 
-                lprocfs_init_vars(lov, &lvars);
+                lprocfs_lov_init_vars(&lvars);
                 
                 rc = class_process_proc_param(PARAM_LOV, lvars.obd_vars,
                                               lcfg, obd);
@@ -2822,7 +2822,7 @@ cfs_mem_cache_t *lov_oinfo_slab;
 
 int __init lov_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         int rc, rc2;
         ENTRY;
 
@@ -2831,7 +2831,7 @@ int __init lov_init(void)
                                               0, SLAB_HWCACHE_ALIGN);
         if (lov_oinfo_slab == NULL)
                 return -ENOMEM;
-        lprocfs_init_vars(lov, &lvars);
+        lprocfs_lov_init_vars(&lvars);
 
         request_module("lquota");
         quota_interface = PORTAL_SYMBOL_GET(lov_quota_interface);
index bad9801..f725d3b 100644 (file)
@@ -317,7 +317,7 @@ static int lov_target_seq_open(struct inode *inode, struct file *file)
         return 0;
 }
 
-struct lprocfs_vars lprocfs_obd_vars[] = {
+struct lprocfs_vars lprocfs_lov_obd_vars[] = {
         { "uuid",         lprocfs_rd_uuid,        0, 0 },
         { "stripesize",   lov_rd_stripesize,      lov_wr_stripesize, 0 },
         { "stripeoffset", lov_rd_stripeoffset,    lov_wr_stripeoffset, 0 },
@@ -338,11 +338,17 @@ struct lprocfs_vars lprocfs_obd_vars[] = {
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_lov_module_vars[] = {
         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
         { 0 }
 };
 
+void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_lov_module_vars;
+    lvars->obd_vars     = lprocfs_lov_obd_vars;
+}
+
 struct file_operations lov_proc_target_fops = {
         .owner   = THIS_MODULE,
         .open    = lov_target_seq_open,
@@ -350,6 +356,5 @@ struct file_operations lov_proc_target_fops = {
         .llseek  = seq_lseek,
         .release = lprocfs_seq_release,
 };
-
-LPROCFS_INIT_VARS(lov, lprocfs_module_vars, lprocfs_obd_vars)
 #endif /* LPROCFS */
+
index 78a22f7..b0638f5 100644 (file)
@@ -120,6 +120,12 @@ struct lustre_disk_dqdbheader {
         __u32 dqdh_pad2;
 };
 
+#ifdef LPROCFS
+void lprocfs_quotfmt_test_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static void lprocfs_quotfmt_test_init_vars(struct lprocfs_static_vars *lvars) {}
+#endif
+
 #define LUSTRE_DQINFOOFF       sizeof(struct lustre_disk_dqheader)     /* Offset of info header in file */
 #define LUSTRE_DQBLKSIZE_BITS  10
 #define LUSTRE_DQBLKSIZE       (1 << LUSTRE_DQBLKSIZE_BITS)    /* Size of block with quota structures */
index 3af91f4..3e7f592 100644 (file)
@@ -464,7 +464,7 @@ static int quotfmt_test_setup(struct obd_device *obd, obd_count len, void *buf)
         if (rc)
                 quotfmt_test_cleanup(obd);
 
-        lprocfs_init_vars(quotfmt_test, &lvars);
+        lprocfs_quotfmt_test_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         RETURN(rc);
@@ -477,16 +477,20 @@ static struct obd_ops quotfmt_obd_ops = {
 };
 
 #ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_quotfmt_test_obd_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_quotfmt_test_module_vars[] = { {0} };
 
-LPROCFS_INIT_VARS(quotfmt_test, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_quotfmt_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_quotfmt_test_module_vars;
+    lvars->obd_vars     = lprocfs_quotfmt_test_obd_vars;
+}
 #endif
 static int __init quotfmt_test_init(void)
 {
         struct lprocfs_static_vars lvars;
 
-        lprocfs_init_vars(quotfmt_test, &lvars);
+        lprocfs_quotfmt_test_init_vars(&lvars);
         return class_register_type(&quotfmt_obd_ops, lvars.module_vars,
                                    "quotfmt_test");
 }
index 2ef3332..dafe84e 100644 (file)
@@ -64,7 +64,7 @@ static int mdc_wr_max_rpcs_in_flight(struct file *file, const char *buffer,
 
         return count;
 }
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mdc_obd_vars[] = {
         { "uuid",            lprocfs_rd_uuid,        0, 0 },
         { "ping",            0, lprocfs_wr_ping,        0 },
         { "connect_flags",   lprocfs_rd_connect_flags, 0, 0 },
@@ -83,11 +83,15 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_mdc_module_vars[] = {
         { "num_refs",        lprocfs_rd_numrefs,     0, 0 },
         { 0 }
 };
 
-LPROCFS_INIT_VARS(mdc, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_mdc_module_vars;
+    lvars->obd_vars     = lprocfs_mdc_obd_vars;
+}
 #endif /* LPROCFS */
 
index 70b6d00..7e0fe9b 100644 (file)
@@ -7,6 +7,14 @@
  */
 
 #include <lustre_mds.h>
+#ifdef LPROCFS
+void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static inline void lprocfs_mdc_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+#endif
 void mdc_pack_req_body(struct ptlrpc_request *req, int offset,
                        __u64 valid, struct ll_fid *fid, int ea_size, int flags);
 void mdc_pack_rep_body(struct ptlrpc_request *);
index 2a97171..b836665 100644 (file)
@@ -1169,7 +1169,7 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp,
 static int mdc_setup(struct obd_device *obd, obd_count len, void *buf)
 {
         struct client_obd *cli = &obd->u.cli;
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         int rc;
         ENTRY;
 
@@ -1193,7 +1193,7 @@ static int mdc_setup(struct obd_device *obd, obd_count len, void *buf)
         rc = client_obd_setup(obd, len, buf);
         if (rc)
                 GOTO(err_close_lock, rc);
-        lprocfs_init_vars(mdc, &lvars);
+        lprocfs_mdc_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         rc = obd_llog_init(obd, obd, 0, NULL, NULL);
@@ -1345,10 +1345,10 @@ static int mdc_llog_finish(struct obd_device *obd, int count)
 static int mdc_process_config(struct obd_device *obd, obd_count len, void *buf)
 {
         struct lustre_cfg *lcfg = buf;
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         int rc = 0;
 
-        lprocfs_init_vars(mdc, &lvars);
+        lprocfs_mdc_init_vars(&lvars);
         
         rc = class_process_proc_param(PARAM_MDC, lvars.obd_vars, lcfg, obd);
         return(rc);
@@ -1378,8 +1378,8 @@ struct obd_ops mdc_obd_ops = {
 int __init mdc_init(void)
 {
         int rc;
-        struct lprocfs_static_vars lvars;
-        lprocfs_init_vars(mdc, &lvars);
+        struct lprocfs_static_vars lvars = { 0 };
+        lprocfs_mdc_init_vars(&lvars);
         request_module("lquota");
         quota_interface = PORTAL_SYMBOL_GET(mdc_quota_interface);
         init_obd_quota_ops(quota_interface, &mdc_obd_ops);
index 696ac4d..1e6b0f5 100644 (file)
@@ -1969,7 +1969,7 @@ static int mds_setup(struct obd_device *obd, obd_count len, void *buf)
         }
         ldlm_register_intent(obd->obd_namespace, mds_intent_policy);
 
-        lprocfs_init_vars(mds, &lvars);
+        lprocfs_mds_init_vars(&lvars);
         if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
             lprocfs_alloc_obd_stats(obd, LPROC_MDS_LAST) == 0) {
                 /* Init private stats here */
@@ -2545,7 +2545,7 @@ static int mdt_setup(struct obd_device *obd, obd_count len, void *buf)
         int rc = 0;
         ENTRY;
 
-        lprocfs_init_vars(mdt, &lvars);
+        lprocfs_mdt_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         sema_init(&mds->mds_health_sem, 1);
@@ -2716,7 +2716,7 @@ static int mds_process_config(struct obd_device *obd, obd_count len, void *buf)
         struct lprocfs_static_vars lvars;
         int rc;
 
-        lprocfs_init_vars(mds, &lvars);
+        lprocfs_mds_init_vars(&lvars);
         
         rc = class_process_proc_param(PARAM_MDT, lvars.obd_vars, lcfg, obd);
         
@@ -2775,9 +2775,9 @@ static int __init mds_init(void)
         }
         init_obd_quota_ops(mds_quota_interface_ref, &mds_obd_ops);
         
-        lprocfs_init_vars(mds, &lvars);
+        lprocfs_mds_init_vars(&lvars);
         class_register_type(&mds_obd_ops, lvars.module_vars, LUSTRE_MDS_NAME);
-        lprocfs_init_vars(mdt, &lvars);
+        lprocfs_mdt_init_vars(&lvars);
         class_register_type(&mdt_obd_ops, lvars.module_vars, LUSTRE_MDT_NAME);
 
         return 0;
index 768aa80..b9cdeb1 100644 (file)
@@ -468,6 +468,15 @@ void mds_stats_counter_init(struct lprocfs_stats *stats)
         lprocfs_counter_init(stats, LPROC_MDS_SETXATTR, 0, "setxattr", "reqs");
 }
 
-LPROCFS_INIT_VARS(mds, lprocfs_mds_module_vars, lprocfs_mds_obd_vars);
-LPROCFS_INIT_VARS(mdt, lprocfs_mdt_module_vars, lprocfs_mdt_obd_vars);
+void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars = lprocfs_mds_module_vars;
+    lvars->obd_vars = lprocfs_mds_obd_vars;
+}
+
+void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars = lprocfs_mdt_module_vars;
+    lvars->obd_vars = lprocfs_mdt_obd_vars;
+}
 #endif
index 59f9014..6041da6 100644 (file)
@@ -284,5 +284,6 @@ enum {
 };
 void mds_counter_incr(struct obd_export *exp, int opcode);
 void mds_stats_counter_init(struct lprocfs_stats *stats);
-
+void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars);
+void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars);
 #endif /* _MDS_INTERNAL_H */
index 2453dc3..5ccb8a8 100644 (file)
@@ -149,5 +149,9 @@ struct lprocfs_vars lprocfs_mgs_module_vars[] = {
         { 0 }
 };
 
-LPROCFS_INIT_VARS(mgs, lprocfs_mgs_module_vars, lprocfs_mgs_obd_vars);
+void lprocfs_mgs_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_mgs_module_vars;
+    lvars->obd_vars     = lprocfs_mgs_obd_vars;
+}
 #endif
index 57ab5ec..79d43bd 100644 (file)
@@ -189,7 +189,7 @@ static int mgs_setup(struct obd_device *obd, obd_count len, void *buf)
                 GOTO(err_thread, rc);
 
         /* Setup proc */
-        lprocfs_init_vars(mgs, &lvars);
+        lprocfs_mgs_init_vars(&lvars);
         if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0) {
                 lproc_mgs_setup(obd);
         }
@@ -726,7 +726,7 @@ static int __init mgs_init(void)
 {
         struct lprocfs_static_vars lvars;
 
-        lprocfs_init_vars(mgs, &lvars);
+        lprocfs_mgs_init_vars(&lvars);
         class_register_type(&mgs_obd_ops, lvars.module_vars, LUSTRE_MGS_NAME);
 
         return 0;
index 5647659..f3f82ef 100644 (file)
@@ -60,6 +60,7 @@ int mgs_fs_cleanup(struct obd_device *obddev);
 int lproc_mgs_setup(struct obd_device *dev);
 int lproc_mgs_add_live(struct obd_device *obd, struct fs_db *fsdb);
 int lproc_mgs_del_live(struct obd_device *obd, struct fs_db *fsdb);
+void lprocfs_mgs_init_vars(struct lprocfs_static_vars *lvars);
 #else
 static inline int lproc_mgs_setup(struct obd_device *dev) 
 {return 0;}
@@ -67,6 +68,10 @@ static int lproc_mgs_add_live(struct obd_device *obd, struct fs_db *fsdb)
 {return 0;}
 static int lproc_mgs_del_live(struct obd_device *obd, struct fs_db *fsdb)
 {return 0;}
+static void lprocfs_mgs_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
 #endif
 
 
index fbd151e..641137e 100644 (file)
@@ -640,6 +640,16 @@ static int llog_test_cleanup(struct obd_device *obd)
         return rc;
 }
 
+#ifdef LPROCFS
+static struct lprocfs_vars lprocfs_llog_test_obd_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_llog_test_module_vars[] = { {0} };
+static void lprocfs_llog_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_llog_test_module_vars;
+    lvars->obd_vars     = lprocfs_llog_test_obd_vars;
+}
+#endif
+
 static int llog_test_setup(struct obd_device *obd, obd_count len, void *buf)
 {
         struct lprocfs_static_vars lvars;
@@ -675,7 +685,7 @@ static int llog_test_setup(struct obd_device *obd, obd_count len, void *buf)
         if (rc)
                 llog_test_cleanup(obd);
 
-        lprocfs_init_vars(llog_test, &lvars);
+        lprocfs_llog_test_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         RETURN(rc);
@@ -689,17 +699,11 @@ static struct obd_ops llog_obd_ops = {
         .o_llog_finish = llog_test_llog_finish,
 };
 
-#ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-LPROCFS_INIT_VARS(llog_test, lprocfs_module_vars, lprocfs_obd_vars)
-#endif
-
 static int __init llog_test_init(void)
 {
         struct lprocfs_static_vars lvars;
 
-        lprocfs_init_vars(llog_test, &lvars);
+        lprocfs_llog_test_init_vars(&lvars);
         return class_register_type(&llog_obd_ops,lvars.module_vars,"llog_test");
 }
 
index ad97528..f8f9826 100644 (file)
@@ -479,7 +479,7 @@ static int echo_setup(struct obd_device *obd, obd_count len, void *buf)
                                     0, NULL, &obd->u.echo.eo_nl_lock);
         LASSERT (rc == ELDLM_OK);
 
-        lprocfs_init_vars(echo, &lvars);
+        lprocfs_echo_init_vars(&lvars);
         if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
             lprocfs_alloc_obd_stats(obd, LPROC_ECHO_LAST) == 0) {
                 lprocfs_counter_init(obd->obd_stats, LPROC_ECHO_READ_BYTES,
@@ -584,7 +584,7 @@ static int __init obdecho_init(void)
 
         LASSERT(CFS_PAGE_SIZE % OBD_ECHO_BLOCK_SIZE == 0);
 
-        lprocfs_init_vars(echo, &lvars);
+        lprocfs_echo_init_vars(&lvars);
 
         rc = echo_persistent_pages_init ();
         if (rc != 0)
index d7f54a9..050bf89 100644 (file)
@@ -1497,9 +1497,9 @@ static struct obd_ops echo_obd_ops = {
 
 int echo_client_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
 
-        lprocfs_init_vars(echo, &lvars);
+        lprocfs_echo_init_vars(&lvars);
         return class_register_type(&echo_obd_ops, lvars.module_vars,
                                    LUSTRE_ECHO_CLIENT_NAME);
 }
index c816ca0..42ded58 100644 (file)
 #include <obd_class.h>
 
 #ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_echo_obd_vars[] = {
         { "uuid",         lprocfs_rd_uuid,        0, 0 },
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_echo_module_vars[] = {
         { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
         { 0 }
 };
 
-LPROCFS_INIT_VARS(echo, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_echo_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_echo_module_vars;
+    lvars->obd_vars     = lprocfs_echo_obd_vars;
+}
 #endif /* LPROCFS */
index 146a08e..87773e2 100644 (file)
@@ -1820,7 +1820,7 @@ static int filter_setup(struct obd_device *obd, obd_count len, void *buf)
 
         /* lprocfs must be setup before the filter so state can be safely added
          * to /proc incrementally as the filter is setup */
-        lprocfs_init_vars(filter, &lvars);
+        lprocfs_filter_init_vars(&lvars);
         if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0 &&
             lprocfs_alloc_obd_stats(obd, LPROC_FILTER_LAST) == 0) {
                 /* Init obdfilter private stats here */
@@ -3609,7 +3609,7 @@ static int filter_process_config(struct obd_device *obd,obd_count len,void *buf)
         struct lprocfs_static_vars lvars;
         int rc = 0;
 
-        lprocfs_init_vars(filter, &lvars);
+        lprocfs_filter_init_vars(&lvars);
 
         rc = class_process_proc_param(PARAM_OST, lvars.obd_vars, lcfg, obd);
 
@@ -3661,7 +3661,7 @@ static int __init obdfilter_init(void)
 
         printk(KERN_INFO "Lustre: Filtering OBD driver; info@clusterfs.com\n");
 
-        lprocfs_init_vars(filter, &lvars);
+        lprocfs_filter_init_vars(&lvars);
 
         request_module("lquota");
         OBD_ALLOC(obdfilter_created_scratchpad,
index 52398cf..27611c9 100644 (file)
@@ -178,11 +178,16 @@ int filter_recov_log_mds_ost_cb(struct llog_handle *llh,
 void filter_tally(struct obd_export *exp, struct page **pages, int nr_pages,
                   unsigned long *blocks, int blocks_per_page, int wr);
 int lproc_filter_attach_seqstat(struct obd_device *dev);
+void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars);
 #else
 static inline void filter_tally(struct obd_export *exp, struct page **pages,
                                 int nr_pages, unsigned long *blocks,
                                 int blocks_per_page, int wr) {}
 static inline int lproc_filter_attach_seqstat(struct obd_device *dev) {}
+static void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
 #endif
 
 /* Quota stuff */
index 5d09fa7..0c06c04 100644 (file)
@@ -176,7 +176,7 @@ int lprocfs_filter_wr_fmd_max_age(struct file *file, const char *buffer,
         return count;
 }
 
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_filter_obd_vars[] = {
         { "uuid",         lprocfs_rd_uuid,          0, 0 },
         { "blocksize",    lprocfs_rd_blksize,       0, 0 },
         { "kbytestotal",  lprocfs_rd_kbytestotal,   0, 0 },
@@ -218,7 +218,7 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_filter_module_vars[] = {
         { "num_refs",     lprocfs_rd_numrefs,       0, 0 },
         { 0 }
 };
@@ -416,7 +416,11 @@ static ssize_t filter_per_export_stats_seq_write(struct file *file,
 
 LPROC_SEQ_FOPS(filter_per_export_stats);
 
-LPROCFS_INIT_VARS(filter, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_filter_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_filter_module_vars;
+    lvars->obd_vars     = lprocfs_filter_obd_vars;
+}
 
 static int filter_per_nid_stats_seq_show(struct seq_file *seq, void *v)
 {
index aed4bef..5911d8d 100644 (file)
@@ -329,7 +329,7 @@ static int osc_wr_resend_count(struct file *file, const char *buffer,
         return count;
 }
 
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_osc_obd_vars[] = {
         { "uuid",            lprocfs_rd_uuid,        0, 0 },
         { "ping",            0, lprocfs_wr_ping,        0 },
         { "connect_flags",   lprocfs_rd_connect_flags, 0, 0 },
@@ -360,7 +360,7 @@ static struct lprocfs_vars lprocfs_obd_vars[] = {
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_osc_module_vars[] = {
         { "num_refs",        lprocfs_rd_numrefs,     0, 0 },
         { 0 }
 };
@@ -489,6 +489,10 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
                                       &osc_rpc_stats_fops, dev);
 }
 
-LPROCFS_INIT_VARS(osc, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
+{
+        lvars->module_vars = lprocfs_osc_module_vars;
+        lvars->obd_vars    = lprocfs_osc_obd_vars;
+}
 #endif /* LPROCFS */
 
index 451a79b..eb9c79d 100644 (file)
@@ -67,8 +67,13 @@ void osc_wake_cache_waiters(struct client_obd *cli);
 
 #ifdef LPROCFS
 int lproc_osc_attach_seqstat(struct obd_device *dev);
+void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars);
 #else
 static inline int lproc_osc_attach_seqstat(struct obd_device *dev) {return 0;}
+static inline void lprocfs_osc_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
 #endif
 
 #ifndef min_t
index 84a0abd..44a2e9d 100644 (file)
@@ -3670,10 +3670,10 @@ int osc_setup(struct obd_device *obd, obd_count len, void *buf)
         if (rc) {
                 ptlrpcd_decref();
         } else {
-                struct lprocfs_static_vars lvars;
+                struct lprocfs_static_vars lvars = { 0 };
                 struct client_obd *cli = &obd->u.cli;
 
-                lprocfs_init_vars(osc, &lvars);
+                lprocfs_osc_init_vars(&lvars);
                 if (lprocfs_obd_setup(obd, lvars.obd_vars) == 0) {
                         lproc_osc_attach_seqstat(obd);
                         ptlrpc_lprocfs_register_obd(obd);
@@ -3803,10 +3803,10 @@ static int osc_unregister_lock_cancel_cb(struct obd_export *exp,
 static int osc_process_config(struct obd_device *obd, obd_count len, void *buf)
 {
         struct lustre_cfg *lcfg = buf;
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         int rc = 0;
 
-        lprocfs_init_vars(osc, &lvars);
+        lprocfs_osc_init_vars(&lvars);
 
         rc = class_process_proc_param(PARAM_OSC, lvars.obd_vars, lcfg, obd);
         return(rc);
@@ -3863,11 +3863,11 @@ struct obd_ops osc_obd_ops = {
 };
 int __init osc_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         int rc;
         ENTRY;
 
-        lprocfs_init_vars(osc, &lvars);
+        lprocfs_osc_init_vars(&lvars);
 
         request_module("lquota");
         quota_interface = PORTAL_SYMBOL_GET(osc_quota_interface);
index 27c1286..77eeaca 100644 (file)
 #include "ost_internal.h"
 
 #ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = {
+static struct lprocfs_vars lprocfs_ost_obd_vars[] = {
         { "uuid",            lprocfs_rd_uuid,   0, 0 },
         { 0 }
 };
 
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_ost_module_vars[] = {
         { "num_refs",       lprocfs_rd_numrefs, 0, 0 },
         { 0 }
 };
 
-LPROCFS_INIT_VARS(ost, lprocfs_module_vars, lprocfs_obd_vars)
+void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_ost_module_vars;
+    lvars->obd_vars     = lprocfs_ost_obd_vars;
+}
 #endif /* LPROCFS */
index db286a1..0d3661a 100644 (file)
@@ -1750,7 +1750,7 @@ static int ost_setup(struct obd_device *obd, obd_count len, void *buf)
         rc = cleanup_group_info();
         if (rc)
                 RETURN(rc);
-        lprocfs_init_vars(ost, &lvars);
+        lprocfs_ost_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         sema_init(&ost->ost_health_sem, 1);
@@ -1926,7 +1926,7 @@ static int __init ost_init(void)
         int rc;
         ENTRY;
 
-        lprocfs_init_vars(ost, &lvars);
+        lprocfs_ost_init_vars(&lvars);
         rc = class_register_type(&ost_obd_ops, lvars.module_vars,
                                  LUSTRE_OSS_NAME);
 
index 73c24cb..18630a3 100644 (file)
@@ -39,4 +39,13 @@ struct ost_thread_local_cache *ost_tls(struct ptlrpc_request *r);
 /* Quota stuff */
 extern quota_interface_t *quota_interface;
 
+#ifdef LPROCFS
+void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static void lprocfs_ost_init_vars(struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+#endif
+
 #endif /* OST_INTERNAL_H */
index 7fa3629..b12fff9 100644 (file)
@@ -101,4 +101,20 @@ int client_quota_check(struct obd_export *exp, struct obd_quotactl *oqctl);
 int lov_quota_check(struct obd_export *exp, struct obd_quotactl *oqctl);
 int client_quota_poll_check(struct obd_export *exp, struct if_quotacheck *qchk);
 
+#ifdef LPROCFS
+void lprocfs_quotactl_test_init_vars(struct lprocfs_static_vars *lvars);
+void lprocfs_quotacheck_test_init_vars(struct lprocfs_static_vars *lvars);
+#else
+static inline void lprocfs_quotactl_test_init_vars
+                                (struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+static inline void lprocfs_quotacheck_test_init_vars
+                                (struct lprocfs_static_vars *lvars)
+{
+        memset(lvars, 0, sizeof(*lvars));
+}
+#endif
+
 #endif
index 6c4acf3..a75f723 100644 (file)
@@ -148,6 +148,17 @@ static int quotacheck_run_tests(struct obd_device *obd, struct obd_device *tgt)
         return rc;
 }
 
+#ifdef LPROCFS
+static struct lprocfs_vars lprocfs_quotacheck_test_obd_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_quotacheck_test_module_vars[] = { {0} };
+#endif
+
+void lprocfs_quotacheck_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_quotacheck_test_module_vars;
+    lvars->obd_vars     = lprocfs_quotacheck_test_obd_vars;
+}
+
 static int quotacheck_test_cleanup(struct obd_device *obd)
 {
         lprocfs_obd_cleanup(obd);
@@ -156,7 +167,7 @@ static int quotacheck_test_cleanup(struct obd_device *obd)
 
 static int quotacheck_test_setup(struct obd_device *obd, obd_count len, void *buf)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
@@ -178,7 +189,7 @@ static int quotacheck_test_setup(struct obd_device *obd, obd_count len, void *bu
         if (rc)
                 quotacheck_test_cleanup(obd);
 
-        lprocfs_init_vars(quotacheck_test, &lvars);
+        lprocfs_quotacheck_test_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         RETURN(rc);
@@ -190,17 +201,11 @@ static struct obd_ops quotacheck_obd_ops = {
         .o_cleanup     = quotacheck_test_cleanup,
 };
 
-#ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-LPROCFS_INIT_VARS(quotacheck_test, lprocfs_module_vars, lprocfs_obd_vars)
-#endif
-
 static int __init quotacheck_test_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
 
-        lprocfs_init_vars(quotacheck_test, &lvars);
+        lprocfs_quotacheck_test_init_vars(&lvars);
         return class_register_type(&quotacheck_obd_ops, lvars.module_vars,
                                    "quotacheck_test");
 }
index 92ada91..90cb5b9 100644 (file)
@@ -288,6 +288,17 @@ static int quotactl_run_tests(struct obd_device *obd, struct obd_device *tgt)
         return rc;
 }
 
+#ifdef LPROCFS
+static struct lprocfs_vars lprocfs_quotactl_test_obd_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_quotactl_test_module_vars[] = { {0} };
+
+void lprocfs_quotactl_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_quotactl_test_module_vars;
+    lvars->obd_vars     = lprocfs_quotactl_test_obd_vars;
+}
+#endif
+
 static int quotactl_test_cleanup(struct obd_device *obd)
 {
         lprocfs_obd_cleanup(obd);
@@ -296,7 +307,7 @@ static int quotactl_test_cleanup(struct obd_device *obd)
 
 static int quotactl_test_setup(struct obd_device *obd, obd_count len, void *buf)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         struct lustre_cfg *lcfg = buf;
         struct obd_device *tgt;
         int rc;
@@ -314,7 +325,7 @@ static int quotactl_test_setup(struct obd_device *obd, obd_count len, void *buf)
                 RETURN(-EINVAL);
         }
 
-        lprocfs_init_vars(quotactl_test, &lvars);
+        lprocfs_quotactl_test_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         rc = quotactl_run_tests(obd, tgt);
@@ -330,17 +341,11 @@ static struct obd_ops quotactl_obd_ops = {
         .o_cleanup     = quotactl_test_cleanup,
 };
 
-#ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-LPROCFS_INIT_VARS(quotactl_test, lprocfs_module_vars, lprocfs_obd_vars)
-#endif
-
 static int __init quotactl_test_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
 
-        lprocfs_init_vars(quotactl_test, &lvars);
+        lprocfs_quotactl_test_init_vars(&lvars);
         return class_register_type(&quotactl_obd_ops, lvars.module_vars,
                                    "quotactl_test");
 }