Whamcloud - gitweb
LU-14953 e2fsck: pfsck progress report
[tools/e2fsprogs.git] / e2fsck / e2fsck.h
index 1135d73..3749b68 100644 (file)
@@ -277,8 +277,8 @@ struct e2fsck_thread {
        dgrp_t          et_group_next;
        /* Scanned inode number */
        ext2_ino_t      et_inode_number;
-       char            et_log_buf[2048];
        int             et_log_length;
+       char            et_log_buf[2048];
 };
 #endif
 
@@ -368,11 +368,6 @@ struct e2fsck_struct {
        ext2_ino_t              stashed_ino;
        struct ext2_inode       *stashed_inode;
 
-       /* if @global_ctx is null, this field is unused */
-#ifdef HAVE_PTHREAD
-       struct e2fsck_thread     thread_info;
-#endif
-
        /*
         * Location of the lost and found directory
         */
@@ -490,11 +485,16 @@ struct e2fsck_struct {
        /* Fast commit replay state */
        struct e2fsck_fc_replay_state fc_replay_state;
 #ifdef HAVE_PTHREAD
-       __u32                    fs_num_threads;
+       /* if @global_ctx is null, this field is unused */
+       struct e2fsck_thread     thread_info;
+       __u32                    pfs_num_threads;
+       __u32                    mmp_update_thread;
+       int                      fs_need_locking;
        /* serialize fix operation for multiple threads */
-       pthread_mutex_t          fs_fix_mutex;
+       pthread_rwlock_t         fs_fix_rwlock;
        /* protect block_found_map, block_dup_map */
        pthread_rwlock_t         fs_block_map_rwlock;
+       struct e2fsck_thread_info       *infos;
 #endif
 };
 
@@ -554,6 +554,8 @@ extern int e2fsck_strnlen(const char * s, int count);
 
 extern void e2fsck_pass1(e2fsck_t ctx);
 extern void e2fsck_pass1_dupblocks(e2fsck_t ctx, char *block_buf);
+extern void e2fsck_pass1_check_lock(e2fsck_t ctx);
+extern void e2fsck_pass1_check_unlock(e2fsck_t ctx);
 extern void e2fsck_pass2(e2fsck_t ctx);
 extern void e2fsck_pass3(e2fsck_t ctx);
 extern void e2fsck_pass4(e2fsck_t ctx);
@@ -729,7 +731,7 @@ void check_resize_inode(e2fsck_t ctx);
 int check_init_orphan_file(e2fsck_t ctx);
 
 /* util.c */
-#define E2FSCK_MAX_THREADS     (65536)
+#define E2FSCK_MAX_THREADS     (65535)
 extern void *e2fsck_allocate_memory(e2fsck_t ctx, unsigned long size,
                                    const char *description);
 extern int ask(e2fsck_t ctx, const char * string, int def);