#include <lprocfs_status.h>
#include <libcfs/list.h>
#include <lustre_param.h>
+#include <class_hash.h>
+
+extern struct lustre_hash_operations uuid_hash_operations;
+extern struct lustre_hash_operations nid_hash_operations;
/*********** string parsing utils *********/
cfs_init_timer(&obd->obd_recovery_timer);
spin_lock_init(&obd->obd_processing_task_lock);
cfs_waitq_init(&obd->obd_next_transno_waitq);
+ cfs_waitq_init(&obd->obd_evict_inprogress_waitq);
CFS_INIT_LIST_HEAD(&obd->obd_req_replay_queue);
CFS_INIT_LIST_HEAD(&obd->obd_lock_replay_queue);
CFS_INIT_LIST_HEAD(&obd->obd_final_req_queue);
obd->obd_starting = 1;
spin_unlock(&obd->obd_dev_lock);
+ /* create an uuid-export hash body */
+ err = lustre_hash_init(&obd->obd_uuid_hash_body, "UUID_HASH",
+ 128, &uuid_hash_operations);
+ if (err) {
+ GOTO(err_hash, err);
+ }
+
+ /* create a nid-export hash body */
+ err = lustre_hash_init(&obd->obd_nid_hash_body, "NID_HASH",
+ 128, &nid_hash_operations);
+ if (err)
+ GOTO(err_hash, err);
+
exp = class_new_export(obd, &obd->obd_uuid);
if (IS_ERR(exp))
RETURN(PTR_ERR(exp));
RETURN(0);
err_exp:
- CERROR("setup %s failed (%d)\n", obd->obd_name, err);
class_unlink_export(obd->obd_self_export);
obd->obd_self_export = NULL;
+err_hash:
+ lustre_hash_exit(&obd->obd_uuid_hash_body);
+ lustre_hash_exit(&obd->obd_nid_hash_body);
obd->obd_starting = 0;
+ CERROR("setup %s failed (%d)\n", obd->obd_name, err);
RETURN(err);
}
}
LASSERT(obd->obd_self_export);
+ /* destroy an uuid-export hash body */
+ lustre_hash_exit(&obd->obd_uuid_hash_body);
+
+ /* destroy a nid-export hash body */
+ lustre_hash_exit(&obd->obd_nid_hash_body);
+
/* Precleanup stage 1, we must make sure all exports (other than the
self-export) get destroyed. */
err = obd_precleanup(obd, OBD_CLEANUP_EXPORTS);