From: Saranya Muruganandam <saranyamohan@xxxxxxxxxx> Adding information on fields in e2fsck_struct on how they are used when running parallel fsck. Signed-off-by: Saranya Muruganandam <saranyamohan@xxxxxxxxxx> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@xxxxxxxxx> --- e2fsck/e2fsck.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h index 33866316..1e82b048 100644 --- a/e2fsck/e2fsck.h +++ b/e2fsck/e2fsck.h @@ -285,7 +285,7 @@ struct e2fsck_thread { struct e2fsck_struct { /* Global context to get the cancel flag */ e2fsck_t global_ctx; - ext2_filsys fs; + ext2_filsys fs; /* [fs_fix_rwlock] */ const char *program_name; char *filesystem_name; char *device_name; @@ -294,7 +294,9 @@ struct e2fsck_struct { char *log_fn; FILE *problem_logf; char *problem_log_fn; - int flags; /* E2fsck internal flags */ + /* E2fsck internal flags. + * shared by different threads for pass1 [fs_fix_rwlock] */ + int flags; int options; unsigned blocksize; /* blocksize */ blk64_t use_superblock; /* sb requested by user */ @@ -314,6 +316,7 @@ struct e2fsck_struct { int (*progress)(e2fsck_t ctx, int pass, unsigned long cur, unsigned long max); + /* The following inode bitmaps are separately used in thread_ctx Pass1*/ ext2fs_inode_bitmap inode_used_map; /* Inodes which are in use */ ext2fs_inode_bitmap inode_bad_map; /* Inodes which are bad somehow */ ext2fs_inode_bitmap inode_dir_map; /* Inodes which are directories */ @@ -322,12 +325,14 @@ struct e2fsck_struct { ext2fs_inode_bitmap inode_reg_map; /* Inodes which are regular files*/ ext2fs_inode_bitmap inode_casefold_map; /* Inodes which are casefolded */ + /* Following 3 protected by [fs_block_map_rwlock] */ ext2fs_block_bitmap block_found_map; /* Blocks which are in use */ ext2fs_block_bitmap block_dup_map; /* Blks referenced more than once */ ext2fs_block_bitmap block_ea_map; /* Blocks which are used by EA's */ /* - * Inode count arrays + * Inode count arrays. + * Separately used in thread_ctx, pass1 */ ext2_icount_t inode_count; ext2_icount_t inode_link_info; @@ -349,7 +354,8 @@ struct e2fsck_struct { /* * Array of flags indicating whether an inode bitmap, block - * bitmap, or inode table is invalid + * bitmap, or inode table is invalid. + * Separately used in thread_ctx, pass1 */ int *invalid_inode_bitmap_flag; int *invalid_block_bitmap_flag; @@ -362,7 +368,8 @@ struct e2fsck_struct { char *block_buf; /* - * For pass1_check_directory and pass1_get_blocks + * For pass1_check_directory and pass1_get_blocks. + * Separately used in thread_ctx in pass1 */ ext2_ino_t stashed_ino; struct ext2_inode *stashed_inode; @@ -421,6 +428,7 @@ struct e2fsck_struct { /* * How we display the progress update (for unix) + * shared by different threads for pass1 [fs_fix_rwlock] */ int progress_fd; int progress_pos; @@ -429,7 +437,7 @@ struct e2fsck_struct { int interactive; /* Are we connected directly to a tty? */ char start_meta[2], stop_meta[2]; - /* File counts */ + /* File counts. Separately used in thread_ctx, pass1 */ __u32 fs_directory_count; __u32 fs_regular_count; __u32 fs_blockdev_count; -- 2.37.3