Whamcloud - gitweb
b=19427 correct lmm_object_id and reserve fids for fid-on-OST.
[fs/lustre-release.git] / lustre / osc / osc_create.c
index cbe8d5d..6c555d5 100644 (file)
@@ -95,7 +95,7 @@ static int osc_interpret_create(const struct lu_env *env,
         switch (rc) {
         case 0: {
                 if (body) {
-                        int diff = body->oa.o_id - oscc->oscc_last_id;
+                        int diff =ostid_id(&body->oa.o_oi)- oscc->oscc_last_id;
 
                         /* oscc_internal_create() stores the original value of
                          * grow_count in rq_async_args.space[0].
@@ -117,7 +117,7 @@ static int osc_interpret_create(const struct lu_env *env,
                                  * next time if needed */
                                 oscc->oscc_flags &= ~OSCC_FLAG_LOW;
                         }
-                        oscc->oscc_last_id = body->oa.o_id;
+                        oscc->oscc_last_id = ostid_id(&body->oa.o_oi);
                 }
                 cfs_spin_unlock(&oscc->oscc_lock);
                 break;
@@ -238,9 +238,18 @@ static int oscc_internal_create(struct osc_creator *oscc)
         body = req_capsule_client_get(&request->rq_pill, &RMF_OST_BODY);
 
         cfs_spin_lock(&oscc->oscc_lock);
-        body->oa.o_id = oscc->oscc_last_id + oscc->oscc_grow_count;
-        body->oa.o_gr = oscc->oscc_oa.o_gr;
-        LASSERT_MDS_GROUP(body->oa.o_gr);
+
+        if (likely(fid_seq_is_mdt(oscc->oscc_oa.o_seq))) {
+                body->oa.o_oi.oi_seq = oscc->oscc_oa.o_seq;
+                body->oa.o_oi.oi_id  = oscc->oscc_last_id +
+                                       oscc->oscc_grow_count;
+        } else {
+                /*Just warning here currently, since not sure how fid-on-ost
+                 *will be implemented here */
+                CWARN("o_seq: "LPU64" is not indicate any MDTs.\n",
+                       oscc->oscc_oa.o_seq);
+        }
+
         body->oa.o_valid |= OBD_MD_FLID | OBD_MD_FLGROUP;
         request->rq_async_args.space[0] = oscc->oscc_grow_count;
         cfs_spin_unlock(&oscc->oscc_lock);
@@ -450,7 +459,7 @@ int osc_create_async(struct obd_export *exp, struct obd_info *oinfo,
         struct obdo *oa = oinfo->oi_oa;
         ENTRY;
 
-        if ((oa->o_valid & OBD_MD_FLGROUP) && !filter_group_is_mds(oa->o_gr)) {
+        if ((oa->o_valid & OBD_MD_FLGROUP) && !fid_seq_is_mdt(oa->o_seq)) {
                 rc = osc_real_create(exp, oinfo->oi_oa, ea, oti);
                 rc = oinfo->oi_cb_up(oinfo, rc);
                 RETURN(rc);
@@ -524,7 +533,7 @@ int osc_create(struct obd_export *exp, struct obdo *oa,
                 RETURN(osc_real_create(exp, oa, ea, oti));
         }
 
-        if (!filter_group_is_mds(oa->o_gr))
+        if (!fid_seq_is_mdt(oa->o_seq))
                 RETURN(osc_real_create(exp, oa, ea, oti));
 
         /* this is the special case where create removes orphans */