Whamcloud - gitweb
using cross-ref lock for link source object
authorhuanghua <huanghua>
Fri, 13 Oct 2006 03:53:56 +0000 (03:53 +0000)
committerhuanghua <huanghua>
Fri, 13 Oct 2006 03:53:56 +0000 (03:53 +0000)
lustre/mdt/mdt_reint.c

index e8844b9..f3ff4f4 100644 (file)
@@ -471,11 +471,14 @@ static int mdt_reint_link(struct mdt_thread_info *info,
         /* step 1: lock the source */
         lhs = &info->mti_lh[MDT_LH_PARENT];
         lhs->mlh_mode = LCK_EX;
-        ms = mdt_object_find_lock(info, rr->rr_fid1, lhs,
-                                  MDS_INODELOCK_UPDATE);
+        ms = mdt_object_find(info->mti_env, info->mti_mdt, rr->rr_fid1);
         if (IS_ERR(ms))
                 RETURN(PTR_ERR(ms));
 
+        rc = mdt_object_cr_lock(info, ms, lhs, MDS_INODELOCK_UPDATE);
+        if (rc != 0)
+                GOTO(out_unlock_source, rc);
+
         if (strlen(rr->rr_name) == 0) {
                 /* MDT holding name ask to add ref. */
                 mdt_set_capainfo(info, 0, rr->rr_fid1, BYPASS_CAPA);