Skip to contentSkip to conversation

libext2fs: pick out UNINIT-EXTENT block

PATCH In review [email protected] 2 participants 2 messages Jan 30, 2011 – Jun 1, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 libext2fs: pick out UNINIT-EXTENT block

From: Robin Dong <[email protected]>

for display UNINIT-EXTENT block usage in dumpe2fs, modify ext2fs_block_iterate3 to distinguish between uninitial extent block and normal extent block

---
 lib/ext2fs/block.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/ext2fs/block.c +1 -1
index 0e4ec77..c7a60da 100644
@@ -458,7 +458,7 @@ errcode_t ext2fs_block_iterate3(ext2_filsys fs,
 			     blk++, blockcnt++, j++) {
 				new_blk = blk;
 				r = (*ctx.func)(fs, &new_blk, blockcnt,
-						0, 0, priv_data);
+						extent.e_flags, 0, priv_data);
 				ret |= r;
 				check_for_ro_violation_goto(&ctx, ret,
 							    extent_errout);
Signature · 1 line
1.7.3.5
#1 lore raw
Quoted 17 lines · Robin Dong

From: Robin Dong <[email protected]>

for display UNINIT-EXTENT block usage in dumpe2fs, modify ext2fs_block_iterate3 to distinguish between uninitial extent block and normal extent block

---
lib/ext2fs/block.c | 2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
lib/ext2fs/block.c +0 -0
index 0e4ec77..c7a60da 100644

lib/ext2fs/block.c errcode_t ext2fs_block_iterate3(ext2_filsys fs, · line 461

Quoted 5 lines
lib/ext2fs/block.c +1 -1
@@ -458,7 +458,7 @@ errcode_t ext2fs_block_iterate3(ext2_filsys fs,
 			     blk++, blockcnt++, j++) {
 				new_blk = blk;
 				r = (*ctx.func)(fs, &new_blk, blockcnt,
-						0, 0, priv_data);
+						extent.e_flags, 0, priv_data);

Apologies for not getting back to this earlier, but I don't want to overload the ref_blk field, since it will have a very different meaning for extent-mapped and files mapped using the traditional indirect block scheme. This could potentially confuse callers who don't know about extents.

Programs that want to find out about the uninitialized extent flag, should use the extent iterator functions.

As far as the other patches in this series, I'm concerned that dumpe2fs -s is going to confuse users more than anything else.

- Ted