Index: iam/fs/ext3/Makefile
===================================================================
--- iam.orig/fs/ext3/Makefile 2006-05-31 20:24:32.000000000 +0400
-+++ iam/fs/ext3/Makefile 2006-08-24 01:37:35.000000000 +0400
++++ iam/fs/ext3/Makefile 2006-08-24 20:43:40.000000000 +0400
@@ -6,7 +6,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o
ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
Index: iam/fs/ext3/iam.c
===================================================================
--- iam.orig/fs/ext3/iam.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam.c 2006-08-21 21:47:11.000000000 +0400
++++ iam/fs/ext3/iam.c 2006-08-24 20:43:39.000000000 +0400
@@ -0,0 +1,1325 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
Index: iam/fs/ext3/iam_lvar.c
===================================================================
--- iam.orig/fs/ext3/iam_lvar.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam_lvar.c 2006-08-23 20:28:18.000000000 +0400
-@@ -0,0 +1,864 @@
++++ iam/fs/ext3/iam_lvar.c 2006-08-24 20:39:50.000000000 +0400
+@@ -0,0 +1,881 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ iam_ipd_free(ipd);
+}
+
++static int root_limit(int rootgap, int blocksize, int size)
++{
++ int limit;
++ int nlimit;
++
++ limit = (blocksize - rootgap) / size;
++ nlimit = blocksize / size;
++ if (limit == nlimit)
++ limit--;
++ return limit;
++}
++
++static int lvar_root_limit(int blocksize, int size)
++{
++ return root_limit(sizeof(struct iam_lfix_root), blocksize, size);
++}
++
+static void lvar_root(void *buf,
+ int blocksize, int keysize, int ptrsize, int recsize)
+{
+ * limit itself + one pointer to the leaf.
+ */
+ .count = cpu_to_le16(2),
-+ .limit = (blocksize - sizeof *root) / isize
++ .limit = lvar_root_limit(blocksize, keysize + ptrsize)
+ };
+
+ entry = root + 1;
Index: iam/include/linux/lustre_iam.h
===================================================================
--- iam.orig/include/linux/lustre_iam.h 2006-05-31 20:24:32.000000000 +0400
-+++ iam/include/linux/lustre_iam.h 2006-08-24 01:37:35.000000000 +0400
++++ iam/include/linux/lustre_iam.h 2006-08-24 20:43:40.000000000 +0400
@@ -1,9 +1,68 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8: