+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
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
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;
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.
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");
}
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)
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);
*/
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 "
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"
/*
* 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);
}
/*