Whamcloud - gitweb
iam: fix root node limit calculation for lfix format
authornikita <nikita>
Thu, 24 Aug 2006 18:29:31 +0000 (18:29 +0000)
committernikita <nikita>
Thu, 24 Aug 2006 18:29:31 +0000 (18:29 +0000)
lustre/kernel_patches/patches/ext3-iam-separate.patch

index 2f39979..1d05ccd 100644 (file)
@@ -1,7 +1,7 @@
 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 \
@@ -14,7 +14,7 @@ Index: iam/fs/ext3/Makefile
 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:
@@ -2689,8 +2689,8 @@ Index: iam/fs/ext3/iam_lfix.c
 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:
 + *
@@ -3400,6 +3400,23 @@ Index: iam/fs/ext3/iam_lvar.c
 +        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)
 +{
@@ -3423,7 +3440,7 @@ Index: iam/fs/ext3/iam_lvar.c
 +                 * 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;
@@ -5557,7 +5574,7 @@ Index: iam/fs/ext3/namei.c
 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: