Whamcloud - gitweb
LU-7521 ldlm: LDLM_DEBUG() shouldn't be passed \n
[fs/lustre-release.git] / lustre / osp / osp_md_object.c
index 26996f6..21ccacf 100644 (file)
@@ -889,21 +889,15 @@ static int osp_md_object_lock(const struct lu_env *env,
        struct lu_device        *top_device;
        struct ptlrpc_request   *req;
        int                     rc = 0;
-       __u64                   flags = 0;
-       enum ldlm_mode          mode;
+       __u64                   flags = LDLM_FL_NO_LRU;
 
        res_id = einfo->ei_res_id;
        LASSERT(res_id != NULL);
 
-       mode = ldlm_lock_match(osp->opd_obd->obd_namespace,
-                              LDLM_FL_BLOCK_GRANTED, res_id,
-                              einfo->ei_type, policy,
-                              einfo->ei_mode, lh, 0);
-       if (mode > 0)
-               return ELDLM_OK;
-
        if (einfo->ei_nonblock)
                flags |= LDLM_FL_BLOCK_NOWAIT;
+       if (einfo->ei_mode & (LCK_EX | LCK_PW))
+               flags |= LDLM_FL_COS_INCOMPAT;
 
        req = ldlm_enqueue_pack(osp->opd_exp, 0);
        if (IS_ERR(req))
@@ -923,13 +917,6 @@ static int osp_md_object_lock(const struct lu_env *env,
                              &flags, NULL, 0, LVB_T_NONE, lh, 0);
 
        ptlrpc_req_finished(req);
-       if (rc == ELDLM_OK) {
-               struct ldlm_lock *lock;
-
-               lock = __ldlm_handle2lock(lh, 0);
-               ldlm_set_cbpending(lock);
-               LDLM_LOCK_PUT(lock);
-       }
 
        return rc == ELDLM_OK ? 0 : -EIO;
 }