Whamcloud - gitweb
LU-3569 ofd: packing ost_idx in IDIF
[fs/lustre-release.git] / lustre / lfsck / lfsck_internal.h
index 0a0e5e6..3d02d34 100644 (file)
@@ -42,8 +42,9 @@
 #include <lustre_net.h>
 #include <lustre_dlm.h>
 #include <lustre_fid.h>
+#include <md_object.h>
 
-#define HALF_SEC                       (CFS_HZ >> 1)
+#define HALF_SEC                       (HZ >> 1)
 #define LFSCK_CHECKPOINT_INTERVAL      60
 
 #define LFSCK_NAMEENTRY_DEAD           1 /* The object has been unlinked. */
@@ -80,7 +81,7 @@ enum lfsck_status {
 };
 
 enum lfsck_flags {
-       /* Finish to the cycle scanning. */
+       /* Finish the first cycle scanning. */
        LF_SCANNED_ONCE = 0x00000001ULL,
 
        /* There is some namespace inconsistency. */
@@ -293,7 +294,7 @@ struct lfsck_instance {
        struct dt_device         *li_bottom;
        struct ldlm_namespace    *li_namespace;
        struct local_oid_storage *li_los;
-       struct dt_object         *li_local_root; /* backend root "/" */
+       struct lu_fid             li_local_root_fid;  /* backend root "/" */
        struct lu_fid             li_global_root_fid; /* /ROOT */
        struct dt_object         *li_bookmark_obj;
        struct lfsck_bookmark     li_bookmark_ram;
@@ -312,6 +313,9 @@ struct lfsck_instance {
        /* It for directory traversal */
        struct dt_it             *li_di_dir;
 
+       /* namespace-based directory traversal position. */
+       __u64                     li_cookie_dir;
+
        /* Arguments for low layer otable-based iteration. */
        __u32                     li_args_oit;
 
@@ -349,6 +353,12 @@ struct lfsck_thread_info {
        struct lu_fid           lti_fid;
        struct lu_fid           lti_fid2;
        struct lu_attr          lti_la;
+       struct ost_id           lti_oi;
+       union {
+               struct lustre_mdt_attrs lti_lma;
+               /* old LMA for compatibility */
+               char                    lti_lma_old[LMA_OLD_SIZE];
+       };
        /* lti_ent and lti_key must be conjoint,
         * then lti_ent::lde_name will be lti_key. */
        struct lu_dirent        lti_ent;
@@ -509,7 +519,7 @@ static void inline lfsck_position_cpu_to_le(struct lfsck_position *des,
        des->lp_dir_cookie = cpu_to_le64(src->lp_dir_cookie);
 }
 
-static inline cfs_umode_t lfsck_object_type(const struct dt_object *obj)
+static inline umode_t lfsck_object_type(const struct dt_object *obj)
 {
        return lu_object_attr(&obj->do_lu);
 }
@@ -541,4 +551,9 @@ static inline void lfsck_object_put(const struct lu_env *env,
        lu_object_put(env, &obj->do_lu);
 }
 
+static inline mdsno_t lfsck_dev_idx(struct dt_device *dev)
+{
+       return dev->dd_lu_dev.ld_site->ld_seq_site->ss_node_id;
+}
+
 #endif /* _LFSCK_INTERNAL_H */