Whamcloud - gitweb
LU-4788 lfsck: replace cfs_list_t with list_head
[fs/lustre-release.git] / lustre / lfsck / lfsck_internal.h
index 46ebe84..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
@@ -303,8 +304,7 @@ struct lfsck_operations {
 
        int (*lfsck_dump)(const struct lu_env *env,
                          struct lfsck_component *com,
-                         char *buf,
-                         int len);
+                         struct seq_file *m);
 
        int (*lfsck_double_scan)(const struct lu_env *env,
                                 struct lfsck_component *com);
@@ -371,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)    \
@@ -383,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;
@@ -423,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;
@@ -558,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 +573,8 @@ 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 */
@@ -590,13 +590,14 @@ void lfsck_component_cleanup(const struct lu_env *env,
                             struct lfsck_component *com);
 void lfsck_instance_cleanup(const struct lu_env *env,
                            struct lfsck_instance *lfsck);
-int lfsck_bits_dump(char **buf, int *len, int bits, const char *names[],
+int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
                    const char *prefix);
-int lfsck_time_dump(char **buf, int *len, __u64 time, const char *prefix);
-int lfsck_pos_dump(char **buf, int *len, struct lfsck_position *pos,
+int lfsck_time_dump(struct seq_file *m, __u64 time, const char *prefix);
+int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
                   const char *prefix);
 void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
                    struct lfsck_position *pos, bool init);
+bool __lfsck_set_speed(struct lfsck_instance *lfsck, __u32 limit);
 void lfsck_control_speed(struct lfsck_instance *lfsck);
 void lfsck_control_speed_by_self(struct lfsck_component *com);
 int lfsck_reset(const struct lu_env *env, struct lfsck_instance *lfsck,
@@ -634,8 +635,13 @@ int lfsck_bookmark_store(const struct lu_env *env,
                         struct lfsck_instance *lfsck);
 int lfsck_bookmark_setup(const struct lu_env *env,
                         struct lfsck_instance *lfsck);
+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);
 
@@ -868,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;
 }