[Ocfs2-tools-devel] [patch 09/11] Modify mkfs.ocfs2 to be fit for sparse files.

tao.ma at oracle.com tao.ma at oracle.com
Wed Aug 15 10:56:10 PDT 2007


This is a temporary solution, we may modify it soon.
===================================================================
--- test.ocfs2-tools.orig/mkfs.ocfs2/mkfs.c	2007-08-16 00:27:42.000000000 -0400
+++ test.ocfs2-tools/mkfs.ocfs2/mkfs.c	2007-08-16 00:36:28.000000000 -0400
@@ -1750,7 +1750,7 @@ format_superblock(State *s, SystemFileDi
 	di->id2.i_super.s_max_slots = s->initial_slots;
 	di->id2.i_super.s_first_cluster_group = s->first_cluster_group_blkno;
 
-	incompat = 0;
+	incompat = OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC;
 	if (s->hb_dev)
 		incompat |= OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV;
 
@@ -1899,7 +1899,7 @@ format_file(State *s, SystemFileDiskReco
 	if (rec->extent_len) {
 		di->id2.i_list.l_next_free_rec = 1;
 		di->id2.i_list.l_recs[0].e_cpos = 0;
-		di->id2.i_list.l_recs[0].e_clusters = clusters;
+		ocfs2_set_rec_clusters(0, &di->id2.i_list.l_recs[0], clusters);
 		di->id2.i_list.l_recs[0].e_blkno =
 			rec->extent_off >> s->blocksize_bits;
 	}

-- 



More information about the Ocfs2-tools-devel mailing list