static int __init llog_test_init(void) { struct lprocfs_static_vars uninitialized_var(lvars); lprocfs_llog_test_init_vars(&lvars); return class_register_type(&llog_obd_ops, NULL, lvars.module_vars, "llog_test", NULL); }
static int llog_test_setup(struct obd_device *obd, struct lustre_cfg *lcfg) { struct lprocfs_static_vars lvars; struct obd_device *tgt; int rc; ENTRY; if (lcfg->lcfg_bufcount < 2) { CERROR("requires a TARGET OBD name\n"); RETURN(-EINVAL); } if (lcfg->lcfg_buflens[1] < 1) { CERROR("requires a TARGET OBD name\n"); RETURN(-EINVAL); } /* disk obd */ tgt = class_name2obd(lustre_cfg_string(lcfg, 1)); if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) { CERROR("target device not attached or not set up (%s)\n", lustre_cfg_string(lcfg, 1)); RETURN(-EINVAL); } rc = obd_llog_init(obd, NULL, tgt, NULL); if (rc) RETURN(rc); llog_test_rand = cfs_rand(); rc = llog_run_tests(obd); if (rc) llog_test_cleanup(obd); lprocfs_llog_test_init_vars(&lvars); lprocfs_obd_setup(obd, lvars.obd_vars); RETURN(rc); }