/** Flag indicating if namespace is on client instead of server */
enum ldlm_side ns_client;
+ /** name of this namespace */
+ char *ns_name;
+
/** Resource hash table for namespace. */
struct cfs_hash *ns_rs_hash;
static inline char *
ldlm_ns_name(struct ldlm_namespace *ns)
{
- return ns->ns_rs_hash->hs_name;
+ return ns->ns_name;
}
static inline struct ldlm_namespace *
ns->ns_obd = obd;
ns->ns_appetite = apt;
ns->ns_client = client;
+ ns->ns_name = kstrdup(name, GFP_KERNEL);
+ if (!ns->ns_name)
+ goto out_hash;
INIT_LIST_HEAD(&ns->ns_list_chain);
INIT_LIST_HEAD(&ns->ns_unused_list);
ldlm_namespace_sysfs_unregister(ns);
ldlm_namespace_cleanup(ns, 0);
out_hash:
+ kfree(ns->ns_name);
cfs_hash_putref(ns->ns_rs_hash);
out_ns:
kfree(ns);
ldlm_namespace_debugfs_unregister(ns);
ldlm_namespace_sysfs_unregister(ns);
cfs_hash_putref(ns->ns_rs_hash);
+ kfree(ns->ns_name);
/* Namespace \a ns should be not on list at this time, otherwise
* this will cause issues related to using freed \a ns in poold
* thread.