[Ocfs2-tools-devel] [PATCH 09/11] Ocfs2-tools: Adjust corrupt handlers for fswreck's symlink.c and special.c

Tristan Ye tristan.ye at oracle.com
Mon Jun 8 03:50:23 PDT 2009


Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 fswreck/include/special.h |    2 +-
 fswreck/include/symlink.h |    2 +-
 fswreck/special.c         |    2 +-
 fswreck/symlink.c         |   11 +++--------
 4 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fswreck/include/special.h b/fswreck/include/special.h
index 8f3345e..6d74a1c 100644
--- a/fswreck/include/special.h
+++ b/fswreck/include/special.h
@@ -25,6 +25,6 @@
 #ifndef __SPECIAL_H
 #define __SPECIAL_H
 
-void mess_up_root(ocfs2_filesys *fs, uint64_t blkno);
+void mess_up_root(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno);
 
 #endif		/* __SPECIAL_H */
diff --git a/fswreck/include/symlink.h b/fswreck/include/symlink.h
index d002aa3..4bd0c4b 100644
--- a/fswreck/include/symlink.h
+++ b/fswreck/include/symlink.h
@@ -25,6 +25,6 @@
 #ifndef __SYMLINK_H
 #define __SYMLINK_H
 
-void mess_up_symlink(ocfs2_filesys *fs, uint64_t blkno);
+void mess_up_symlink(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno);
 
 #endif		/* __SYMLINK_H */
diff --git a/fswreck/special.c b/fswreck/special.c
index 58e059b..b2283d6 100644
--- a/fswreck/special.c
+++ b/fswreck/special.c
@@ -32,7 +32,7 @@ extern char *progname;
  * Special files error: ROOT_NOTDIR, ROOT_DIR_MISSING, LOSTFOUND_MISSING
  * 
  */
-void mess_up_root(ocfs2_filesys *fs, uint64_t blkno)
+void mess_up_root(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno)
 {
 	errcode_t ret;
 	char *inobuf = NULL;
diff --git a/fswreck/symlink.c b/fswreck/symlink.c
index ed8d975..531b4ab 100644
--- a/fswreck/symlink.c
+++ b/fswreck/symlink.c
@@ -228,18 +228,13 @@ static void corrupt_symlink_file(ocfs2_filesys *fs, uint64_t blkno,
 	return;
 }
 
-void mess_up_symlink(ocfs2_filesys *fs, uint64_t blkno)
+void mess_up_symlink(ocfs2_filesys *fs, enum fsck_type type, uint64_t blkno)
 {
 	uint64_t tmp_blkno;
-	int i;
-	enum fsck_type types[] = { 	LINK_FAST_DATA, LINK_NULLTERM,
-					LINK_SIZE, LINK_BLOCKS };
 
-	for (i = 0; i < ARRAY_ELEMENTS(types); i++) {
-		create_symlink(fs, blkno, &tmp_blkno);
+	create_symlink(fs, blkno, &tmp_blkno);
 
-		corrupt_symlink_file(fs, tmp_blkno, types[i]);
-	}
+	corrupt_symlink_file(fs, tmp_blkno, type);
 
 	return ;
 }
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list