/********************** class fns **********************/
-/* Create a new device and set the type, name and uuid. If
- * successful, the new device can be accessed by either name or uuid.
+/**
+ * Create a new device and set the type, name and uuid. If successful, the new
+ * device can be accessed by either name or uuid.
*/
int class_attach(struct lustre_cfg *lcfg)
{
LASSERTF(strncmp(obd->obd_name, name, strlen(name)) == 0, "%p obd_name %s != %s\n",
obd, obd->obd_name, name);
+ rwlock_init(&obd->obd_pool_lock);
+ obd->obd_pool_limit = 0;
+ obd->obd_pool_slv = 0;
+
CFS_INIT_LIST_HEAD(&obd->obd_exports);
CFS_INIT_LIST_HEAD(&obd->obd_exports_timed);
CFS_INIT_LIST_HEAD(&obd->obd_nid_stats);
len = strlen(uuid);
if (len >= sizeof(obd->obd_uuid)) {
- CERROR("uuid must be < "LPSZ" bytes long\n",
- sizeof(obd->obd_uuid));
+ CERROR("uuid must be < %d bytes long\n",
+ (int)sizeof(obd->obd_uuid));
GOTO(out, rc = -EINVAL);
}
memcpy(obd->obd_uuid.uuid, uuid, len);
obd->obd_name, obd->obd_uuid.uuid);
class_decref(obd);
-
+
/* not strictly necessary, but cleans up eagerly */
obd_zombie_impexp_cull();
-
+
RETURN(0);
}
/* destroy a nid-stats hash body */
lustre_hash_exit(&obd->obd_nid_stats_hash_body);
- /* Precleanup stage 1, we must make sure all exports (other than the
- self-export) get destroyed. */
+ /* Precleanup, we must make sure all exports get destroyed. */
err = obd_precleanup(obd, OBD_CLEANUP_EXPORTS);
if (err)
CERROR("Precleanup %s returned %d\n",
CDEBUG(D_INFO, "Decref %s (%p) now %d\n", obd->obd_name, obd, refs);
if ((refs == 1) && obd->obd_stopping) {
- /* All exports (other than the self-export) have been
- destroyed; there should be no more in-progress ops
- by this point.*/
- /* if we're not stopping, we didn't finish setup */
- /* Precleanup stage 2, do other type-specific
- cleanup requiring the self-export. */
- err = obd_precleanup(obd, OBD_CLEANUP_SELF_EXP);
- if (err)
- CERROR("Precleanup %s returned %d\n",
- obd->obd_name, err);
-
+ /* All exports have been destroyed; there should
+ be no more in-progress ops by this point.*/
+
spin_lock(&obd->obd_self_export->exp_lock);
obd->obd_self_export->exp_flags |=
(obd->obd_fail ? OBD_OPT_FAILOVER : 0) |
CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n",
obd_timeout, lcfg->lcfg_num);
obd_timeout = max(lcfg->lcfg_num, 1U);
- obd_health_check_timeout = HEALTH_CHECK_TIMEOUT;
GOTO(out, err = 0);
}
case LCFG_SET_UPCALL: {
if (!matched) {
CERROR("%s: unknown param %s\n",
(char *)lustre_cfg_string(lcfg, 0), key);
- rc = -EINVAL;
- /* continue parsing other params */
+ /* rc = -EINVAL; continue parsing other params */
} else {
LCONSOLE_INFO("%s.%.*s: set parameter %.*s=%s\n",
(char *)lustre_cfg_string(lcfg, 0),