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,
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; }
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 */
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
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), '-');
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 },
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);
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 */
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
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;
/* 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
{
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);
int __init lov_init(void)
{
- struct lprocfs_static_vars lvars;
+ struct lprocfs_static_vars lvars = { 0 };
int rc, rc2;
ENTRY;
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);
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 },
{ 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,
.llseek = seq_lseek,
.release = lprocfs_seq_release,
};
-
-LPROCFS_INIT_VARS(lov, lprocfs_module_vars, lprocfs_obd_vars)
#endif /* LPROCFS */
+
__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 */
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);
};
#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("fmt_obd_ops, lvars.module_vars,
"quotfmt_test");
}
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 },
{ 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 */
*/
#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 *);
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;
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);
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);
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);
}
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 */
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);
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);
}
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;
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
};
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 */
{ 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
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);
}
{
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;
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;}
{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
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;
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);
.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");
}
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,
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)
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);
}
#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 */
/* 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 */
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);
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,
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 */
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 },
{ 0 }
};
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_filter_module_vars[] = {
{ "num_refs", lprocfs_rd_numrefs, 0, 0 },
{ 0 }
};
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)
{
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 },
{ 0 }
};
-static struct lprocfs_vars lprocfs_module_vars[] = {
+static struct lprocfs_vars lprocfs_osc_module_vars[] = {
{ "num_refs", lprocfs_rd_numrefs, 0, 0 },
{ 0 }
};
&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 */
#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
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);
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);
};
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);
#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 */
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);
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);
/* 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 */
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
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);
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;
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);
.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("acheck_obd_ops, lvars.module_vars,
"quotacheck_test");
}
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);
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;
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);
.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("actl_obd_ops, lvars.module_vars,
"quotactl_test");
}