[Ocfs2-tools-commits] zab commits r1022 - branches/endian-safe/mkfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Aug 4 18:09:19 CDT 2005


Author: zab
Date: 2005-08-04 18:09:18 -0500 (Thu, 04 Aug 2005)
New Revision: 1022

Modified:
   branches/endian-safe/mkfs.ocfs2/mkfs.c
Log:
o don't try to write to swapped gd blkno
  (.. 30 paces?)


Modified: branches/endian-safe/mkfs.ocfs2/mkfs.c
===================================================================
--- branches/endian-safe/mkfs.ocfs2/mkfs.c	2005-08-04 23:01:47 UTC (rev 1021)
+++ branches/endian-safe/mkfs.ocfs2/mkfs.c	2005-08-04 23:09:18 UTC (rev 1022)
@@ -1758,7 +1758,7 @@
 write_bitmap_data(State *s, AllocBitmap *bitmap)
 {
 	int i;
-	uint64_t parent_blkno;
+	uint64_t parent_blkno, blkno;
 	ocfs2_group_desc *gd;
 	char *buf = NULL;
 
@@ -1776,9 +1776,9 @@
 		 * blkno until now. */
 		gd->bg_parent_dinode = parent_blkno;
 		memcpy(buf, gd, s->blocksize);
+		blkno = gd->bg_blkno;
 		ocfs2_swap_group_desc(gd);
-		do_pwrite(s, buf, s->cluster_size,
-			  gd->bg_blkno << s->blocksize_bits);
+		do_pwrite(s, buf, s->cluster_size, blkno << s->blocksize_bits);
 	}
 	free(buf);
 }
@@ -1786,9 +1786,9 @@
 static void
 write_group_data(State *s, AllocGroup *group)
 {
+	uint64_t blkno = group->gd->bg_blkno;
 	ocfs2_swap_group_desc(group->gd);
-	do_pwrite(s, group->gd, s->blocksize,
-		  group->gd->bg_blkno << s->blocksize_bits);
+	do_pwrite(s, group->gd, s->blocksize, blkno << s->blocksize_bits);
 	ocfs2_swap_group_desc(group->gd);
 }
 



More information about the Ocfs2-tools-commits mailing list