Whamcloud - gitweb
LU-15095 target: lbug_on_grant_miscount module parameter
[fs/lustre-release.git] / lustre / include / lu_target.h
index 2a109b0..2a361ac 100644 (file)
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _LUSTRE_LU_TARGET_H
@@ -38,6 +37,7 @@
 #include <lustre_update.h>
 #include <lustre_disk.h>
 #include <lustre_lfsck.h>
+#include <lu_object.h>
 
 /* Each one represents a distribute transaction replay
  * operation, and updates on each MDTs are linked to
@@ -241,6 +241,8 @@ struct tg_reply_data {
        int                     trd_index;
        /** tag the client used */
        __u16                   trd_tag;
+       /** child fid to reconstruct open */
+       struct lu_fid           trd_object;
 };
 
 extern struct lu_context_key tgt_session_key;
@@ -272,6 +274,8 @@ struct tgt_session_info {
 
        /* object affected by VBR, for last_rcvd_update */
        struct dt_object        *tsi_vbr_obj;
+       /* open child object, for last_rcvd_update */
+       struct dt_object        *tsi_open_obj;
        /* opdata for mdt_reint_open(), has the same value as
         * ldlm_reply:lock_policy_res1.  The tgt_update_last_rcvd() stores
         * this value onto disk for recovery when tgt_txn_stop_cb() is called.
@@ -313,6 +317,17 @@ static inline void tgt_vbr_obj_set(const struct lu_env *env,
        }
 }
 
+static inline void tgt_open_obj_set(const struct lu_env *env,
+                                  struct dt_object *obj)
+{
+       struct tgt_session_info *tsi;
+
+       if (env->le_ses != NULL) {
+               tsi = tgt_ses_info(env);
+               tsi->tsi_open_obj = obj;
+       }
+}
+
 static inline void tgt_opdata_set(const struct lu_env *env, __u64 flags)
 {
        struct tgt_session_info *tsi;