-Index: iam/fs/ext3/Makefile
+Index: linux-stage/fs/ext3/Makefile
===================================================================
---- iam.orig/fs/ext3/Makefile 2006-10-04 15:05:21.000000000 +0400
-+++ iam/fs/ext3/Makefile 2006-10-04 15:07:04.000000000 +0400
-@@ -6,7 +6,7 @@ obj-$(CONFIG_EXT3_FS) += ext3.o
+--- linux-stage.orig/fs/ext3/Makefile 2006-10-05 01:00:02.000000000 +0800
++++ linux-stage/fs/ext3/Makefile 2006-10-05 01:00:05.000000000 +0800
+@@ -6,7 +6,7 @@
ext3-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o iopen.o \
ioctl.o namei.o super.o symlink.o hash.o resize.o \
ext3-$(CONFIG_EXT3_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
ext3-$(CONFIG_EXT3_FS_POSIX_ACL) += acl.o
-Index: iam/fs/ext3/iam.c
+Index: linux-stage/fs/ext3/iam.c
===================================================================
---- iam.orig/fs/ext3/iam.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam.c 2006-10-04 15:05:22.000000000 +0400
+--- linux-stage.orig/fs/ext3/iam.c 2006-05-31 09:15:07.000000000 +0800
++++ linux-stage/fs/ext3/iam.c 2006-10-05 01:00:05.000000000 +0800
@@ -0,0 +1,1337 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+}
+EXPORT_SYMBOL(iam_delete);
+
-Index: iam/fs/ext3/iam_htree.c
+Index: linux-stage/fs/ext3/iam_htree.c
===================================================================
---- iam.orig/fs/ext3/iam_htree.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam_htree.c 2006-10-04 15:05:22.000000000 +0400
+--- linux-stage.orig/fs/ext3/iam_htree.c 2006-05-31 09:15:07.000000000 +0800
++++ linux-stage/fs/ext3/iam_htree.c 2006-10-05 01:00:05.000000000 +0800
@@ -0,0 +1,668 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+{
+ iam_format_register(&iam_htree_format);
+}
-Index: iam/fs/ext3/iam_lfix.c
+Index: linux-stage/fs/ext3/iam_lfix.c
===================================================================
---- iam.orig/fs/ext3/iam_lfix.c 2004-04-06 17:27:52.000000000 +0400
-+++ iam/fs/ext3/iam_lfix.c 2006-10-04 15:05:22.000000000 +0400
+--- linux-stage.orig/fs/ext3/iam_lfix.c 2006-05-31 09:15:07.000000000 +0800
++++ linux-stage/fs/ext3/iam_lfix.c 2006-10-05 01:00:05.000000000 +0800
@@ -0,0 +1,675 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ char rec[RECSIZE];
+ } ll_entry[LFIX_LEAF_RECNO];
+};
-Index: iam/fs/ext3/iam_lvar.c
+Index: linux-stage/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-10-04 15:05:22.000000000 +0400
-@@ -0,0 +1,902 @@
+--- linux-stage.orig/fs/ext3/iam_lvar.c 2006-05-31 09:15:07.000000000 +0800
++++ linux-stage/fs/ext3/iam_lvar.c 2006-10-05 01:03:59.000000000 +0800
+@@ -0,0 +1,907 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+
+ if (namelen == 0)
+ return 0;
-+ hinfo.hash_version = LDISKFS_SB(sb)->s_def_hash_version ;
++ if (strncmp(name, ".", 1) == 0 && namelen == 1)
++ return 1;
++ if (strncmp(name, "..", 2) == 0 && namelen == 2)
++ return 2;
++
++ hinfo.hash_version = EXT3_SB(sb)->s_def_hash_version ;
+ hinfo.seed = 0;
-+ result = ldiskfsfs_dirhash(name, namelen, &hinfo);
++ result = ext3fs_dirhash(name, namelen, &hinfo);
+ assert(result == 0);
+ return (hinfo.hash << 1) & 0x7fffffff;
+#else
+ iam_format_register(&lvar_format);
+}
+
-Index: iam/fs/ext3/namei.c
+Index: linux-stage/fs/ext3/namei.c
===================================================================
---- iam.orig/fs/ext3/namei.c 2006-10-04 15:05:22.000000000 +0400
-+++ iam/fs/ext3/namei.c 2006-10-04 15:06:20.000000000 +0400
+--- linux-stage.orig/fs/ext3/namei.c 2006-10-05 01:00:04.000000000 +0800
++++ linux-stage/fs/ext3/namei.c 2006-10-05 01:00:05.000000000 +0800
@@ -24,81 +24,6 @@
* Theodore Ts'o, 2002
*/
{
struct buffer_head *bh;
-@@ -136,14 +61,15 @@ static struct buffer_head *ext3_append(h
+@@ -136,14 +61,15 @@
if ((bh = ext3_bread(handle, inode, *block, 1, err))) {
inode->i_size += inode->i_sb->s_blocksize;
EXT3_I(inode)->i_disksize = inode->i_size;
#ifndef swap
#define swap(x, y) do { typeof(x) z = x; x = y; y = z; } while (0)
-@@ -155,293 +81,10 @@ static struct buffer_head *ext3_append(h
+@@ -155,293 +81,10 @@
#define dxtrace(command)
#endif
static unsigned dx_get_limit(struct iam_entry *entries);
static void dx_set_count(struct iam_entry *entries, unsigned value);
static void dx_set_limit(struct iam_entry *entries, unsigned value);
-@@ -457,264 +100,53 @@ static void dx_sort_map(struct dx_map_en
+@@ -457,264 +100,53 @@
static struct ext3_dir_entry_2 *dx_move_dirents (char *from, char *to,
struct dx_map_entry *offsets, int count);
static struct ext3_dir_entry_2* dx_pack_dirents (char *base, int size);
}
/*
-@@ -797,601 +229,119 @@ struct stats dx_show_entries(struct dx_h
+@@ -797,601 +229,119 @@
printk("%snames %u, fullness %u (%u%%)\n", levels?"":" ",
names, space/bcount,(space/bcount)*100/blocksize);
return (struct stats) { names, space, bcount};
/*
* This function increments the frame pointer to search the next leaf
* block, and reads in the necessary intervening nodes if the search
-@@ -1409,16 +359,15 @@ EXPORT_SYMBOL(iam_update);
+@@ -1409,16 +359,15 @@
* If start_hash is non-null, it will be filled in with the starting
* hash of the next page.
*/
p = path->ip_frame;
/*
* Find the next leaf page by incrementing the frame pointer.
-@@ -1438,39 +387,56 @@ static int ext3_htree_next_block(struct
+@@ -1438,39 +387,56 @@
--p;
}
/*
* p is at least 6 bytes before the end of page
-@@ -1662,21 +628,30 @@ static void dx_sort_map (struct dx_map_e
+@@ -1662,21 +628,30 @@
} while(more);
}
#endif
-@@ -1897,14 +872,15 @@ static struct buffer_head * ext3_dx_find
+@@ -1897,14 +872,15 @@
if (*err != 0)
return NULL;
} else {
if (*err != 0)
goto errout;
de = (struct ext3_dir_entry_2 *) bh->b_data;
-@@ -2093,22 +1069,69 @@ static struct ext3_dir_entry_2* dx_pack_
+@@ -2093,22 +1069,69 @@
return prev;
}
int err;
bh2 = ext3_append (handle, dir, &newblock, error);
-@@ -2133,35 +1156,9 @@ static struct ext3_dir_entry_2 *do_split
+@@ -2133,35 +1156,9 @@
if (err)
goto journal_error;
err = ext3_journal_dirty_metadata (handle, bh2);
if (err)
goto journal_error;
-@@ -2175,6 +1172,63 @@ errout:
+@@ -2175,6 +1172,63 @@
}
#endif
/*
* Add a new entry into a directory (leaf) block. If de is non-NULL,
-@@ -2194,34 +1248,16 @@ static int add_dirent_to_buf(handle_t *h
+@@ -2194,34 +1248,16 @@
struct inode *dir = dentry->d_parent->d_inode;
const char *name = dentry->d_name.name;
int namelen = dentry->d_name.len;
}
BUFFER_TRACE(bh, "get_write_access");
err = ext3_journal_get_write_access(handle, bh);
-@@ -2232,22 +1268,9 @@ static int add_dirent_to_buf(handle_t *h
+@@ -2232,22 +1268,9 @@
}
/* By now the buffer is marked for journaling */
/*
* XXX shouldn't update any times until successful
* completion of syscall, but too many callers depend
-@@ -2423,19 +1446,58 @@ static int ext3_add_entry (handle_t *han
+@@ -2423,19 +1446,58 @@
return add_dirent_to_buf(handle, dentry, inode, de, bh);
}
frame = path->ip_frame;
entries = frame->entries;
-@@ -2474,7 +1536,8 @@ static int split_index_node(handle_t *ha
+@@ -2474,7 +1536,8 @@
for (frame = safe + 1, i = 0; i < nr_splet; ++i, ++frame) {
bh_new[i] = ext3_append (handle, dir, &newblock[i], &err);
if (!bh_new[i] ||
goto cleanup;
BUFFER_TRACE(frame->bh, "get_write_access");
err = ext3_journal_get_write_access(handle, frame->bh);
-@@ -2493,6 +1556,7 @@ static int split_index_node(handle_t *ha
+@@ -2493,6 +1556,7 @@
unsigned count;
int idx;
struct buffer_head *bh2;
entries = frame->entries;
count = dx_get_count(entries);
-@@ -2501,6 +1565,7 @@ static int split_index_node(handle_t *ha
+@@ -2501,6 +1565,7 @@
bh2 = bh_new[i];
entries2 = dx_get_entries(path, bh2->b_data, 0);
if (frame == path->ip_frames) {
/* splitting root node. Tricky point:
*
-@@ -2512,22 +1577,20 @@ static int split_index_node(handle_t *ha
+@@ -2512,22 +1577,20 @@
* capacity of the root node is smaller than that of
* non-root one.
*/
/* Shift frames in the path */
memmove(frames + 2, frames + 1,
-@@ -2536,49 +1599,61 @@ static int split_index_node(handle_t *ha
+@@ -2536,49 +1599,61 @@
frames[1].at = iam_entry_shift(path, entries2, idx);
frames[1].entries = entries = entries2;
frames[1].bh = bh2;
}
goto cleanup;
journal_error:
-@@ -2610,7 +1685,7 @@ static int ext3_dx_add_entry(handle_t *h
+@@ -2610,7 +1685,7 @@
size_t isize;
iam_path_compat_init(&cpath, dir);
err = dx_probe(dentry, NULL, &hinfo, path);
if (err != 0)
-@@ -2620,8 +1695,9 @@ static int ext3_dx_add_entry(handle_t *h
+@@ -2620,8 +1695,9 @@
/* XXX nikita: global serialization! */
isize = dir->i_size;
if (err != 0)
goto cleanup;
-@@ -2641,11 +1717,11 @@ static int ext3_dx_add_entry(handle_t *h
+@@ -2641,11 +1717,11 @@
goto cleanup;
/*copy split inode too*/
err = add_dirent_to_buf(handle, dentry, inode, de, bh);
goto cleanup2;
-@@ -2758,12 +1834,12 @@ static struct inode * ext3_new_inode_wan
+@@ -2758,12 +1834,12 @@
* is so far negative - it has no inode.
*
* If the create succeeds, we fill in the inode information
struct inode * inode;
int err, retries = 0;
-Index: iam/include/linux/lustre_iam.h
+Index: linux-stage/include/linux/lustre_iam.h
===================================================================
---- iam.orig/include/linux/lustre_iam.h 2006-10-04 15:05:22.000000000 +0400
-+++ iam/include/linux/lustre_iam.h 2006-10-04 15:07:04.000000000 +0400
+--- linux-stage.orig/include/linux/lustre_iam.h 2006-10-05 01:00:04.000000000 +0800
++++ linux-stage/include/linux/lustre_iam.h 2006-10-05 01:00:05.000000000 +0800
@@ -1,9 +1,68 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
};
/*
-@@ -30,6 +89,11 @@ struct iam_key;
+@@ -30,6 +89,11 @@
/* Incomplete type use to refer to the records stored in iam containers. */
struct iam_rec;
typedef __u64 iam_ptr_t;
/*
-@@ -41,45 +105,25 @@ struct iam_frame {
+@@ -41,45 +105,25 @@
struct iam_entry *at; /* target entry, found by binary search */
};
/*
* Returns pointer (in the same sense as pointer in index entry) to
* the root node.
-@@ -102,8 +146,8 @@ struct iam_descr {
+@@ -102,8 +146,8 @@
/*
* Key comparison function. Returns -1, 0, +1.
*/
/*
* Create new container.
*
-@@ -111,25 +155,113 @@ struct iam_descr {
+@@ -111,25 +155,113 @@
* contains single record with the smallest possible key.
*/
int (*id_create)(struct iam_container *c);
};
struct iam_container {
-@@ -142,10 +274,17 @@ struct iam_container {
+@@ -142,10 +274,17 @@
* container flavor.
*/
struct iam_descr *ic_descr;
};
/*
-@@ -172,36 +311,240 @@ struct iam_path {
+@@ -172,36 +311,240 @@
/*
* Leaf node: a child of ->ip_frame.
*/
*/
int iam_container_init(struct iam_container *c,
struct iam_descr *descr, struct inode *inode);
-@@ -210,3 +553,170 @@ int iam_container_init(struct iam_contai
+@@ -210,3 +553,170 @@
*/
void iam_container_fini(struct iam_container *c);