Patchwork [09/35,v3] debugfs: make icheck cmd support inline data

login
register
mail settings
Submitter Zheng Liu
Date July 1, 2012, 1:48 p.m.
Message ID <1341150538-32047-10-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/168405/
State Superseded
Headers show

Comments

Zheng Liu - July 1, 2012, 1:48 p.m.
From: Zheng Liu <wenqing.lz@taobao.com>

When inode has inline_data, we don't need to check i_blocks.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 debugfs/icheck.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

Patch

diff --git a/debugfs/icheck.c b/debugfs/icheck.c
index 48f432a..3caa930 100644
--- a/debugfs/icheck.c
+++ b/debugfs/icheck.c
@@ -132,9 +132,12 @@  void do_icheck(int argc, char **argv)
 		if (inode.i_dtime)
 			goto next;
 
-		retval = ext2fs_block_iterate3(current_fs, ino,
-					       BLOCK_FLAG_READ_ONLY, block_buf,
-					       icheck_proc, &bw);
+		/* we don't need to check i_blocks with inline_data */
+		if (!ext2fs_has_inline_data(current_fs, ino))
+			retval = ext2fs_block_iterate3(current_fs, ino,
+						       BLOCK_FLAG_READ_ONLY,
+						       block_buf,
+						       icheck_proc, &bw);
 		if (retval) {
 			com_err("icheck", retval,
 				"while calling ext2fs_block_iterate");