Commit cbbf031b authored by Theodore Ts'o's avatar Theodore Ts'o
Browse files

ChangeLog, dumpe2fs.c, mke2fs.c:

  dumpe2fs.c: Use WORDS_BIGENDIAN to determine whether or not we're
  	(not) using i386 byte order.
  dumpe2fs.c, mke2fs.c: Stop using the compatibility badblocks function,
  	and use the ext2fs_badblocks_* functions instead.
ChangeLog, inode.c, tst_iscan.c:
  inode.c, tst_iscan.c: Stop using the compatibility badblocks function,
  	and use the ext2fs_badblocks_* functions instead.
ChangeLog, badblocks.c:
  badblocks.c: Stop using the compatibility badblocks function, and use
  	the ext2fs_badblocks_* functions instead.
parent 28cf9041
2001-06-12 Theodore Tso <tytso@valinux.com>
* badblocks.c: Stop using the compatibility badblocks function,
and use the ext2fs_badblocks_* functions instead.
2001-06-11 Theodore Tso <tytso@valinux.com>
* unix.c (PRS): Fix bug introduced in 1.20 which broke the -F
......
......@@ -103,7 +103,7 @@ void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
goto fatal;
}
badblocks_list_free(bb_list);
ext2fs_badblocks_list_free(bb_list);
return;
fatal:
......
2001-06-12 Theodore Tso <tytso@valinux.com>
* inode.c, tst_iscan.c: Stop using the compatibility badblocks
function, and use the ext2fs_badblocks_* functions
instead.
2001-06-11 Theodore Tso <tytso@valinux.com>
* Makefile.in, gen_bitmap.c, bitops.h: Move inline functions
......
......@@ -121,7 +121,7 @@ errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks,
fs->get_blocks = 0;
retval = ext2fs_read_bb_inode(fs, &fs->badblocks);
if (retval && fs->badblocks) {
badblocks_list_free(fs->badblocks);
ext2fs_badblocks_list_free(fs->badblocks);
fs->badblocks = 0;
}
fs->get_blocks = save_get_blocks;
......
......@@ -111,13 +111,13 @@ static void setup(void)
exit(1);
}
retval = badblocks_list_create(&test_badblocks, 5);
retval = ext2fs_badblocks_list_create(&test_badblocks, 5);
if (retval) {
com_err("setup", retval, "while creating badblocks list");
exit(1);
}
for (i=0; test_vec[i]; i++) {
retval = badblocks_list_add(test_badblocks, test_vec[i]);
retval = ext2fs_badblocks_list_add(test_badblocks, test_vec[i]);
if (retval) {
com_err("setup", retval,
"while adding test vector %d", i);
......
2001-06-12 Theodore Tso <tytso@valinux.com>
* dumpe2fs.c: Use WORDS_BIGENDIAN to determine whether or not
we're (not) using i386 byte order.
* dumpe2fs.c, mke2fs.c: Stop using the compatibility badblocks
function, and use the ext2fs_badblocks_* functions
instead.
* fsck.c (device_already_active): Fixed bug which can cause fsck
to core dump if there are a mix of devices with standard
and non-standard names.
......
......@@ -163,17 +163,17 @@ static void list_bad_blocks(ext2_filsys fs)
com_err("ext2fs_read_bb_inode", retval, "");
exit(1);
}
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
com_err("ext2fs_badblocks_list_iterate_begin", retval,
_("while printing bad block list"));
exit(1);
}
if (badblocks_list_iterate(bb_iter, &blk))
if (ext2fs_badblocks_list_iterate(bb_iter, &blk))
printf(_("Bad blocks: %d"), blk);
while (badblocks_list_iterate(bb_iter, &blk))
while (ext2fs_badblocks_list_iterate(bb_iter, &blk))
printf(", %d", blk);
badblocks_list_iterate_end(bb_iter);
ext2fs_badblocks_list_iterate_end(bb_iter);
printf("\n");
}
......@@ -189,23 +189,15 @@ static void dump_bad_blocks(ext2_filsys fs)
com_err("ext2fs_read_bb_inode", retval, "");
exit(1);
}
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
com_err("ext2fs_badblocks_list_iterate_begin", retval,
_("while printing bad block list"));
exit(1);
}
while (badblocks_list_iterate(bb_iter, &blk))
while (ext2fs_badblocks_list_iterate(bb_iter, &blk))
printf("%d\n", blk);
badblocks_list_iterate_end(bb_iter);
}
static int i386_byteorder(void)
{
int one = 1;
char *cp = (char *) &one;
return (*cp == 1);
ext2fs_badblocks_list_iterate_end(bb_iter);
}
static void print_journal_information(ext2_filsys fs)
......@@ -331,8 +323,9 @@ int main (int argc, char ** argv)
dump_bad_blocks(fs);
} else {
big_endian = ((fs->flags & EXT2_FLAG_SWAP_BYTES) != 0);
if (!i386_byteorder())
big_endian = !big_endian;
#ifdef WORDS_BIGENDIAN
big_endian = !big_endian;
#endif
if (big_endian)
printf(_("Note: This is a byte-swapped filesystem\n"));
list_super (fs->super);
......
......@@ -255,7 +255,7 @@ static void handle_bad_blocks(ext2_filsys fs, badblocks_list bb_list)
*/
must_be_good = fs->super->s_first_data_block + 1 + fs->desc_blocks;
for (i = fs->super->s_first_data_block; i <= must_be_good; i++) {
if (badblocks_list_test(bb_list, i)) {
if (ext2fs_badblocks_list_test(bb_list, i)) {
fprintf(stderr, _("Block %d in primary "
"superblock/group descriptor area bad.\n"), i);
fprintf(stderr, _("Blocks %d through %d must be good "
......@@ -277,8 +277,8 @@ static void handle_bad_blocks(ext2_filsys fs, badblocks_list bb_list)
for (i = 1; i < fs->group_desc_count; i++) {
group_bad = 0;
for (j=0; j < fs->desc_blocks+1; j++) {
if (badblocks_list_test(bb_list, group_block +
j)) {
if (ext2fs_badblocks_list_test(bb_list,
group_block + j)) {
if (!group_bad)
fprintf(stderr,
_("Warning: the backup superblock/group descriptors at block %d contain\n"
......@@ -296,15 +296,15 @@ _("Warning: the backup superblock/group descriptors at block %d contain\n"
/*
* Mark all the bad blocks as used...
*/
retval = badblocks_list_iterate_begin(bb_list, &bb_iter);
retval = ext2fs_badblocks_list_iterate_begin(bb_list, &bb_iter);
if (retval) {
com_err("badblocks_list_iterate_begin", retval,
com_err("ext2fs_badblocks_list_iterate_begin", retval,
_("while marking bad blocks as used"));
exit(1);
}
while (badblocks_list_iterate(bb_iter, &blk))
while (ext2fs_badblocks_list_iterate(bb_iter, &blk))
ext2fs_mark_block_bitmap(fs->block_map, blk);
badblocks_list_iterate_end(bb_iter);
ext2fs_badblocks_list_iterate_end(bb_iter);
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment