#define ldlm_proc_namespace(ns) do {} while (0)
#endif /* LPROCFS */
-struct ldlm_namespace *ldlm_namespace_new(char *name, ldlm_side_t client,
- ldlm_appetite_t apt)
+struct ldlm_namespace *
+ldlm_namespace_new(struct obd_device *obd, char *name,
+ ldlm_side_t client, ldlm_appetite_t apt)
{
struct ldlm_namespace *ns = NULL;
struct list_head *bucket;
ns->ns_shrink_thumb = LDLM_LOCK_SHRINK_THUMB;
ns->ns_appetite = apt;
+
+ LASSERT(obd != NULL);
+ ns->ns_obd = obd;
+
strcpy(ns->ns_name, name);
CFS_INIT_LIST_HEAD(&ns->ns_root_list);
return;
}
- /*
- * Fini pool _before_ parent proc dir is removed. This is important as
+ /* Fini pool _before_ parent proc dir is removed. This is important as
* ldlm_pool_fini() removes own proc dir which is child to @dir. Removing
- * it after @dir may cause oops.
- */
+ * it after @dir may cause oops. */
ldlm_pool_fini(&ns->ns_pool);
#ifdef LPROCFS
#endif
OBD_VFREE(ns->ns_hash, sizeof(*ns->ns_hash) * RES_HASH_SIZE);
OBD_FREE(ns->ns_name, strlen(ns->ns_name) + 1);
- /*
- * @ns should be not on list in this time, otherwise this will cause
- * issues realted to using freed @ns in pools thread.
- */
+
+ /* @ns should be not on list in this time, otherwise this will cause
+ * issues realted to using freed @ns in pools thread. */
LASSERT(list_empty(&ns->ns_list_chain));
OBD_FREE_PTR(ns);
ldlm_put_ref();