ChangeLog, message.c, pass1b.c, pass2.c, pass3.c, problem.c, problem.h:
pass1b.c: Change routines to use PR_1B_BLOCK_ITERATE when reporting
problems rather than using com_err directly.
problem.c, problem.h (PR_1B_BLOCK_ITERATE): Add new problem code.
message.c (expand_percent_expression): Add safety check. If ctx->str
is NULL, print "NULL" instead of dereferencing the null pointer.
pass1b.c, pass2.c, pass3.c: Change calls to ext2fs_block_iterate to
ext2fs_block_iterate2, to support 64-bit filesizes and to speed things
up slightly by avoiding the use of the ext2fs_block_iterate's
compatibility shim layer.
version.h:
Update for WIP release.
diff --git a/e2fsck/pass2.c b/e2fsck/pass2.c
index 6b95900..0aca7cc 100644
--- a/e2fsck/pass2.c
+++ b/e2fsck/pass2.c
@@ -63,7 +63,9 @@
char *buf, struct problem_context *pctx);
static int update_dir_block(ext2_filsys fs,
blk_t *block_nr,
- int blockcnt,
+ e2_blkcnt_t blockcnt,
+ blk_t ref_block,
+ int ref_offset,
void *priv_data);
struct check_dir_struct {
@@ -599,9 +601,11 @@
* functioned called by deallocate inode via ext2fs_iterate_block().
*/
static int deallocate_inode_block(ext2_filsys fs,
- blk_t *block_nr,
- int blockcnt,
- void *priv_data)
+ blk_t *block_nr,
+ e2_blkcnt_t blockcnt,
+ blk_t ref_block,
+ int ref_offset,
+ void *priv_data)
{
e2fsck_t ctx = (e2fsck_t) priv_data;
@@ -645,7 +649,7 @@
return;
ext2fs_mark_bb_dirty(fs);
- pctx.errcode = ext2fs_block_iterate(fs, ino, 0, block_buf,
+ pctx.errcode = ext2fs_block_iterate2(fs, ino, 0, block_buf,
deallocate_inode_block, ctx);
if (pctx.errcode) {
fix_problem(ctx, PR_2_DEALLOC_INODE, &pctx);
@@ -831,7 +835,7 @@
* Finally, update the block pointers for the inode
*/
db->blk = blk;
- pctx->errcode = ext2fs_block_iterate(fs, db->ino, BLOCK_FLAG_HOLE,
+ pctx->errcode = ext2fs_block_iterate2(fs, db->ino, BLOCK_FLAG_HOLE,
0, update_dir_block, db);
if (pctx->errcode) {
pctx->str = "ext2fs_block_iterate";
@@ -847,13 +851,15 @@
*/
static int update_dir_block(ext2_filsys fs,
blk_t *block_nr,
- int blockcnt,
+ e2_blkcnt_t blockcnt,
+ blk_t ref_block,
+ int ref_offset,
void *priv_data)
{
struct ext2_db_entry *db;
db = (struct ext2_db_entry *) priv_data;
- if (db->blockcnt == blockcnt) {
+ if (db->blockcnt == (int) blockcnt) {
*block_nr = db->blk;
return BLOCK_CHANGED;
}