Whamcloud - gitweb
LU-1267 lfsck: rebuild LAST_ID
[fs/lustre-release.git] / lustre / lfsck / lfsck_internal.h
index 3676341..1c16e06 100644 (file)
@@ -40,6 +40,7 @@
 #include <obd.h>
 #include <lu_object.h>
 #include <dt_object.h>
+#include <md_object.h>
 #include <lustre_net.h>
 #include <lustre_dlm.h>
 #include <lustre_fid.h>
@@ -65,6 +66,9 @@ enum lfsck_flags {
        /* The server ever restarted during the LFSCK, and may miss to process
         * some objects check/repair. */
        LF_INCOMPLETE           = 0x00000008ULL,
+
+       /* The LAST_ID (file) crashed. */
+       LF_CRASHED_LASTID       = 0x00000010ULL,
 };
 
 struct lfsck_position {
@@ -283,6 +287,9 @@ struct lfsck_operations {
 
        int (*lfsck_double_scan)(const struct lu_env *env,
                                 struct lfsck_component *com);
+
+       void (*lfsck_data_release)(const struct lu_env *env,
+                                  struct lfsck_component *com);
 };
 
 struct lfsck_component {
@@ -300,6 +307,7 @@ struct lfsck_component {
        struct lfsck_operations *lc_ops;
        void                    *lc_file_ram;
        void                    *lc_file_disk;
+       void                    *lc_data;
 
        /* The time for last checkpoint, jiffies */
        cfs_time_t               lc_time_last_checkpoint;
@@ -349,6 +357,8 @@ struct lfsck_instance {
        /* The time for next checkpoint, jiffies */
        cfs_time_t                li_time_next_checkpoint;
 
+       lfsck_out_notify          li_out_notify;
+       void                     *li_out_notify_data;
        struct dt_device         *li_next;
        struct dt_device         *li_bottom;
        struct ldlm_namespace    *li_namespace;
@@ -424,6 +434,7 @@ struct lfsck_thread_info {
                /* old LMA for compatibility */
                char                    lti_lma_old[LMA_OLD_SIZE];
        };
+       struct dt_object_format lti_dof;
        /* lti_ent and lti_key must be conjoint,
         * then lti_ent::lde_name will be lti_key. */
        struct lu_dirent        lti_ent;
@@ -643,6 +654,12 @@ static inline void lfsck_component_put(const struct lu_env *env,
                        OBD_FREE(com->lc_file_ram, com->lc_file_size);
                if (com->lc_file_disk != NULL)
                        OBD_FREE(com->lc_file_disk, com->lc_file_size);
+               if (com->lc_data != NULL) {
+                       LASSERT(com->lc_ops->lfsck_data_release != NULL);
+
+                       com->lc_ops->lfsck_data_release(env, com);
+               }
+
                OBD_FREE_PTR(com);
        }
 }