@@ -1287,7 +1287,6 @@ static inline void ldlm_svc_get_eopc(const struct ldlm_request *dlm_req,
/* resource.c - internal */
struct ldlm_resource *ldlm_resource_get(struct ldlm_namespace *ns,
- struct ldlm_resource *parent,
const struct ldlm_res_id *,
enum ldlm_type type, int create);
struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res);
@@ -447,7 +447,7 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
type = oldres->lr_type;
unlock_res_and_lock(lock);
- newres = ldlm_resource_get(ns, NULL, new_resid, type, 1);
+ newres = ldlm_resource_get(ns, new_resid, type, 1);
if (IS_ERR(newres))
return PTR_ERR(newres);
@@ -1308,7 +1308,7 @@ enum ldlm_mode ldlm_lock_match_with_skip(struct ldlm_namespace *ns,
*data.lmd_mode = data.lmd_old->l_req_mode;
}
- res = ldlm_resource_get(ns, NULL, res_id, type, 0);
+ res = ldlm_resource_get(ns, res_id, type, 0);
if (IS_ERR(res)) {
LASSERT(!data.lmd_old);
return 0;
@@ -1537,7 +1537,7 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns,
struct ldlm_resource *res;
int rc;
- res = ldlm_resource_get(ns, NULL, res_id, type, 1);
+ res = ldlm_resource_get(ns, res_id, type, 1);
if (IS_ERR(res))
return ERR_CAST(res);
@@ -1887,7 +1887,7 @@ int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
int count;
int rc;
- res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+ res = ldlm_resource_get(ns, res_id, 0, 0);
if (IS_ERR(res)) {
/* This is not a problem. */
CDEBUG(D_INFO, "No resource %llu\n", res_id->name[0]);
@@ -2039,7 +2039,7 @@ int ldlm_resource_iterate(struct ldlm_namespace *ns,
LASSERTF(ns, "must pass in namespace\n");
- res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+ res = ldlm_resource_get(ns, res_id, 0, 0);
if (IS_ERR(res))
return 0;
@@ -1105,9 +1105,8 @@ static struct ldlm_resource *ldlm_resource_new(enum ldlm_type ldlm_type)
* Returns: referenced, unlocked ldlm_resource or NULL
*/
struct ldlm_resource *
-ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
- const struct ldlm_res_id *name, enum ldlm_type type,
- int create)
+ldlm_resource_get(struct ldlm_namespace *ns, const struct ldlm_res_id *name,
+ enum ldlm_type type, int create)
{
struct hlist_node *hnode;
struct ldlm_resource *res = NULL;
@@ -1116,7 +1115,6 @@ struct ldlm_resource *
int ns_refcount = 0;
int hash;
- LASSERT(!parent);
LASSERT(ns->ns_rs_hash);
LASSERT(name->name[0] != 0);
@@ -998,13 +998,14 @@ static int mdc_get_lock_handle(const struct lu_env *env, struct osc_object *osc,
OSC_DAP_FL_TEST_LOCK |
OSC_DAP_FL_CANCELING);
if (!lock) {
+ struct ldlm_namespace *ns;
struct ldlm_resource *res;
struct ldlm_res_id *resname;
resname = &osc_env_info(env)->oti_resname;
fid_build_reg_res_name(lu_object_fid(osc2lu(osc)), resname);
- res = ldlm_resource_get(osc_export(osc)->exp_obd->obd_namespace,
- NULL, resname, LDLM_IBITS, 0);
+ ns = osc_export(osc)->exp_obd->obd_namespace;
+ res = ldlm_resource_get(ns, resname, LDLM_IBITS, 0);
ldlm_resource_dump(D_ERROR, res);
libcfs_debug_dumpstack(NULL);
rc = -ENOENT;
@@ -177,7 +177,7 @@ int mdc_null_inode(struct obd_export *exp,
fid_build_reg_res_name(fid, &res_id);
- res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
+ res = ldlm_resource_get(ns, &res_id, 0, 0);
if (IS_ERR(res))
return 0;
@@ -81,7 +81,7 @@ int mdc_resource_get_unused_res(struct obd_export *exp,
if (exp_connect_cancelset(exp) && !ns_connect_cancelset(ns))
return 0;
- res = ldlm_resource_get(ns, NULL, res_id, 0, 0);
+ res = ldlm_resource_get(ns, res_id, 0, 0);
if (IS_ERR(res))
return 0;
LDLM_RESOURCE_ADDREF(res);
@@ -389,6 +389,7 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
lock = osc_dlmlock_at_pgoff(env, cl2osc(obj), osc_index(opg),
OSC_DAP_FL_TEST_LOCK | OSC_DAP_FL_CANCELING);
if (!lock && !opg->ops_srvlock) {
+ struct ldlm_namespace *ns;
struct ldlm_resource *res;
struct ldlm_res_id *resname;
@@ -397,9 +398,8 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
resname = &osc_env_info(env)->oti_resname;
ostid_build_res_name(&oinfo->loi_oi, resname);
- res = ldlm_resource_get(
- osc_export(cl2osc(obj))->exp_obd->obd_namespace,
- NULL, resname, LDLM_EXTENT, 0);
+ ns = osc_export(cl2osc(obj))->exp_obd->obd_namespace;
+ res = ldlm_resource_get(ns, resname, LDLM_EXTENT, 0);
ldlm_resource_dump(D_ERROR, res);
libcfs_debug_dumpstack(NULL);
LBUG();
@@ -587,7 +587,7 @@ static int osc_resource_get_unused(struct obd_export *exp, struct obdo *oa,
return 0;
ostid_build_res_name(&oa->o_oi, &res_id);
- res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
+ res = ldlm_resource_get(ns, &res_id, 0, 0);
if (IS_ERR(res))
return 0;