[Ocfs2-tools-commits] smushran commits r882 - in trunk: libocfs2 tunefs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri May 6 17:05:33 CDT 2005


Author: smushran
Signed-off-by: jlbec
Date: 2005-05-06 17:05:31 -0500 (Fri, 06 May 2005)
New Revision: 882

Modified:
   trunk/libocfs2/mkjournal.c
   trunk/tunefs.ocfs2/tunefs.c
Log:
ocfs2_init_journal_superblock takes in size of journal in blocks
rather than bytes
Signed-off-by:jlbec

Modified: trunk/libocfs2/mkjournal.c
===================================================================
--- trunk/libocfs2/mkjournal.c	2005-05-06 20:34:06 UTC (rev 881)
+++ trunk/libocfs2/mkjournal.c	2005-05-06 22:05:31 UTC (rev 882)
@@ -45,20 +45,22 @@
  * Please keep them in sync.
  */
 errcode_t ocfs2_init_journal_superblock(ocfs2_filesys *fs, char *buf,
-					int buflen, uint32_t jrnl_size)
+					int buflen, uint32_t jrnl_size_in_blks)
 {
-	int bs_bits = OCFS2_RAW_SB(fs->fs_super)->s_blocksize_bits;
 	journal_superblock_t *jsb = (journal_superblock_t *)buf;
 
 	if (buflen < fs->fs_blocksize)
 		return OCFS2_ET_INTERNAL_FAILURE;
 
+	if (jrnl_size_in_blks < 1024)
+		return OCFS2_ET_JOURNAL_TOO_SMALL;
+
 	memset(buf, 0, buflen);
 	jsb->s_header.h_magic     = htonl(JFS_MAGIC_NUMBER);
 	jsb->s_header.h_blocktype = htonl(JFS_SUPERBLOCK_V2);
 
 	jsb->s_blocksize = cpu_to_be32(fs->fs_blocksize);
-	jsb->s_maxlen    = cpu_to_be32(jrnl_size >> bs_bits);
+	jsb->s_maxlen    = cpu_to_be32(jrnl_size_in_blks);
 
 	if (fs->fs_blocksize == 512)
 		jsb->s_first = htonl(2);
@@ -89,10 +91,6 @@
 
 	*ret_jsb = NULL;
 
-	retval = OCFS2_ET_JOURNAL_TOO_SMALL;
-	if (size < 1024)
-		goto bail;
-
 	if ((retval = ocfs2_malloc_block(fs->fs_io, &buf)))
 		goto bail;
 

Modified: trunk/tunefs.ocfs2/tunefs.c
===================================================================
--- trunk/tunefs.ocfs2/tunefs.c	2005-05-06 20:34:06 UTC (rev 881)
+++ trunk/tunefs.ocfs2/tunefs.c	2005-05-06 22:05:31 UTC (rev 882)
@@ -485,7 +485,6 @@
 static errcode_t initialize_journal(ocfs2_filesys *fs, uint64_t blkno)
 {
 	errcode_t ret = 0;
-	journal_superblock_t *sb;
 	char *buf = NULL;
 	ocfs2_cached_inode *ci = NULL;
 	int bs_bits = OCFS2_RAW_SB(fs->fs_super)->s_blocksize_bits;
@@ -515,7 +514,7 @@
 		goto bail;
 
 	ret = ocfs2_init_journal_superblock(fs, buf, BUFLEN,
-					    ci->ci_inode->i_size);
+					    (ci->ci_inode->i_size >> bs_bits));
 	if (ret)
 		goto bail;
 



More information about the Ocfs2-tools-commits mailing list