e2fsprogs: obsolete hurd and masix support
PATCH 1/1 e2fsprogs: obsolete hurd and masix support
Theodore,
Here is the patch to remove obsoleted code piece by piece.
This patch remove hurd and masix support, including union of inode and related source code.
I find there (likely) are some hurd related code in lib/ext2fs/ismounted.c. But I am not sure whether the "#ifndef __GNU__" is hurd specific only. What is your comment ?
This time, I use MIME/PGP in my signature, and tested by sending the patch to another account. Hope the format is ok this time :-)
Signed-off-by Coly Li <[email protected]>
debugfs/debugfs.c +4 -42
@@ -545,16 +545,9 @@ void internal_dump_inode(FILE *out, const char *prefix,fprintf (out,"%llu\n" , i_size); }else fprintf (out,"%d\n" , inode->i_size); -if (os ==EXT2_OS_HURD ) -fprintf (out, -"%sFile ACL: %d Directory ACL: %d Translator: %d\n" , - prefix, - inode->i_file_acl,LINUX_S_ISDIR (inode->i_mode) ? inode->i_dir_acl :0 , - inode->osd1.hurd1.h_i_translator); -else -fprintf (out,"%sFile ACL: %d Directory ACL: %d\n" , - prefix, - inode->i_file_acl,LINUX_S_ISDIR (inode->i_mode) ? inode->i_dir_acl :0 ); +fprintf (out,"%sFile ACL: %d Directory ACL: %d\n" , + prefix, + inode->i_file_acl,LINUX_S_ISDIR (inode->i_mode) ? inode->i_dir_acl :0 );if (os ==EXT2_OS_LINUX ) fprintf(out, "%sLinks: %d Blockcount: %llu\n", prefix, inode->i_links_count,
@@ -564,18 +557,7 @@ void internal_dump_inode(FILE *out, const char *prefix,else fprintf (out,"%sLinks: %d Blockcount: %u\n" , prefix, inode->i_links_count, inode->i_blocks); -switch (os) { -case EXT2_OS_HURD : - frag = inode->osd2.hurd2.h_i_frag; - fsize = inode->osd2.hurd2.h_i_fsize; -break ; -case EXT2_OS_MASIX : - frag = inode->osd2.masix2.m_i_frag; - fsize = inode->osd2.masix2.m_i_fsize; -break ; -default : - frag = fsize =0 ; - } + frag = fsize =0 ;fprintf (out,"%sFragment: Address: %d Number: %d Size: %d\n" , prefix, inode->i_faddr, frag, fsize); fprintf(out, "%sctime: 0x%08x -- %s", prefix, inode->i_ctime,
@@ -889,27 +871,7 @@ void do_modify_inode(int argc, char *argv[])else modify_u32 (argv[0 ],"High 32bits of size" , decimal_format, &inode.i_size_high); -if (os ==EXT2_OS_HURD ) -modify_u32 (argv[0 ],"Translator Block" , - decimal_format, &inode.osd1.hurd1.h_i_translator); -modify_u32 (argv[0 ],"Fragment address" , decimal_format, &inode.i_faddr); -switch (os) { -case EXT2_OS_HURD : - frag = &inode.osd2.hurd2.h_i_frag; - fsize = &inode.osd2.hurd2.h_i_fsize; -break ; -case EXT2_OS_MASIX : - frag = &inode.osd2.masix2.m_i_frag; - fsize = &inode.osd2.masix2.m_i_fsize; -break ; -default : - frag = fsize =0 ; - } -if (frag) -modify_u8 (argv[0 ],"Fragment number" , decimal_format, frag); -if (fsize) -modify_u8 (argv[0 ],"Fragment size" , decimal_format, fsize);for (i=0 ; i <EXT2_NDIR_BLOCKS ; i++) {sprintf (buf,"Direct Block #%d" , i);
debugfs/set_fields.c +0 -4
@@ -132,7 +132,6 @@ static struct field_set_info inode_fields[] = { { "blocks", &set_inode.i_blocks, 4, parse_uint }, { "flags", &set_inode.i_flags, 4, parse_uint }, { "version", &set_inode.osd1.linux1.l_i_version, 4, parse_uint }, - { "translator", &set_inode.osd1.hurd1.h_i_translator, 4, parse_uint }, { "block", &set_inode.i_block[0], 4, parse_uint, FLAG_ARRAY, EXT2_NDIR_BLOCKS }, { "block[IND]", &set_inode.i_block[EXT2_IND_BLOCK], 4, parse_uint },
@@ -143,11 +142,8 @@ static struct field_set_info inode_fields[] = { { "dir_acl", &set_inode.i_dir_acl, 4, parse_uint }, { "faddr", &set_inode.i_faddr, 4, parse_uint }, { "blocks_hi", &set_inode.osd2.linux2.l_i_blocks_hi, 2, parse_uint }, - { "frag", &set_inode.osd2.hurd2.h_i_frag, 1, parse_uint }, - { "fsize", &set_inode.osd2.hurd2.h_i_fsize, 1, parse_uint }, { "uid_high", &set_inode.osd2.linux2.l_i_uid_high, 2, parse_uint }, { "gid_high", &set_inode.osd2.linux2.l_i_gid_high, 2, parse_uint }, - { "author", &set_inode.osd2.hurd2.h_i_author, 4, parse_uint }, { "bmap", NULL, 4, parse_bmap, FLAG_ARRAY }, { 0, 0, 0, 0 } };
e2fsck/pass1.c +1 -14
@@ -475,7 +475,6 @@ void e2fsck_pass1(e2fsck_t ctx)#ifdef RESOURCE_TRACK struct resource_track rtrack;#endif -unsigned char frag, fsize;struct problem_context pctx;struct scan_callback_struct scan_struct;struct ext2_super_block *sb = ctx->fs->super;
@@ -829,20 +828,8 @@ void e2fsck_pass1(e2fsck_t ctx) }ext2fs_mark_inode_bitmap (ctx->inode_used_map, ino); -switch (fs->super->s_creator_os) { -case EXT2_OS_HURD : - frag = inode->osd2.hurd2.h_i_frag; - fsize = inode->osd2.hurd2.h_i_fsize; -break ; -case EXT2_OS_MASIX : - frag = inode->osd2.masix2.m_i_frag; - fsize = inode->osd2.masix2.m_i_fsize; -break ; -default : - frag = fsize =0 ; - } -if (inode->i_faddr || frag || fsize || +if (inode->i_faddr || (LINUX_S_ISDIR (inode->i_mode) && inode->i_dir_acl))mark_inode_bad (ctx, ino); if ((fs->super->s_creator_os == EXT2_OS_LINUX) &&
e2fsck/pass2.c +0 -31
@@ -1248,37 +1248,6 @@ extern int e2fsck_process_bad_inode(e2fsck_t ctx, ext2_ino_t dir, not_fixed++; } -switch (fs->super->s_creator_os) { -case EXT2_OS_HURD : - frag = &inode.osd2.hurd2.h_i_frag; - fsize = &inode.osd2.hurd2.h_i_fsize; -break ; -case EXT2_OS_MASIX : - frag = &inode.osd2.masix2.m_i_frag; - fsize = &inode.osd2.masix2.m_i_fsize; -break ; -default : - frag = fsize =0 ; - } -if (frag && *frag) { - pctx.num = *frag; -if (fix_problem (ctx,PR_2_FRAG_ZERO , &pctx)) { - *frag =0 ; - inode_modified++; - }else - not_fixed++; - pctx.num =0 ; - } -if (fsize && *fsize) { - pctx.num = *fsize; -if (fix_problem (ctx,PR_2_FSIZE_ZERO , &pctx)) { - *fsize =0 ; - inode_modified++; - }else - not_fixed++; - pctx.num =0 ; - } - if ((fs->super->s_creator_os == EXT2_OS_LINUX) && !(fs->super->s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_HUGE_FILE) &&
e2fsck/super.c +0 -16
@@ -670,22 +670,6 @@ void check_super_block(e2fsck_t ctx)#endif /* -* For the Hurd, check to see if the filetype option is set, -* since it doesn't support it. -*/ -if (!(ctx->options &E2F_OPT_READONLY ) && - fs->super->s_creator_os ==EXT2_OS_HURD && - (fs->super->s_feature_incompat & -EXT2_FEATURE_INCOMPAT_FILETYPE )) { -if (fix_problem (ctx,PR_0_HURD_CLEAR_FILETYPE , &pctx)) { - fs->super->s_feature_incompat &= - ~EXT2_FEATURE_INCOMPAT_FILETYPE ; -ext2fs_mark_super_dirty (fs); - - } - } - -/* * If we have any of the compatibility flags set, we need to have a * revision 1 filesystem. Most kernels will not check the flags on * a rev 0 filesystem and we may have corruption issues because of
ext2ed/super_com.c +0 -8
@@ -97,14 +97,6 @@ void type_ext2_super_block___show (char *command_line)wprintw (show_pad,"Linux :-)" );break ; -case EXT2_OS_HURD : -wprintw (show_pad,"Hurd" ); -break ; - -case EXT2_OS_MASIX : -wprintw (show_pad,"Masix" ); -break ; -default :wprintw (show_pad,"Unknown" );break ;
lib/ext2fs/block.c +0 -19
@@ -321,25 +321,6 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, ctx.tind_buf = ctx.dind_buf + fs->blocksize;/* -* Iterate over the HURD translator block (if present) -*/ -if ((fs->super->s_creator_os ==EXT2_OS_HURD ) && - !(flags &BLOCK_FLAG_DATA_ONLY )) { - ctx.errcode =ext2fs_read_inode (fs, ino, &inode); -if (ctx.errcode) - goto abort_exit; - got_inode =1 ; -if (inode.osd1.hurd1.h_i_translator) { - ret |= (*ctx.func)(fs, - &inode.osd1.hurd1.h_i_translator, -BLOCK_COUNT_TRANSLATOR , -0 ,0 , priv_data); -if (ret &BLOCK_ABORT ) - goto abort_exit; - } - } - -/* * Iterate over normal data blocks */ for (i =0 ; i <EXT2_NDIR_BLOCKS ; i++, ctx.bcount++) {
lib/ext2fs/ext2_fs.h +0 -59
98 lines not on this page · raw message
lib/ext2fs/swapfs.c +0 -25
@@ -184,31 +184,6 @@ void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, t->osd2.linux2.l_i_reserved2 =ext2fs_swab32 (f->osd2.linux2.l_i_reserved2);break ; -case EXT2_OS_HURD : - t->osd1.hurd1.h_i_translator = -ext2fs_swab32 (f->osd1.hurd1.h_i_translator); - t->osd2.hurd2.h_i_frag = f->osd2.hurd2.h_i_frag; - t->osd2.hurd2.h_i_fsize = f->osd2.hurd2.h_i_fsize; - t->osd2.hurd2.h_i_mode_high = -ext2fs_swab16 (f->osd2.hurd2.h_i_mode_high); - t->osd2.hurd2.h_i_uid_high = -ext2fs_swab16 (f->osd2.hurd2.h_i_uid_high); - t->osd2.hurd2.h_i_gid_high = -ext2fs_swab16 (f->osd2.hurd2.h_i_gid_high); - t->osd2.hurd2.h_i_author = -ext2fs_swab32 (f->osd2.hurd2.h_i_author); -break ; -case EXT2_OS_MASIX : - t->osd1.masix1.m_i_reserved1 = -ext2fs_swab32 (f->osd1.masix1.m_i_reserved1); - t->osd2.masix2.m_i_frag = f->osd2.masix2.m_i_frag; - t->osd2.masix2.m_i_fsize = f->osd2.masix2.m_i_fsize; - t->osd2.masix2.m_pad1 =ext2fs_swab16 (f->osd2.masix2.m_pad1); - t->osd2.masix2.m_i_reserved2[0 ] = -ext2fs_swab32 (f->osd2.masix2.m_i_reserved2[0 ]); - t->osd2.masix2.m_i_reserved2[1 ] = -ext2fs_swab32 (f->osd2.masix2.m_i_reserved2[1 ]); -break ; }if (bufsize < (int ) (sizeof (struct ext2_inode ) +sizeof (__u16)))
misc/mke2fs.c +0 -12
@@ -738,10 +738,6 @@ static int set_os(struct ext2_super_block *sb, char *os) sb->s_creator_os =atoi (os); else if (strcasecmp(os, "linux") == 0) sb->s_creator_os = EXT2_OS_LINUX; - else if (strcasecmp(os, "GNU") == 0 || strcasecmp(os, "hurd") == 0) - sb->s_creator_os =EXT2_OS_HURD ; - else if (strcasecmp(os, "masix") == 0) - sb->s_creator_os = EXT2_OS_MASIX; else if (strcasecmp(os, "freebsd") == 0) sb->s_creator_os = EXT2_OS_FREEBSD; else if (strcasecmp(os, "lites") == 0)
@@ -1591,14 +1587,6 @@ int main (int argc, char *argv[]) }/* -* For the Hurd, we will turn off filetype since it doesn't -* support it. -*/ -if (fs->super->s_creator_os ==EXT2_OS_HURD ) - fs->super->s_feature_incompat &= - ~EXT2_FEATURE_INCOMPAT_FILETYPE ; - -/* * Set the volume label... */ if (volume_label) {
tests/f_hurd/expect.1 deleted +0 -12
@@ -1,12 +0,0 @@ -The Hurd does not support the filetype feature. -Clear? yes - -Pass 1: Checking inodes, blocks, and sizes -Pass 2: Checking directory structure -Pass 3: Checking directory connectivity -Pass 4: Checking reference counts -Pass 5: Checking group summary information - -test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** -test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks -Exit status is 1
tests/f_hurd/expect.2 deleted +0 -7
@@ -1,7 +0,0 @@ -Pass 1: Checking inodes, blocks, and sizes -Pass 2: Checking directory structure -Pass 3: Checking directory connectivity -Pass 4: Checking reference counts -Pass 5: Checking group summary information -test_filesys: 11/16 files (0.0% non-contiguous), 20/100 blocks -Exit status is 0
tests/f_hurd/image.gz deleted binary +0 -0
tests/f_hurd/name deleted +0 -1
@@ -1 +0,0 @@ -GNU/Hurd specific tests
Signature · 2 lines
Coly Li SuSE PRC Labs