Whamcloud - gitweb
LU-4788 lfsck: replace cfs_list_t with list_head
[fs/lustre-release.git] / lustre / lfsck / lfsck_internal.h
index e00d856..430641c 100644 (file)
@@ -45,6 +45,7 @@
 #include <lustre_dlm.h>
 #include <lustre_fid.h>
 #include <md_object.h>
+#include <lustre_linkea.h>
 
 #define HALF_SEC                       (HZ >> 1)
 #define LFSCK_CHECKPOINT_INTERVAL      60
@@ -370,7 +371,7 @@ struct lfsck_tgt_descs {
        struct list_head                 ltd_orphan;
 
        /* number of registered TGTs */
-       int                              ltd_tgtnr;
+       __u32                            ltd_tgtnr;
 };
 
 #define LTD_TGT(ltd, index)    \
@@ -382,10 +383,10 @@ struct lfsck_tgt_descs {
 
 struct lfsck_component {
        /* into lfsck_instance::li_list_(scan,double_scan,idle} */
-       cfs_list_t               lc_link;
+       struct list_head         lc_link;
 
        /* into lfsck_instance::li_list_dir */
-       cfs_list_t               lc_link_dir;
+       struct list_head         lc_link_dir;
 
        struct rw_semaphore      lc_sem;
        atomic_t                 lc_ref;
@@ -422,21 +423,21 @@ struct lfsck_instance {
        spinlock_t                li_lock;
 
        /* Link into the lfsck_instance_list. */
-       cfs_list_t                li_link;
+       struct list_head          li_link;
 
        /* For the components in (first) scanning via otable-based iteration. */
-       cfs_list_t                li_list_scan;
+       struct list_head          li_list_scan;
 
        /* For the components in scanning via directory traversal. Because
         * directory traversal cannot guarantee all the object be scanned,
         * so the component in the li_list_dir must be in li_list_scan. */
-       cfs_list_t                li_list_dir;
+       struct list_head          li_list_dir;
 
        /* For the components in double scanning. */
-       cfs_list_t                li_list_double_scan;
+       struct list_head          li_list_double_scan;
 
        /* For the components those are not scanning now. */
-       cfs_list_t                li_list_idle;
+       struct list_head          li_list_idle;
 
        atomic_t                  li_ref;
        atomic_t                  li_double_scan_count;
@@ -557,10 +558,8 @@ struct lfsck_thread_info {
                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;
-       char                    lti_key[NAME_MAX + 16];
+       /* There will be '\0' at the end of the name. */
+       char            lti_key[sizeof(struct lu_dirent) + NAME_MAX + 1];
        char                    lti_tmpbuf[LFSCK_TMPBUF_LEN];
        struct lfsck_request    lti_lr;
        struct lfsck_async_interpret_args lti_laia;
@@ -575,6 +574,7 @@ struct lfsck_thread_info {
        struct dt_allocation_hint lti_hint;
        struct lu_orphan_rec    lti_rec;
        struct lov_user_md      lti_lum;
+       struct dt_insert_rec    lti_dt_rec;
 };
 
 /* lfsck_lib.c */
@@ -639,6 +639,9 @@ int lfsck_set_param(const struct lu_env *env, struct lfsck_instance *lfsck,
                    struct lfsck_start *start, bool reset);
 
 /* lfsck_namespace.c */
+int lfsck_verify_linkea(const struct lu_env *env, struct dt_device *dev,
+                       struct dt_object *obj, const struct lu_name *cname,
+                       const struct lu_fid *pfid);
 int lfsck_namespace_setup(const struct lu_env *env,
                          struct lfsck_instance *lfsck);
 
@@ -871,7 +874,7 @@ static inline void lfsck_instance_put(const struct lu_env *env,
                lfsck_instance_cleanup(env, lfsck);
 }
 
-static inline mdsno_t lfsck_dev_idx(struct dt_device *dev)
+static inline u32 lfsck_dev_idx(struct dt_device *dev)
 {
        return dev->dd_lu_dev.ld_site->ld_seq_site->ss_node_id;
 }