Index: iam/fs/ext3/Makefile
===================================================================
---- iam.orig/fs/ext3/Makefile 2006-08-23 20:28:37.000000000 +0400
-+++ iam/fs/ext3/Makefile 2006-08-23 20:28:38.000000000 +0400
+--- iam.orig/fs/ext3/Makefile 2006-08-24 01:37:35.000000000 +0400
++++ iam/fs/ext3/Makefile 2006-08-24 01:37:35.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 \
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
Index: iam/fs/ext3/dir.c
===================================================================
---- iam.orig/fs/ext3/dir.c 2006-08-23 20:28:37.000000000 +0400
-+++ iam/fs/ext3/dir.c 2006-08-23 20:28:38.000000000 +0400
+--- iam.orig/fs/ext3/dir.c 2006-08-24 01:37:35.000000000 +0400
++++ iam/fs/ext3/dir.c 2006-08-24 01:37:35.000000000 +0400
@@ -28,6 +28,7 @@
#include <linux/smp_lock.h>
#include <linux/slab.h>
(filp->f_version != inode->i_version)) {
Index: iam/fs/ext3/file.c
===================================================================
---- iam.orig/fs/ext3/file.c 2006-08-23 20:28:37.000000000 +0400
-+++ iam/fs/ext3/file.c 2006-08-23 20:28:38.000000000 +0400
+--- iam.orig/fs/ext3/file.c 2006-08-24 01:37:35.000000000 +0400
++++ iam/fs/ext3/file.c 2006-08-24 01:37:35.000000000 +0400
@@ -23,6 +23,7 @@
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
Index: iam/fs/ext3/iam-uapi.c
===================================================================
--- iam.orig/fs/ext3/iam-uapi.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam-uapi.c 2006-08-23 20:28:38.000000000 +0400
++++ iam/fs/ext3/iam-uapi.c 2006-08-24 01:37:35.000000000 +0400
@@ -0,0 +1,361 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+}
Index: iam/fs/ext3/ioctl.c
===================================================================
---- iam.orig/fs/ext3/ioctl.c 2006-08-23 20:28:37.000000000 +0400
-+++ iam/fs/ext3/ioctl.c 2006-08-23 20:28:38.000000000 +0400
+--- iam.orig/fs/ext3/ioctl.c 2006-08-24 01:37:35.000000000 +0400
++++ iam/fs/ext3/ioctl.c 2006-08-24 01:37:35.000000000 +0400
@@ -250,6 +250,6 @@ flags_err:
}
Index: iam/include/linux/lustre_iam.h
===================================================================
---- iam.orig/include/linux/lustre_iam.h 2006-08-23 20:28:37.000000000 +0400
-+++ iam/include/linux/lustre_iam.h 2006-08-23 20:28:38.000000000 +0400
+--- iam.orig/include/linux/lustre_iam.h 2006-08-24 01:37:35.000000000 +0400
++++ iam/include/linux/lustre_iam.h 2006-08-24 01:37:35.000000000 +0400
@@ -30,9 +30,6 @@
#ifndef __LINUX_LUSTRE_IAM_H__
#define __LINUX_LUSTRE_IAM_H__
static inline unsigned dx_get_count(struct iam_entry *entries)
{
return le16_to_cpu(((struct dx_countlimit *) entries)->count);
-@@ -647,9 +713,18 @@ static inline unsigned dx_node_limit(str
+@@ -647,9 +713,21 @@ static inline unsigned dx_node_limit(str
struct iam_descr *param = iam_path_descr(p);
unsigned entry_space = iam_path_obj(p)->i_sb->s_blocksize -
param->id_node_gap;
+static inline unsigned dx_root_limit(struct iam_path *p)
+{
+ struct iam_descr *param = iam_path_descr(p);
-+ unsigned entry_space = iam_path_obj(p)->i_sb->s_blocksize -
-+ param->id_root_gap;
-+ return entry_space / (param->id_ikey_size + param->id_ptr_size);
++ unsigned limit = iam_path_obj(p)->i_sb->s_blocksize -
++ param->id_root_gap;
++ limit /= (param->id_ikey_size + param->id_ptr_size);
++ if (limit == dx_node_limit(p))
++ limit--;
++ return limit;
}
+
static inline struct iam_entry *dx_get_entries(struct iam_path *path,
void *data, int root)
{
-@@ -665,7 +740,8 @@ static inline struct iam_entry *dx_node_
+@@ -665,7 +743,8 @@ static inline struct iam_entry *dx_node_
frame->bh->b_data, frame == path->ip_frames);
}
{
assert(0 <= nr && nr < ARRAY_SIZE(path->ip_data->ipd_key_scratch));
return path->ip_data->ipd_key_scratch[nr];
-@@ -674,6 +750,7 @@ static inline struct iam_key *iam_path_k
+@@ -674,6 +753,7 @@ static inline struct iam_key *iam_path_k
int dx_lookup(struct iam_path *path);
void dx_insert_block(struct iam_path *path, struct iam_frame *frame,
u32 hash, u32 block);
int ext3_htree_next_block(struct inode *dir, __u32 hash,
struct iam_path *path, __u32 *start_hash);
-@@ -681,6 +758,20 @@ int ext3_htree_next_block(struct inode *
+@@ -681,6 +761,20 @@ int ext3_htree_next_block(struct inode *
struct buffer_head *ext3_append(handle_t *handle, struct inode *inode,
u32 *block, int *err);
int split_index_node(handle_t *handle, struct iam_path *path);
/*
* external
-@@ -698,10 +789,12 @@ int iam_node_read(struct iam_container *
+@@ -698,10 +792,12 @@ int iam_node_read(struct iam_container *
handle_t *handle, struct buffer_head **bh);
void iam_insert_key(struct iam_path *path, struct iam_frame *frame,
struct iam_path *iam_leaf_path(const struct iam_leaf *leaf);
struct iam_container *iam_leaf_container(const struct iam_leaf *leaf);
-@@ -709,14 +802,79 @@ struct iam_descr *iam_leaf_descr(const s
+@@ -709,14 +805,79 @@ struct iam_descr *iam_leaf_descr(const s
struct iam_leaf_operations *iam_leaf_ops(const struct iam_leaf *leaf);