void lu_context_exit(struct lu_context *ctx);
/*
+ * One-time initializers, called at obdclass module initialization, not
+ * exported.
+ */
+
+/*
* Initialization of global lu_* data.
*/
int lu_global_init(void);
mdt_num_threads = MDT_NUM_THREADS;
lprocfs_init_vars(mdt, &lvars);
- result = lu_global_init();
- if (result == 0)
- result = class_register_type(&mdt_obd_device_ops, NULL,
- lvars.module_vars,
- LUSTRE_MDT0_NAME,
- &mdt_device_type);
+ result = class_register_type(&mdt_obd_device_ops, NULL,
+ lvars.module_vars, LUSTRE_MDT0_NAME,
+ &mdt_device_type);
return result;
}
static void __exit mdt_mod_exit(void)
{
class_unregister_type(LUSTRE_MDT0_NAME);
- lu_global_fini();
}
if (!data->ioc_inlbuf1) {
CERROR("No buffer passed in ioctl\n");
GOTO(out, err = -EINVAL);
- }
+ }
if (data->ioc_inllen1 < 128) {
CERROR("ioctl buffer too small to hold version\n");
GOTO(out, err = -EINVAL);
}
-
+
if (index >= MAX_OBD_DEVICES)
GOTO(out, err = -ENOENT);
obd = &obd_dev[index];
if (!obd->obd_type)
GOTO(out, err = -ENOENT);
-
+
if (obd->obd_stopping)
status = "ST";
else if (obd->obd_set_up)
else if (obd->obd_attached)
status = "AT";
else
- status = "--";
+ status = "--";
str = (char *)data->ioc_bulk;
snprintf(str, len - sizeof(*data), "%3d %s %s %s %s %d",
(int)index, status, obd->obd_type->typ_name,
if (err)
return err;
#ifdef __KERNEL__
+ err = lu_global_init();
+ if (err)
+ return err;
err = class_procfs_init();
lustre_register_fs();
#endif
OBP(obd, detach)(obd);
}
}
+ lu_global_fini();
obd_cleanup_caches();
obd_sysctl_clean();
*/
int lu_global_init(void)
{
- static int initialized = 0;
int result;
- if (!initialized) {
- result = lu_context_key_register(&lu_cdebug_key);
- initialized = 1;
- } else {
- CERROR("Double initialization\n");
- result = 0;
- }
+ result = lu_context_key_register(&lu_cdebug_key);
return result;
}
-EXPORT_SYMBOL(lu_global_init);
/*
* Dual to lu_global_init().
{
lu_context_key_degister(&lu_cdebug_key);
}
-EXPORT_SYMBOL(lu_global_fini);