Support very large files with debugfs (first pass).
If a file is created with "dd if=/dev/zero of=<file> bs=1k skip=2047M"
it is created properly by the kernel, but fails to be seen properly
by debugfs - the blocks are not shown by stat <inum>, nor can they
be found by icheck. This change fixes that.
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 6b14edd..1f69a75 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -322,11 +322,11 @@
}
struct list_blocks_struct {
- FILE *f;
- int total;
- blk_t first_block, last_block;
- int first_bcnt, last_bcnt;
- int first;
+ FILE *f;
+ e2_blkcnt_t total;
+ blk_t first_block, last_block;
+ e2_blkcnt_t first_bcnt, last_bcnt;
+ e2_blkcnt_t first;
};
static void finish_range(struct list_blocks_struct *lb)
@@ -345,8 +345,9 @@
lb->first_block = 0;
}
-static int list_blocks_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt,
- void *private)
+static int list_blocks_proc(ext2_filsys fs, blk_t *blocknr,
+ e2_blkcnt_t blockcnt, blk_t ref_block,
+ int ref_offset, void *private)
{
struct list_blocks_struct *lb = (struct list_blocks_struct *) private;
@@ -397,7 +398,7 @@
lb.first_block = 0;
lb.f = f;
lb.first = 1;
- ext2fs_block_iterate(current_fs, inode, 0, NULL,
+ ext2fs_block_iterate2(current_fs, inode, 0, NULL,
list_blocks_proc, (void *)&lb);
finish_range(&lb);
if (lb.total)