static inline void lmv_drop_intent_lock(struct lookup_intent *it)
{
- if (it->d.lustre.it_lock_mode != 0)
- ldlm_lock_decref((void *)&it->d.lustre.it_lock_handle,
+ if (it->d.lustre.it_lock_mode != 0) {
+ ldlm_lock_decref_and_cancel((void *)&it->d.lustre.it_lock_handle,
it->d.lustre.it_lock_mode);
+ }
}
int lmv_intent_remote(struct obd_export *exp, void *lmm,
rep->lock_policy_res1 |= flag;
}
+static int mdt_is_remote_object(struct mdt_object *o)
+{
+ return (o->mot_header.loh_attr & LOHA_REMOTE);
+}
+
static int mdt_getstatus(struct mdt_thread_info *info)
{
} else {
mdt_lock_handle_init(lhc);
lhc->mlh_mode = LCK_CR;
+ if (mdt_is_remote_object(child))
+ child_bits &= ~MDS_INODELOCK_LOOKUP;
rc = mdt_object_lock(info, child, lhc, child_bits);
}
if (rc == 0) {
if (!IS_ERR(o)) {
int rc;
+ if (mdt_is_remote_object(o)) {
+ /* FIXME: For remote object we can only give
+ * LOOKUP_lock, maybe we should not put it
+ * here, but only we know it is remote, after
+ * we got the object currently, maybe we need
+ * a way to know remote by fid on MDS. */
+ ibits &= ~MDS_INODELOCK_UPDATE;
+ ibits |= MDS_INODELOCK_LOOKUP;
+ }
+
rc = mdt_object_lock(info, o, lh, ibits);
if (rc != 0) {
mdt_object_put(info->mti_ctxt, o);