Whamcloud - gitweb
Branch: b_new_cmd
authorwangdi <wangdi>
Sat, 5 Aug 2006 15:10:43 +0000 (15:10 +0000)
committerwangdi <wangdi>
Sat, 5 Aug 2006 15:10:43 +0000 (15:10 +0000)
1)still create data object in mdd_create, since they should be in the same
  transaction and create data rpc (to ost) should not inside transtaction.
2)some cleanup according to nikita's comments

lustre/mdd/mdd_handler.c
lustre/mdt/mdt_internal.h
lustre/mdt/mdt_open.c

index a53a440..65ddd4b 100644 (file)
@@ -1029,7 +1029,15 @@ static int mdd_create(const struct lu_context *ctxt, struct md_object *pobj,
         rc = mdd_create_sanity_check(ctxt, mdd, pobj, name, ma);
         if (rc)
                 RETURN(rc);
-
+        /* no RPC inside the transaction, so OST objects should be created at
+         * first */
+        if (S_ISREG(attr->la_mode)) {
+                rc = mdd_lov_create(ctxt, mdd, mdo, son, &lmm, &lmm_size,
+                                    eadata, eadatasize, attr);
+                if (rc)
+                        RETURN(rc);
+        }
+        
         mdd_txn_param_build(ctxt, &MDD_TXN_MKDIR);
         handle = mdd_trans_start(ctxt, mdd);
         if (IS_ERR(handle))
@@ -1100,7 +1108,13 @@ static int mdd_create(const struct lu_context *ctxt, struct md_object *pobj,
                 GOTO(cleanup, rc);
 
         inserted = 1;
-
+        rc = mdd_lov_set_md(ctxt, pobj, child, lmm, lmm_size, attr->la_mode, 
+                            handle);
+        if (rc) {
+                CERROR("error on stripe info copy %d \n", rc);
+                GOTO(cleanup, rc);
+        }
+        
         if (S_ISLNK(attr->la_mode)) {
                 struct dt_object *dt = mdd_object_child(son);
                 loff_t pos = 0;
index 8d9f91d..d651a2c 100644 (file)
@@ -177,8 +177,9 @@ struct mdt_reint_record {
 
 };
 
-#define MDT_NONEED_TANSNO  0x0000001 /*Do not need transno for this req*/
-
+enum {
+        MDT_NONEED_TANSNO = (1 << 0) /*Do not need transno for this req*/
+};
 /*
  * Common data shared by mdt-level handlers. This is allocated per-thread to
  * reduce stack consumption.
index 397c78b..711faf3 100644 (file)
@@ -288,8 +288,7 @@ int mdt_reint_open(struct mdt_thread_info *info)
                 RETURN(result);
 
         ma->ma_lmm = req_capsule_server_get(&info->mti_pill, &RMF_MDT_MD);
-        ma->ma_lmm_size = req_capsule_get_size(&info->mti_pill,
-                                               &RMF_MDT_MD, RCL_SERVER);
+        ma->ma_lmm_size = mdt->mdt_max_mdsize;
 
         if (rr->rr_name[0] == 0) {
                 /* reint partial remote open */