[Tux3] Small fix about structure initialization
Ma Can
macan at ncic.ac.cn
Mon Oct 20 02:14:25 PDT 2008
Hi,
In my x86_64 box with gcc 4.0.0, I always got the assert error:
find empty inode in [3] base 7fffffb0d000
find_empty_inode: Failed assertion "goal >= leaf->ibase"!
I think the ileaf is not properly initialized, so ...
diff -pNu ileaf.c ileaf.c.old
--- ileaf.c 2008-10-18 20:06:04.000000000 +0800
+++ ileaf.c.old 2008-10-18 20:07:42.000000000 +0800
@@ -42,7 +42,7 @@ static inline struct ileaf *to_ileaf(vle
int ileaf_init(BTREE, vleaf *leaf)
{
printf("initialize inode leaf %p\n", leaf);
- ((struct ileaf *)leaf)->magic = 0x90de;
+ *(struct ileaf *)leaf = (struct ileaf){ 0x90de };
return 0;
}
--
Ma Can
National Research Center for Intelligent Computing Systems
Institute of Computing Technology, Chinese Academy of Sciences,
Beijing, P.R.China
_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://tux3.org/cgi-bin/mailman/listinfo/tux3
More information about the Tux3
mailing list