[Ocfs2-tools-commits] smushran commits r792 - trunk/mkfs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Apr 8 13:32:32 CDT 2005


Author: smushran
Date: 2005-04-08 13:32:29 -0500 (Fri, 08 Apr 2005)
New Revision: 792

Modified:
   trunk/mkfs.ocfs2/mkfs.c
Log:
fixed bug 337
mkfs.ocfs2 -b 1024 -C 4k encountered: Could not write: No space left on device
Signed-Off: mfasheh

Modified: trunk/mkfs.ocfs2/mkfs.c
===================================================================
--- trunk/mkfs.ocfs2/mkfs.c	2005-04-08 08:43:11 UTC (rev 791)
+++ trunk/mkfs.ocfs2/mkfs.c	2005-04-08 18:32:29 UTC (rev 792)
@@ -702,6 +702,7 @@
 	errcode_t err;
 	uint32_t ret;
 	struct ocfs2_cluster_group_sizes cgs;
+	uint64_t tmp;
 
 	pagesize = getpagesize();
 
@@ -778,7 +779,8 @@
 	s->cluster_size_bits = get_bits(s, s->cluster_size);
 
 	s->volume_size_in_clusters = s->volume_size_in_bytes >> s->cluster_size_bits;
-	s->volume_size_in_blocks = (s->volume_size_in_clusters << s->cluster_size_bits) >> s->blocksize_bits;
+	tmp = (uint64_t)s->volume_size_in_clusters;
+	s->volume_size_in_blocks = (tmp << s->cluster_size_bits) >> s->blocksize_bits;
 	
 	s->reserved_tail_size = 0;
 
@@ -1109,7 +1111,9 @@
 	if (gd->bg_blkno == s->first_cluster_group_blkno)
 		*start = (uint64_t) start_bit;
 	else
-		*start = (uint64_t) start_bit + gd->bg_blkno;
+		*start = (uint64_t) start_bit +
+			((gd->bg_blkno << s->blocksize_bits) >> s->cluster_size_bits);
+
 	*start = *start << bitmap->unit_bits;
 	*num = ((uint64_t)num_bits) << bitmap->unit_bits;
 	gd->bg_free_bits_count -= num_bits;



More information about the Ocfs2-tools-commits mailing list