Whamcloud - gitweb
LU-5977 ofd: Removed correction for bad timestamps
[fs/lustre-release.git] / lustre / include / dt_object.h
index c192728..ced5a8e 100644 (file)
@@ -104,10 +104,13 @@ typedef void (*dt_cb_t)(struct lu_env *env, struct thandle *th,
 #define TRANS_COMMIT_CB_MAGIC  0xa0a00a0a
 #define MAX_COMMIT_CB_STR_LEN  32
 
+#define DCB_TRANS_STOP         0x1
 struct dt_txn_commit_cb {
        struct list_head        dcb_linkage;
        dt_cb_t                 dcb_func;
+       void                    *dcb_data;
        __u32                   dcb_magic;
+       __u32                   dcb_flags;
        char                    dcb_name[MAX_COMMIT_CB_STR_LEN];
 };
 
@@ -1265,7 +1268,7 @@ struct dt_body_operations {
         */
        int (*dbo_fiemap_get)(const struct lu_env *env,
                              struct dt_object *dt,
-                             struct ll_user_fiemap *fm);
+                             struct fiemap *fm);
 
        /**
         * Declare intention to deallocate space from an object.
@@ -1776,6 +1779,12 @@ static inline struct dt_object *lu2dt_obj(struct lu_object *o)
        return container_of0(o, struct dt_object, do_lu);
 }
 
+static inline struct dt_object *dt_object_child(struct dt_object *o)
+{
+       return container_of0(lu_object_next(&(o)->do_lu),
+                            struct dt_object, do_lu);
+}
+
 /**
  * This is the general purpose transaction handle.
  * 1. Transaction Life Cycle
@@ -1794,9 +1803,13 @@ struct thandle {
        /** the dt device on which the transactions are executed */
        struct dt_device *th_dev;
 
-       /* In some callback function, it needs to access the top_th directly */
-       struct thandle *th_top;
-
+       /* point to the top thandle, XXX this is a bit hacky right now,
+        * but normal device trans callback triggered by the bottom
+        * device (OSP/OSD == sub thandle layer) needs to get the
+        * top_thandle (see dt_txn_hook_start/stop()), so we put the
+        * top thandle here for now, will fix it when we have better
+        * callback mechanism */
+       struct thandle  *th_top;
        /** context for this transaction, tag is LCT_TX_HANDLE */
        struct lu_context th_ctx;
 
@@ -1810,7 +1823,11 @@ struct thandle {
        /** whether we need sync commit */
        unsigned int            th_sync:1,
        /* local transation, no need to inform other layers */
-                               th_local:1;
+                               th_local:1,
+       /* Whether we need wait the transaction to be submitted */
+                               th_wait_submit:1,
+       /* complex transaction which will track updates on all targets */
+                               th_complex:1;
 };
 
 /**
@@ -2374,7 +2391,7 @@ static inline int dt_punch(const struct lu_env *env, struct dt_object *dt,
 }
 
 static inline int dt_fiemap_get(const struct lu_env *env, struct dt_object *d,
-                                struct ll_user_fiemap *fm)
+                               struct fiemap *fm)
 {
         LASSERT(d);
         if (d->do_body_ops == NULL)
@@ -2623,8 +2640,6 @@ static inline int dt_lookup(const struct lu_env *env,
         return ret;
 }
 
-#define LU221_BAD_TIME (0x80000000U + 24 * 3600)
-
 struct dt_find_hint {
        struct lu_fid        *dfh_fid;
        struct dt_device     *dfh_dt;