ENTRY;
CDEBUG(D_INFO, "Find object for "DFID"\n", PFID(f));
- o = lu_object_find(env, d->mdt_md_dev.md_lu_dev.ld_site, f);
+ o = lu_object_find(env, &d->mdt_md_dev.md_lu_dev, f, NULL);
if (unlikely(IS_ERR(o)))
m = (struct mdt_object *)o;
else
}
/*
- * Finish res_id initializing by name hash marking patr of
+ * Finish res_id initializing by name hash marking part of
* directory which is taking modification.
*/
res_id->name[LUSTRE_RES_ID_HSH_OFF] = lh->mlh_pdo_hash;
* lock.
*/
if (new_lock == NULL)
- new_lock = ldlm_handle2lock(&lh->mlh_reg_lh);
+ new_lock = ldlm_handle2lock_long(&lh->mlh_reg_lh, 0);
if (new_lock == NULL && (flags & LDLM_FL_INTENT_ONLY)) {
lh->mlh_reg_lh.cookie = 0;
* Fixup the lock to be given to the client.
*/
lock_res_and_lock(new_lock);
- new_lock->l_readers = 0;
- new_lock->l_writers = 0;
+ /* Zero new_lock->l_readers and new_lock->l_writers without triggering
+ * possible blocking AST. */
+ while (new_lock->l_readers > 0) {
+ lu_ref_del(&new_lock->l_reference, "reader", new_lock);
+ lu_ref_del(&new_lock->l_reference, "user", new_lock);
+ new_lock->l_readers--;
+ }
+ while (new_lock->l_writers > 0) {
+ lu_ref_del(&new_lock->l_reference, "writer", new_lock);
+ lu_ref_del(&new_lock->l_reference, "user", new_lock);
+ new_lock->l_writers--;
+ }
new_lock->l_export = class_export_get(req->rq_export);
new_lock->l_blocking_ast = lock->l_blocking_ast;
&new_lock->l_exp_hash);
unlock_res_and_lock(new_lock);
- LDLM_LOCK_PUT(new_lock);
+ LDLM_LOCK_RELEASE(new_lock);
lh->mlh_reg_lh.cookie = 0;
RETURN(ELDLM_LOCK_REPLACED);
m->mdt_bottom = NULL;
}
-static struct lu_device *mdt_layer_setup(const struct lu_env *env,
+static struct lu_device *mdt_layer_setup(struct lu_env *env,
const char *typename,
struct lu_device *child,
struct lustre_cfg *cfg)
return ERR_PTR(rc);
}
-static int mdt_stack_init(const struct lu_env *env,
+static int mdt_stack_init(struct lu_env *env,
struct mdt_device *m, struct lustre_cfg *cfg)
{
struct lu_device *d = &m->mdt_md_dev.md_lu_dev;
}
/* init the stack */
- rc = mdt_stack_init(env, m, cfg);
+ rc = mdt_stack_init((struct lu_env *)env, m, cfg);
if (rc) {
CERROR("Can't init device stack, rc %d\n", rc);
GOTO(err_fini_proc, rc);
RETURN(NULL);
}
-static int mdt_object_init(const struct lu_env *env, struct lu_object *o)
+static int mdt_object_init(const struct lu_env *env, struct lu_object *o,
+ const struct lu_object_conf *_)
{
struct mdt_device *d = mdt_dev(o->lo_dev);
struct lu_device *under;