[Ocfs2-tools-devel] [patch 05/11] modify some places which call ocfs2_extent_map_get_blockstake 2

tao.ma at oracle.com tao.ma at oracle.com
Wed Aug 22 17:07:37 PDT 2007


One parameter of ocf2_etent_map_get_blocks has been changed from int to uint64_t since it is a bug. So modify all the caller.
Index: test.ocfs2-tools/fsck.ocfs2/journal.c
Index: quilt.ocfs2-tools/fsck.ocfs2/journal.c
===================================================================
--- quilt.ocfs2-tools.orig/fsck.ocfs2/journal.c	2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/fsck.ocfs2/journal.c	2007-08-22 05:51:42.000000000 -0400
@@ -238,7 +238,7 @@ static errcode_t lookup_journal_block(oc
 				      int check_dup)
 {
 	errcode_t ret;
-	int contig;
+	uint64_t contig;
 	int was_set;
 
 	ret = ocfs2_extent_map_get_blocks(ji->ji_cinode, blkoff, 1, blkno,
@@ -482,12 +482,6 @@ static errcode_t prep_journal_info(ocfs2
 	      OCFS2_JOURNAL_DIRTY_FL))
 		goto out;
 
-	err = ocfs2_extent_map_init(fs, ji->ji_cinode);
-	if (err) {
-		com_err(whoami, err, "while initializing extent map");
-		goto out;
-	}
-
 	err = lookup_journal_block(fs, ji, 0, &ji->ji_jsb_block, 1);
 	if (err)
 		goto out;
@@ -529,7 +523,8 @@ errcode_t o2fsck_should_replay_journals(
 	uint64_t blkno;
 	errcode_t ret;
 	ocfs2_cached_inode *cinode = NULL;
-	int contig, is_dirty;
+	int is_dirty;
+	uint64_t contig;
 	journal_superblock_t *jsb;
 
 	*should = 0;
@@ -564,12 +559,6 @@ errcode_t o2fsck_should_replay_journals(
 			goto out;
 		}
 
-		ret = ocfs2_extent_map_init(fs, cinode);
-		if (ret) {
-			com_err(whoami, ret, "while initializing extent map");
-			goto out;
-		}
-
 		is_dirty = cinode->ci_inode->id1.journal1.ij_flags &
 			   OCFS2_JOURNAL_DIRTY_FL;
 		verbosef("slot %d JOURNAL_DIRTY_FL: %d\n", i, is_dirty);
@@ -740,7 +729,7 @@ static errcode_t check_journal_super(ocf
 				     ocfs2_cached_inode *ci)
 {
 	errcode_t ret;
-	int contig;
+	uint64_t contig;
 	uint64_t blkno;
 	char *buf = NULL;
 
@@ -748,10 +737,6 @@ static errcode_t check_journal_super(ocf
 	if (ret)
 		goto out;
 
-	ret = ocfs2_extent_map_init(fs, ci);
-	if (ret)
-		goto out;
-
 	ret = ocfs2_extent_map_get_blocks(ci, 0, 1, &blkno, &contig);
 	if (ret)
 		goto out;
Index: quilt.ocfs2-tools/fswreck/dir.c
===================================================================
--- quilt.ocfs2-tools.orig/fswreck/dir.c	2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/fswreck/dir.c	2007-08-22 05:51:42.000000000 -0400
@@ -134,7 +134,7 @@ static void damage_dir_content(ocfs2_fil
 	errcode_t ret;
 	char *buf = NULL;
 	uint64_t blkno, tmp_blkno;
-	int contig;
+	uint64_t contig;
 	ocfs2_cached_inode *cinode = NULL;
 	struct ocfs2_dir_entry *de = NULL, *newent = NULL;
 	char name[OCFS2_MAX_FILENAME_LEN];
@@ -145,10 +145,6 @@ static void damage_dir_content(ocfs2_fil
 	if (ret)
 		FSWRK_COM_FATAL(progname, ret);
 
-	ret = ocfs2_extent_map_init(fs, cinode);
-	if (ret)
-		FSWRK_COM_FATAL(progname, ret);
-
 	/* get first blockno */
 	ret = ocfs2_extent_map_get_blocks(cinode, 0, 1, &blkno, &contig);
 	if (ret)
@@ -336,7 +332,7 @@ void mess_up_dir_ent(ocfs2_filesys *fs, 
 void mess_up_dir_parent_dup(ocfs2_filesys *fs, uint64_t blkno)
 {
 	errcode_t ret;
-	int contig;
+	uint64_t contig;
 	uint64_t parent1, parent2, tmp_blkno,extblk;
 	char *buf = NULL;
 	struct ocfs2_dir_entry *de = NULL, *newent = NULL;
@@ -360,10 +356,6 @@ void mess_up_dir_parent_dup(ocfs2_filesy
 	if (ret)
 		FSWRK_COM_FATAL(progname, ret);
 
-	ret = ocfs2_extent_map_init(fs, cinode);
-	if (ret)
-		FSWRK_COM_FATAL(progname, ret);
-
 	ret = ocfs2_extent_map_get_blocks(cinode, 0, 1, &extblk, &contig);
 	if (ret)
 		FSWRK_COM_FATAL(progname, ret);
Index: quilt.ocfs2-tools/libocfs2/dir_scan.c
===================================================================
--- quilt.ocfs2-tools.orig/libocfs2/dir_scan.c	2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/libocfs2/dir_scan.c	2007-08-22 05:51:42.000000000 -0400
@@ -50,7 +50,7 @@ static errcode_t get_more_dir_blocks(ocf
 {
 	errcode_t ret;
 	uint64_t blkno;
-	int cblocks;
+	uint64_t cblocks;
 
 	if (scan->blocks_read == scan->total_blocks)
 		return OCFS2_ET_ITERATION_COMPLETE;
@@ -146,10 +146,6 @@ errcode_t ocfs2_open_dir_scan(ocfs2_file
 	if (ret)
 		goto bail_dir_block;
 
-	ret = ocfs2_extent_map_init(fs, scan->inode);
-	if (ret)
-		goto bail_inode;
-
 	scan->total_blocks = scan->inode->ci_inode->i_size /
 		fs->fs_blocksize;
 	/*
@@ -163,9 +159,6 @@ errcode_t ocfs2_open_dir_scan(ocfs2_file
 
 	return 0;
 
-bail_inode:
-	ocfs2_free_cached_inode(scan->fs, scan->inode);
-
 bail_dir_block:
 	ocfs2_free(&scan->buf);
 
Index: quilt.ocfs2-tools/libocfs2/expanddir.c
===================================================================
--- quilt.ocfs2-tools.orig/libocfs2/expanddir.c	2007-08-21 06:38:06.000000000 -0400
+++ quilt.ocfs2-tools/libocfs2/expanddir.c	2007-08-22 05:51:42.000000000 -0400
@@ -50,7 +50,7 @@ errcode_t ocfs2_expand_dir(ocfs2_filesys
 	uint64_t used_blks;
 	uint64_t totl_blks;
 	uint64_t new_blk;
-	int contig;
+	uint64_t contig;
 	char *buf = NULL;
 
 	if (!(fs->fs_flags & OCFS2_FLAG_RW))
@@ -86,10 +86,6 @@ errcode_t ocfs2_expand_dir(ocfs2_filesys
 			goto bail;
 	}
 
-	ret = ocfs2_extent_map_init(fs, cinode);
-	if (ret)
-		goto bail;
-
 	/* get the next free block */
 	ret = ocfs2_extent_map_get_blocks(cinode, used_blks, 1,
 					  &new_blk, &contig);

-- 



More information about the Ocfs2-tools-devel mailing list