Whamcloud - gitweb
LU-10496 tgt: move FMD handling from OFD to target
[fs/lustre-release.git] / lustre / mdt / mdt_io.c
index 3124c8c..3999e26 100644 (file)
@@ -702,7 +702,10 @@ int mdt_obd_commitrw(const struct lu_env *env, int cmd, struct obd_export *exp,
                 * doesn't already exist so we can store the reservation handle
                 * there. */
                valid = OBD_MD_FLUID | OBD_MD_FLGID;
-               valid |= OBD_MD_FLATIME | OBD_MD_FLMTIME | OBD_MD_FLCTIME;
+               if (tgt_fmd_check(exp, mdt_object_fid(mo),
+                                 mdt_info_req(info)->rq_xid))
+                       valid |= OBD_MD_FLATIME | OBD_MD_FLMTIME |
+                                OBD_MD_FLCTIME;
 
                la_from_obdo(la, oa, valid);
 
@@ -890,6 +893,11 @@ int mdt_punch_hdl(struct tgt_session_info *tsi)
        la->la_size = start;
        la->la_valid |= LA_SIZE;
 
+       /* MDT supports FMD for Data-on-MDT needs */
+       if (la->la_valid & (LA_ATIME | LA_MTIME | LA_CTIME))
+               tgt_fmd_update(tsi->tsi_exp, &tsi->tsi_fid,
+                              tgt_ses_req(tsi)->rq_xid);
+
        rc = mdt_object_punch(tsi->tsi_env, mdt->mdt_bottom, dob,
                              start, end, la);
        mdt_dom_write_unlock(mo);