Index: iam/fs/ext3/Makefile
===================================================================
--- iam.orig/fs/ext3/Makefile 2006-05-31 20:24:32.000000000 +0400
-+++ iam/fs/ext3/Makefile 2006-08-16 20:48:12.000000000 +0400
++++ iam/fs/ext3/Makefile 2006-08-21 22:18:22.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-14 21:23:00.000000000 +0400
-@@ -0,0 +1,1324 @@
++++ iam/fs/ext3/iam.c 2006-08-21 21:47:11.000000000 +0400
+@@ -0,0 +1,1325 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * postcondition: it_state(it) == IAM_IT_ATTACHED &&
+ * ergo(result == 0, !memcmp(iam_it_rec_get(it), r, ...))
+ */
-+int iam_it_rec_set(handle_t *h, struct iam_iterator *it, struct iam_rec *r)
++int iam_it_rec_set(handle_t *h,
++ struct iam_iterator *it, const struct iam_rec *r)
+{
+ int result;
+ struct iam_path *path;
+
+/*
+ * Insert new record with key @k and contents from @r, shifting records to the
-+ * right.
++ * right. On success, iterator is positioned on the newly inserted record.
+ *
+ * precondition: it->ii_flags&IAM_IT_WRITE &&
+ * (it_state(it) == IAM_IT_ATTACHED ||
+
+/*
+ * Insert new record @r with key @k into container @c (within context of
-+ * transaction @h.
++ * transaction @h).
+ *
+ * Return values: 0: success, -ve: error, including -EEXIST when record with
+ * given key is already present.
+ * !memcmp(r, r2, c->ic_descr->id_rec_size));
+ */
+int iam_insert(handle_t *h, struct iam_container *c, const struct iam_key *k,
-+ struct iam_rec *r, struct iam_path_descr *pd)
++ const struct iam_rec *r, struct iam_path_descr *pd)
+{
+ struct iam_iterator it;
+ int result;
+ * the given key found.
+ */
+int iam_update(handle_t *h, struct iam_container *c, const struct iam_key *k,
-+ struct iam_rec *r, struct iam_path_descr *pd)
++ const struct iam_rec *r, struct iam_path_descr *pd)
+{
+ struct iam_iterator it;
+ int result;
Index: iam/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-08-14 21:29:47.000000000 +0400
-@@ -0,0 +1,664 @@
++++ iam/fs/ext3/iam_htree.c 2006-08-21 20:00:56.000000000 +0400
+@@ -0,0 +1,665 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ c->ic_descr = &iam_htree_compat_param;
+ else
+ result = -EBADF;
++ brelse(bh);
+ }
+ return result;
+}
Index: iam/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-08-14 21:24:50.000000000 +0400
-@@ -0,0 +1,669 @@
++++ iam/fs/ext3/iam_lfix.c 2006-08-21 20:06:38.000000000 +0400
+@@ -0,0 +1,670 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ descr->id_leaf_ops = &iam_lfix_leaf_ops;
+ } else
+ result = -EBADF;
++ brelse(bh);
+ }
+ return result;
+}
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-14 23:16:11.000000000 +0400
-@@ -0,0 +1,863 @@
++++ iam/fs/ext3/iam_lvar.c 2006-08-21 20:07:20.000000000 +0400
+@@ -0,0 +1,864 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ descr->id_leaf_ops = &lvar_leaf_ops;
+ } else
+ result = -EBADF;
++ brelse(bh);
+ }
+ return result;
+}
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-16 20:48:12.000000000 +0400
++++ iam/include/linux/lustre_iam.h 2006-08-21 22:18:22.000000000 +0400
@@ -1,9 +1,68 @@
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
Index: iam/fs/ext3/Makefile
===================================================================
---- iam.orig/fs/ext3/Makefile 2006-08-16 20:48:12.000000000 +0400
-+++ iam/fs/ext3/Makefile 2006-08-16 20:48:13.000000000 +0400
+--- iam.orig/fs/ext3/Makefile 2006-08-21 22:18:22.000000000 +0400
++++ iam/fs/ext3/Makefile 2006-08-21 22:18:23.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-16 20:48:12.000000000 +0400
-+++ iam/fs/ext3/dir.c 2006-08-16 20:48:13.000000000 +0400
+--- iam.orig/fs/ext3/dir.c 2006-08-21 22:18:22.000000000 +0400
++++ iam/fs/ext3/dir.c 2006-08-21 22:18:23.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-16 20:48:12.000000000 +0400
-+++ iam/fs/ext3/file.c 2006-08-16 20:48:13.000000000 +0400
+--- iam.orig/fs/ext3/file.c 2006-08-21 22:18:22.000000000 +0400
++++ iam/fs/ext3/file.c 2006-08-21 22:18:23.000000000 +0400
@@ -23,6 +23,7 @@
#include <linux/jbd.h>
#include <linux/ext3_fs.h>
#include "xattr.h"
#include "acl.h"
-@@ -37,8 +38,12 @@ static int ext3_release_file (struct ino
+@@ -31,14 +32,18 @@
+ * from ext3_file_open: open gets called at every open, but release
+ * gets called only when /all/ the files are closed.
+ */
+-static int ext3_release_file (struct inode * inode, struct file * filp)
++static int ext3_release_file(struct inode * inode, struct file * filp)
+ {
+ /* if we are the last writer on the inode, drop the block reservation */
if ((filp->f_mode & FMODE_WRITE) &&
(atomic_read(&inode->i_writecount) == 1))
ext3_discard_reservation(inode);
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-16 20:48:13.000000000 +0400
++++ iam/fs/ext3/iam-uapi.c 2006-08-21 22:18:23.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-16 20:48:12.000000000 +0400
-+++ iam/fs/ext3/ioctl.c 2006-08-16 20:48:13.000000000 +0400
+--- iam.orig/fs/ext3/ioctl.c 2006-08-21 22:18:22.000000000 +0400
++++ iam/fs/ext3/ioctl.c 2006-08-21 22:18:23.000000000 +0400
@@ -250,6 +250,6 @@ flags_err:
}
Index: iam/include/linux/lustre_iam.h
===================================================================
---- iam.orig/include/linux/lustre_iam.h 2006-08-16 20:48:12.000000000 +0400
-+++ iam/include/linux/lustre_iam.h 2006-08-16 20:48:13.000000000 +0400
+--- iam.orig/include/linux/lustre_iam.h 2006-08-21 22:18:22.000000000 +0400
++++ iam/include/linux/lustre_iam.h 2006-08-21 22:18:23.000000000 +0400
@@ -30,9 +30,6 @@
#ifndef __LINUX_LUSTRE_IAM_H__
#define __LINUX_LUSTRE_IAM_H__
* Key searched for.
*/
const struct iam_key *ip_key_target;
-+ const struct iam_ikey *ip_ikey_target;
++ const struct iam_ikey *ip_ikey_target;
/*
* Description-specific data.
*/
*/
struct iam_path ii_path;
};
-@@ -405,133 +486,25 @@ void iam_path_compat_fini(struct iam_pat
+@@ -405,133 +486,26 @@ void iam_path_compat_fini(struct iam_pat
struct iam_path_descr *iam_ipd_alloc(int keysize);
void iam_ipd_free(struct iam_path_descr *ipd);
- * postcondition: it_state(it) == IAM_IT_ATTACHED &&
- * ergo(result == 0, !memcmp(iam_it_rec_get(it), r, ...))
- */
- int iam_it_rec_set(handle_t *h, struct iam_iterator *it, struct iam_rec *r);
+-int iam_it_rec_set(handle_t *h, struct iam_iterator *it, struct iam_rec *r);
-
-/*
- * Place key under iterator in @k, return @k
- * it_keycmp(it, iam_it_key_get(it, *), k) == 0 &&
- * !memcmp(iam_it_rec_get(it), r, ...))
- */
++int iam_it_rec_set(handle_t *h,
++ struct iam_iterator *it, const struct iam_rec *r);
+struct iam_key *iam_it_key_get(const struct iam_iterator *it);
+int iam_it_key_size(const struct iam_iterator *it);
int iam_it_rec_insert(handle_t *h, struct iam_iterator *it,
int iam_it_load(struct iam_iterator *it, iam_pos_t pos);
int iam_lookup(struct iam_container *c, const struct iam_key *k,
-@@ -577,16 +550,65 @@ static inline struct inode *iam_path_obj
+@@ -539,10 +513,10 @@ int iam_lookup(struct iam_container *c,
+ int iam_delete(handle_t *h, struct iam_container *c, const struct iam_key *k,
+ struct iam_path_descr *pd);
+ int iam_update(handle_t *h, struct iam_container *c, const struct iam_key *k,
+- struct iam_rec *r, struct iam_path_descr *pd);
++ const struct iam_rec *r, struct iam_path_descr *pd);
+ int iam_insert(handle_t *handle, struct iam_container *c,
+ const struct iam_key *k,
+- struct iam_rec *r, struct iam_path_descr *pd);
++ const struct iam_rec *r, struct iam_path_descr *pd);
+ /*
+ * Initialize container @c.
+ */
+@@ -577,16 +551,65 @@ static inline struct inode *iam_path_obj
return p->ip_container->ic_object;
}
}
static inline void iam_reccpy(const struct iam_path *p, struct iam_rec *rec_dst,
-@@ -604,7 +626,7 @@ static inline void *iam_entry_off(struct
+@@ -604,7 +627,7 @@ static inline void *iam_entry_off(struct
static inline unsigned dx_get_block(struct iam_path *p, struct iam_entry *entry)
{
return le32_to_cpu(*(u32*)iam_entry_off(entry,
& 0x00ffffff;
}
-@@ -612,21 +634,64 @@ static inline void dx_set_block(struct i
+@@ -612,21 +635,64 @@ static inline void dx_set_block(struct i
struct iam_entry *entry, unsigned value)
{
*(u32*)iam_entry_off(entry,
static inline unsigned dx_get_count(struct iam_entry *entries)
{
return le16_to_cpu(((struct dx_countlimit *) entries)->count);
-@@ -647,9 +712,18 @@ static inline unsigned dx_node_limit(str
+@@ -647,9 +713,18 @@ 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 struct iam_entry *dx_get_entries(struct iam_path *path,
void *data, int root)
{
-@@ -665,7 +739,8 @@ static inline struct iam_entry *dx_node_
+@@ -665,7 +740,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 +749,7 @@ static inline struct iam_key *iam_path_k
+@@ -674,6 +750,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 +757,20 @@ int ext3_htree_next_block(struct inode *
+@@ -681,6 +758,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 +788,12 @@ int iam_node_read(struct iam_container *
+@@ -698,10 +789,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 +801,79 @@ struct iam_descr *iam_leaf_descr(const s
+@@ -709,14 +802,79 @@ struct iam_descr *iam_leaf_descr(const s
struct iam_leaf_operations *iam_leaf_ops(const struct iam_leaf *leaf);