Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Mon, 23 Oct 2006 13:57:00 +0000 (13:57 +0000)
committerwangdi <wangdi>
Mon, 23 Oct 2006 13:57:00 +0000 (13:57 +0000)
since we already set no_need_trans for split. so remove this ugly hack
for split.

lustre/cmm/cmm_split.c
lustre/mdd/mdd_object.c

index a7ad53f..9192b7d 100644 (file)
@@ -541,9 +541,10 @@ int cmm_try_to_split(const struct lu_env *env, struct md_object *mo)
         /* Step4: Set mea to the master object. */
         rc = mo_xattr_set(env, md_object_next(mo), buf,
                           MDS_LMV_MD_NAME, 0);
-        if (rc == -ERESTART) {
+        if (rc == 0) {
                 CWARN("Dir "DFID" has been split\n",
                       PFID(lu_object_fid(&mo->mo_lu)));
+                rc = -ERESTART;
         }
         EXIT;
 cleanup:
index ac75ba6..029f9a6 100644 (file)
@@ -831,19 +831,7 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
 
         rc = mdd_xattr_set_txn(env, md2mdd_obj(obj), buf, name,
                                fl, handle);
-#ifdef HAVE_SPLIT_SUPPORT
-        if (rc == 0) {
-                /*
-                 * XXX: Very ugly hack, if setting lmv, it means splitting
-                 * sucess, we should return -ERESTART to notify the client, so
-                 * transno for this splitting should be zero according to the
-                 * replay rules. so return -ERESTART here let mdt trans stop
-                 * callback know this.
-                 */
-                 if (strncmp(name, MDS_LMV_MD_NAME, strlen(name)) == 0)
-                         rc = -ERESTART;
-        }
-#endif
+
         mdd_trans_stop(env, mdd, rc, handle);
 
         RETURN(rc);