Whamcloud - gitweb
LU-1866 lfsck: enhance otable-based iteration
[fs/lustre-release.git] / lustre / include / dt_object.h
index 9aa277e..07f9a4b 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -65,7 +65,6 @@ struct thandle;
 struct dt_device;
 struct dt_object;
 struct dt_index_features;
-struct dt_quota_ctxt;
 struct niobuf_local;
 struct niobuf_remote;
 
@@ -174,12 +173,6 @@ struct dt_device_operations {
                                    struct dt_device *dev,
                                    int mode, unsigned long timeout,
                                    __u32 alg, struct lustre_capa_key *keys);
-        /**
-         * Initialize quota context.
-         */
-        void (*dt_init_quota_ctxt)(const struct lu_env *env,
-                                   struct dt_device *dev,
-                                   struct dt_quota_ctxt *ctxt, void *data);
 };
 
 struct dt_index_features {
@@ -262,6 +255,7 @@ struct dt_object_format {
         enum dt_format_type dof_type;
         union {
                 struct dof_regular {
+                       int striped;
                 } dof_reg;
                 struct dof_dir {
                 } dof_dir;
@@ -688,7 +682,7 @@ struct local_oid_storage {
        struct dt_object *los_obj;
 
        /* data used to generate new fids */
-       cfs_mutex_t       los_id_lock;
+       struct mutex     los_id_lock;
        __u64             los_seq;
        __u32             los_last_oid;
 };
@@ -709,6 +703,12 @@ static inline int dt_object_exists(const struct dt_object *dt)
         return lu_object_exists(&dt->do_lu);
 }
 
+static inline struct dt_object *lu2dt_obj(struct lu_object *o)
+{
+       LASSERT(ergo(o != NULL, lu_device_is_dt(o->lo_dev)));
+       return container_of0(o, struct dt_object, do_lu);
+}
+
 /**
  * This is the general purpose transaction handle.
  * 1. Transaction Life Cycle
@@ -724,24 +724,32 @@ static inline int dt_object_exists(const struct dt_object *dt)
  *      No RPC request should be issued inside transaction.
  */
 struct thandle {
-        /** the dt device on which the transactions are executed */
-        struct dt_device *th_dev;
+       /** the dt device on which the transactions are executed */
+       struct dt_device *th_dev;
+
+       /** context for this transaction, tag is LCT_TX_HANDLE */
+       struct lu_context th_ctx;
 
-        /** additional tags (layers can add in declare) */
-        __u32             th_tags;
+       /** additional tags (layers can add in declare) */
+       __u32             th_tags;
 
-        /** context for this transaction, tag is LCT_TX_HANDLE */
-        struct lu_context th_ctx;
+       /** the last operation result in this transaction.
+        * this value is used in recovery */
+       __s32             th_result;
 
-        /** the last operation result in this transaction.
-         * this value is used in recovery */
-        __s32             th_result;
+       /** whether we need sync commit */
+       int               th_sync:1;
 
-        /** whether we need sync commit */
-        int               th_sync:1;
+       /* local transation, no need to inform other layers */
+       int               th_local:1;
 
-        /* local transation, no need to inform other layers */
-        int               th_local:1;
+       /* In DNE, one transaction can be disassemblied into
+        * updates on several different MDTs, and these updates
+        * will be attached to th_remote_update_list per target.
+        * Only single thread will access the list, no need lock
+        */
+       cfs_list_t              th_remote_update_list;
+       struct update_request   *th_current_request;
 };
 
 /**