Patchwork [18/36,v4] debugfs: make rmdir cmd support inline data

login
register
mail settings
Submitter Zheng Liu
Date July 31, 2012, 11:48 a.m.
Message ID <1343735309-30579-19-git-send-email-wenqing.lz@taobao.com>
Download mbox | patch
Permalink /patch/174234/
State Superseded
Headers show

Comments

Zheng Liu - July 31, 2012, 11:48 a.m.
From: Zheng Liu <wenqing.lz@taobao.com>

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

Patch

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index db3d3b9..87fc6a9 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -1958,8 +1958,12 @@  void do_rmdir(int argc, char *argv[])
 	rds.parent = 0;
 	rds.empty = 1;
 
-	retval = ext2fs_dir_iterate2(current_fs, inode_num, 0,
-				    0, rmdir_proc, &rds);
+	if (ext2fs_has_inline_data(current_fs, inode_num))
+		retval = ext2fs_inline_data_iterate2(current_fs, inode_num, 0,
+						     0, rmdir_proc, &rds);
+	else
+		retval = ext2fs_dir_iterate2(current_fs, inode_num, 0,
+					    0, rmdir_proc, &rds);
 	if (retval) {
 		com_err(argv[0], retval, "while iterating over directory");
 		return;