[Ocfs2-tools-devel] [PATCH 1/1] Ocfs2-tests: Correct compiling errors for test_truncate.c and remove_slot.c

Tristan Ye tristan.ye at oracle.com
Wed Oct 8 23:42:31 PDT 2008


Under the suggestion of taoma,simply return the ret if hit error in ocfs2_link().

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 programs/truncate/ocfs2-tools/test_truncate.c  |   12 +-----------
 programs/tunefs-test/remove-slot/remove_slot.c |   11 +----------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git a/programs/truncate/ocfs2-tools/test_truncate.c b/programs/truncate/ocfs2-tools/test_truncate.c
index 5593b5e..e4042f4 100644
--- a/programs/truncate/ocfs2-tools/test_truncate.c
+++ b/programs/truncate/ocfs2-tools/test_truncate.c
@@ -145,17 +145,7 @@ static errcode_t open_test_inode(ocfs2_filesys *fs, char *name, uint64_t *ino)
 
 	ret = ocfs2_link(fs, fs->fs_root_blkno, name,
 			 tmp_blkno, OCFS2_FT_REG_FILE);
-	if (ret == OCFS2_ET_DIR_NO_SPACE) {
-		ret = ocfs2_expand_dir(fs, fs->fs_root_blkno,
-				       fs->fs_root_blkno);
-		if (ret)
-			return ret;
-
-		ret = ocfs2_link(fs, fs->fs_root_blkno, name,
-				 tmp_blkno, OCFS2_FT_REG_FILE);
-		if (ret)
-			return ret;
-	} else if (ret)
+	if (ret)
 		return ret;
 
 	*ino = tmp_blkno;
diff --git a/programs/tunefs-test/remove-slot/remove_slot.c b/programs/tunefs-test/remove-slot/remove_slot.c
index 34847be..357027d 100644
--- a/programs/tunefs-test/remove-slot/remove_slot.c
+++ b/programs/tunefs-test/remove-slot/remove_slot.c
@@ -276,16 +276,7 @@ static errcode_t create_orphan_file(ocfs2_filesys *fs, uint16_t slot)
 
 	ret = ocfs2_link(fs, dir, name,
 			 tmp_blkno, OCFS2_FT_REG_FILE);
-	if (ret == OCFS2_ET_DIR_NO_SPACE) {
-		ret = ocfs2_expand_dir(fs, dir, fs->fs_root_blkno);
-		if (ret)
-			return ret;
-
-		ret = ocfs2_link(fs, dir, name,
-				 tmp_blkno, OCFS2_FT_REG_FILE);
-		if (ret)
-			return ret;
-	} else if (ret)
+	if (ret)
 		return ret;
 
 	return 0;
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list