From 48fc414ea5ae44078841c8f476a99f6fcc271529 Mon Sep 17 00:00:00 2001 From: nikita Date: Sat, 9 Dec 2006 20:47:47 +0000 Subject: [PATCH] iam: handle variable sized records. --- .../kernel_patches/patches/ext3-iam-separate.patch | 109 ++++++++++++++------- lustre/kernel_patches/patches/ext3-iam-uapi.patch | 5 +- .../patches/ext3-pdirops-2.6.9.patch | 74 ++++++++++---- 3 files changed, 131 insertions(+), 57 deletions(-) diff --git a/lustre/kernel_patches/patches/ext3-iam-separate.patch b/lustre/kernel_patches/patches/ext3-iam-separate.patch index f4f1ff8..4d1efa0 100644 --- a/lustre/kernel_patches/patches/ext3-iam-separate.patch +++ b/lustre/kernel_patches/patches/ext3-iam-separate.patch @@ -15,7 +15,7 @@ Index: iam/fs/ext3/iam.c =================================================================== --- iam.orig/fs/ext3/iam.c +++ iam/fs/ext3/iam.c -@@ -0,0 +1,1443 @@ +@@ -0,0 +1,1442 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * @@ -893,7 +893,8 @@ Index: iam/fs/ext3/iam.c + assert_corr(iam_leaf_is_locked(leaf)); + + result = 0; -+ do_corr(ik_orig = iam_it_ikey_get(it, iam_path_ikey(path, 2))); ++ do_corr(ik_orig = it_at_rec(it) ? ++ iam_it_ikey_get(it, iam_path_ikey(path, 2)) : NULL); + if (it_before(it)) { + assert_corr(!iam_leaf_at_end(leaf)); + it->ii_state = IAM_IT_ATTACHED; @@ -932,7 +933,8 @@ Index: iam/fs/ext3/iam.c + } + assert_corr(ergo(result == 0, it_state(it) == IAM_IT_ATTACHED)); + assert_corr(ergo(result > 0, it_state(it) == IAM_IT_DETACHED)); -+ assert_corr(ergo(result == 0, it_ikeycmp(it, ik_orig) >= 0)); ++ assert_corr(ergo(result == 0 && ik_orig != NULL, ++ it_ikeycmp(it, ik_orig) >= 0)); + return result; +} +EXPORT_SYMBOL(iam_it_next); @@ -1203,9 +1205,7 @@ Index: iam/fs/ext3/iam.c + it->ii_state = IAM_IT_ATTACHED; + assert_corr(ergo(result == 0, + it_state(it) == IAM_IT_ATTACHED && -+ it_keycmp(it, k) == 0 && -+ !memcmp(iam_it_rec_get(it), r, -+ iam_it_container(it)->ic_descr->id_rec_size))); ++ it_keycmp(it, k) == 0)); + return result; +} +EXPORT_SYMBOL(iam_it_rec_insert); @@ -1373,7 +1373,7 @@ Index: iam/fs/ext3/iam.c + /* + * record with required key found, copy it into user buffer + */ -+ iam_reccpy(&it.ii_path, r, iam_it_rec_get(&it)); ++ iam_reccpy(&it.ii_path.ip_leaf, r); + iam_it_put(&it); + iam_it_fini(&it); + return result; @@ -1388,8 +1388,7 @@ Index: iam/fs/ext3/iam.c + * given key is already present. + * + * postcondition: ergo(result == 0 || result == -EEXIST, -+ * iam_lookup(c, k, r2) > 0 && -+ * !memcmp(r, r2, c->ic_descr->id_rec_size)); ++ * iam_lookup(c, k, r2) > 0; + */ +int iam_insert(handle_t *h, struct iam_container *c, const struct iam_key *k, + const struct iam_rec *r, struct iam_path_descr *pd) @@ -1463,7 +1462,7 @@ Index: iam/fs/ext3/iam_htree.c =================================================================== --- iam.orig/fs/ext3/iam_htree.c +++ iam/fs/ext3/iam_htree.c -@@ -0,0 +1,684 @@ +@@ -0,0 +1,693 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * @@ -1805,6 +1804,14 @@ Index: iam/fs/ext3/iam_htree.c + getent(l)->inode = cpu_to_le32(*ino); +} + ++static void iam_htree_rec_get(const struct iam_leaf *l, struct iam_rec *r) ++{ ++ __u32 *ino; ++ ++ ino = (void *)r; ++ *ino = le32_to_cpu(getent(l)->inode); ++} ++ +static void iam_htree_rec_add(struct iam_leaf *leaf, const struct iam_key *k, + const struct iam_rec *r) +{ @@ -1920,6 +1927,7 @@ Index: iam/fs/ext3/iam_htree.c + .key_eq = iam_htree_key_eq, + .key_size = iam_htree_key_size, + .rec_set = iam_htree_rec_set, ++ .rec_get = iam_htree_rec_get, + .lookup = iam_htree_lookup, + .ilookup = iam_htree_ilookup, + .at_end = iam_htree_at_end, @@ -2152,7 +2160,7 @@ Index: iam/fs/ext3/iam_lfix.c =================================================================== --- iam.orig/fs/ext3/iam_lfix.c +++ iam/fs/ext3/iam_lfix.c -@@ -0,0 +1,724 @@ +@@ -0,0 +1,731 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * @@ -2502,7 +2510,13 @@ Index: iam/fs/ext3/iam_lfix.c +static void iam_lfix_rec_set(struct iam_leaf *l, const struct iam_rec *r) +{ + assert_corr(iam_leaf_at_rec(l)); -+ iam_reccpy(iam_leaf_path(l), iam_lfix_rec(l), r); ++ memcpy(iam_lfix_rec(l), r, iam_leaf_descr(l)->id_rec_size); ++} ++ ++static void iam_lfix_rec_get(const struct iam_leaf *l, struct iam_rec *r) ++{ ++ assert_corr(iam_leaf_at_rec(l)); ++ memcpy(r, iam_lfix_rec(l), iam_leaf_descr(l)->id_rec_size); +} + +static void iam_lfix_rec_add(struct iam_leaf *leaf, @@ -2654,6 +2668,7 @@ Index: iam/fs/ext3/iam_lfix.c + .key_eq = iam_lfix_key_eq, + .key_size = iam_lfix_key_size, + .rec_set = iam_lfix_rec_set, ++ .rec_get = iam_lfix_rec_get, + .lookup = iam_lfix_lookup, + .ilookup = iam_lfix_ilookup, + .at_end = iam_lfix_at_end, @@ -2881,7 +2896,7 @@ Index: iam/fs/ext3/iam_lvar.c =================================================================== --- iam.orig/fs/ext3/iam_lvar.c +++ iam/fs/ext3/iam_lvar.c -@@ -0,0 +1,1060 @@ +@@ -0,0 +1,1088 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * @@ -2979,11 +2994,6 @@ Index: iam/fs/ext3/iam_lvar.c +} + + -+static inline int recsize(const struct iam_leaf *leaf) -+{ -+ return iam_leaf_descr(leaf)->id_rec_size; -+} -+ +static inline int e_keysize(const struct lvar_leaf_entry *ent) +{ + return le16_to_cpu(ent->vle_keysize); @@ -2995,18 +3005,29 @@ Index: iam/fs/ext3/iam_lvar.c + LVAR_ROUND = LVAR_PAD - 1 +}; + -+static inline int getsize(const struct iam_leaf *leaf, int namelen) ++static inline int getsize(const struct iam_leaf *leaf, int namelen, int recsize) +{ + CLASSERT(!(LVAR_PAD & (LVAR_PAD - 1))); + + return (offsetof(struct lvar_leaf_entry, vle_key) + -+ namelen + recsize(leaf) + LVAR_ROUND) & ~LVAR_ROUND; ++ namelen + recsize + LVAR_ROUND) & ~LVAR_ROUND; ++} ++ ++static inline int rec_size(const struct iam_rec *rec) ++{ ++ return *(const char *)rec; ++} ++ ++static inline struct iam_rec *e_rec(const struct lvar_leaf_entry *ent) ++{ ++ return ((void *)ent) + ++ offsetof(struct lvar_leaf_entry, vle_key) + e_keysize(ent); +} + +static inline int e_size(const struct iam_leaf *leaf, + const struct lvar_leaf_entry *ent) +{ -+ return getsize(leaf, e_keysize(ent)); ++ return getsize(leaf, e_keysize(ent), rec_size(e_rec(ent))); +} + +static inline char *e_char(const struct lvar_leaf_entry *ent) @@ -3024,12 +3045,6 @@ Index: iam/fs/ext3/iam_lvar.c + return le32_to_cpu(ent->vle_hash); +} + -+static inline struct iam_rec *e_rec(const struct lvar_leaf_entry *ent) -+{ -+ return ((void *)ent) + -+ offsetof(struct lvar_leaf_entry, vle_key) + e_keysize(ent); -+} -+ +static void e_print(const struct lvar_leaf_entry *ent) +{ + printk(" %p %8.8x \"%*.*s\"\n", ent, e_hash(ent), @@ -3210,6 +3225,7 @@ Index: iam/fs/ext3/iam_lvar.c + nexthash = e_hash(scan); + if (nexthash != get_hash(iam_leaf_container(leaf), + e_char(scan), e_keysize(scan))) { ++ BREAKPOINT(); + return 0; + } + if (0 && nexthash < starthash) { @@ -3224,11 +3240,13 @@ Index: iam/fs/ext3/iam_lvar.c + return 0; + } + if (nexthash < hash) { ++ BREAKPOINT(); + return 0; + } + hash = nexthash; + } + if (scan != end) { ++ BREAKPOINT(); + return 0; + } + return 1; @@ -3414,12 +3432,17 @@ Index: iam/fs/ext3/iam_lvar.c + return IAM_LOOKUP_OK; +} + ++static void __lvar_key_set(struct iam_leaf *l, const struct iam_key *k) ++{ ++ memcpy(e_key(n_cur(l)), k, e_keysize(n_cur(l))); ++} ++ +static void lvar_key_set(struct iam_leaf *l, const struct iam_key *k) +{ + assert_corr(n_at_rec(l)); + assert_corr(strlen(kchar(k)) == e_keysize(n_cur(l))); + assert_corr(iam_leaf_is_locked(l)); -+ memcpy(e_key(n_cur(l)), k, e_keysize(n_cur(l))); ++ __lvar_key_set(l, k); + assert_inv(n_invariant(l)); +} + @@ -3442,11 +3465,27 @@ Index: iam/fs/ext3/iam_lvar.c + return e_eq(n_cur(l), name, strlen(name)); +} + ++static void __lvar_rec_set(struct iam_leaf *l, const struct iam_rec *r) ++{ ++ memcpy(e_rec(n_cur(l)), r, rec_size(r)); ++} ++ +static void lvar_rec_set(struct iam_leaf *l, const struct iam_rec *r) +{ + assert_corr(n_at_rec(l)); + assert_corr(iam_leaf_is_locked(l)); -+ iam_reccpy(iam_leaf_path(l), e_rec(n_cur(l)), r); ++ __lvar_rec_set(l, r); ++ assert_inv(n_invariant(l)); ++} ++ ++static void lvar_rec_get(const struct iam_leaf *l, struct iam_rec *r) ++{ ++ struct iam_rec *rec; ++ ++ rec = e_rec(n_cur(l)); ++ assert_corr(n_at_rec(l)); ++ assert_corr(iam_leaf_is_locked(l)); ++ memcpy(r, rec, rec_size(rec)); + assert_inv(n_invariant(l)); +} + @@ -3454,7 +3493,9 @@ Index: iam/fs/ext3/iam_lvar.c + const struct iam_key *k, const struct iam_rec *r) +{ + assert_corr(iam_leaf_is_locked(l)); -+ return h_used(n_head(l)) + getsize(l, strlen(kchar(k))) <= blocksize(l); ++ return ++ h_used(n_head(l)) + ++ getsize(l, strlen(kchar(k)), rec_size(r)) <= blocksize(l); +} + +static int lvar_at_end(const struct iam_leaf *folio) @@ -3479,7 +3520,7 @@ Index: iam/fs/ext3/iam_lvar.c + + key = kchar(k); + ksize = strlen(key); -+ shift = getsize(leaf, ksize); ++ shift = getsize(leaf, ksize, rec_size(r)); + + if (!lvar_at_end(leaf)) { + assert_corr(n_cur(leaf) < n_end(leaf)); @@ -3502,8 +3543,8 @@ Index: iam/fs/ext3/iam_lvar.c + n_cur(leaf)->vle_keysize = cpu_to_le16(ksize); + n_cur(leaf)->vle_hash = cpu_to_le32(get_hash(iam_leaf_container(leaf), + key, ksize)); -+ lvar_key_set(leaf, k); -+ lvar_rec_set(leaf, r); ++ __lvar_key_set(leaf, k); ++ __lvar_rec_set(leaf, r); + assert_corr(n_at_rec(leaf)); + assert_inv(n_invariant(leaf)); +} @@ -3634,6 +3675,7 @@ Index: iam/fs/ext3/iam_lvar.c + .key_eq = lvar_key_eq, + .key_size = lvar_key_size, + .rec_set = lvar_rec_set, ++ .rec_get = lvar_rec_get, + .lookup = lvar_lookup, + .ilookup = lvar_ilookup, + .at_end = lvar_at_end, @@ -3851,6 +3893,7 @@ Index: iam/fs/ext3/iam_lvar.c + .vle_keysize = 0 + }; + memset(e_rec(entry), 0, recsize); ++ *(char *)e_rec(entry) = recsize; +} + +#include diff --git a/lustre/kernel_patches/patches/ext3-iam-uapi.patch b/lustre/kernel_patches/patches/ext3-iam-uapi.patch index 082658a..23ae08b 100644 --- a/lustre/kernel_patches/patches/ext3-iam-uapi.patch +++ b/lustre/kernel_patches/patches/ext3-iam-uapi.patch @@ -100,7 +100,7 @@ Index: iam/fs/ext3/iam-uapi.c =================================================================== --- iam.orig/fs/ext3/iam-uapi.c +++ iam/fs/ext3/iam-uapi.c -@@ -0,0 +1,367 @@ +@@ -0,0 +1,366 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * @@ -192,8 +192,7 @@ Index: iam/fs/ext3/iam-uapi.c + memcpy(itop->iui_op.iul_key, iam_it_key_get(it), + iam_it_key_size(it)); + if (st == IAM_IT_ATTACHED) -+ iam_reccpy(&it->ii_path, -+ itop->iui_op.iul_rec, iam_it_rec_get(it)); ++ iam_reccpy(&it->ii_path.ip_leaf, itop->iui_op.iul_rec); + itop->iui_state = st; + return result; +} diff --git a/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch b/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch index 9447a0b..de96fa9 100644 --- a/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch +++ b/lustre/kernel_patches/patches/ext3-pdirops-2.6.9.patch @@ -657,11 +657,15 @@ Index: iam/fs/ext3/namei.c } int ext3_htree_next_block(struct inode *dir, __u32 hash, -@@ -649,14 +1011,25 @@ void iam_insert_key(struct iam_path *pat +@@ -649,14 +1011,29 @@ void iam_insert_key(struct iam_path *pat struct iam_entry *new = iam_entry_shift(path, frame->at, +1); int count = dx_get_count(entries); -+ assert_corr(iam_frame_is_locked(path, frame)); ++ /* ++ * Unfortunately we cannot assert this, as this function is sometimes ++ * called by VFS under i_sem and without pdirops lock. ++ */ ++ assert_corr(1 || iam_frame_is_locked(path, frame)); assert_corr(count < dx_get_limit(entries)); assert_corr(frame->at < iam_entry_shift(path, entries, count)); + assert_inv(dx_node_check(path, frame)); @@ -683,7 +687,7 @@ Index: iam/fs/ext3/namei.c } void dx_insert_block(struct iam_path *path, struct iam_frame *frame, -@@ -882,7 +1255,7 @@ static struct buffer_head * ext3_dx_find +@@ -882,7 +1259,7 @@ static struct buffer_head * ext3_dx_find sb = dir->i_sb; /* NFS may look up ".." - look at dx_root directory block */ if (namelen > 2 || name[0] != '.'||(name[1] != '.' && name[1] != '\0')){ @@ -692,7 +696,7 @@ Index: iam/fs/ext3/namei.c if (*err != 0) return NULL; } else { -@@ -1114,7 +1487,7 @@ struct ext3_dir_entry_2 *move_entries(st +@@ -1114,7 +1491,7 @@ struct ext3_dir_entry_2 *move_entries(st hash2 = map[split].hash; continued = hash2 == map[split - 1].hash; dxtrace(printk("Split block %i at %x, %i/%i\n", @@ -701,7 +705,7 @@ Index: iam/fs/ext3/namei.c /* Fancy dance to stay within two buffers */ de2 = dx_move_dirents(data1, data2, map + split, count - split); -@@ -1484,16 +1857,38 @@ static int shift_entries(struct iam_path +@@ -1484,16 +1861,38 @@ static int shift_entries(struct iam_path (char *) iam_entry_shift(path, entries, count1), count2 * iam_entry_size(path)); @@ -743,7 +747,7 @@ Index: iam/fs/ext3/namei.c { struct iam_entry *entries; /* old block contents */ -@@ -1501,6 +1896,8 @@ int split_index_node(handle_t *handle, s +@@ -1501,6 +1900,8 @@ int split_index_node(handle_t *handle, s struct iam_frame *frame, *safe; struct buffer_head *bh_new[DX_MAX_TREE_HEIGHT] = {0}; u32 newblock[DX_MAX_TREE_HEIGHT] = {0}; @@ -752,7 +756,7 @@ Index: iam/fs/ext3/namei.c struct inode *dir = iam_path_obj(path); struct iam_descr *descr; int nr_splet; -@@ -1523,12 +1920,14 @@ int split_index_node(handle_t *handle, s +@@ -1523,12 +1924,14 @@ int split_index_node(handle_t *handle, s * - first allocate all necessary blocks * * - insert pointers into them atomically. @@ -771,7 +775,7 @@ Index: iam/fs/ext3/namei.c dxtrace(printk("using %u of %u node entries\n", dx_get_count(entries), dx_get_limit(entries))); -@@ -1536,6 +1935,7 @@ int split_index_node(handle_t *handle, s +@@ -1536,6 +1939,7 @@ int split_index_node(handle_t *handle, s for (nr_splet = 0; frame >= path->ip_frames && dx_get_count(frame->entries) == dx_get_limit(frame->entries); --frame, ++nr_splet) { @@ -779,7 +783,7 @@ Index: iam/fs/ext3/namei.c if (nr_splet == DX_MAX_TREE_HEIGHT) { ext3_warning(dir->i_sb, __FUNCTION__, "Directory index full!\n"); -@@ -1545,14 +1945,53 @@ int split_index_node(handle_t *handle, s +@@ -1545,14 +1949,53 @@ int split_index_node(handle_t *handle, s } safe = frame; @@ -834,7 +838,7 @@ Index: iam/fs/ext3/namei.c BUFFER_TRACE(frame->bh, "get_write_access"); err = ext3_journal_get_write_access(handle, frame->bh); if (err) -@@ -1560,6 +1999,7 @@ int split_index_node(handle_t *handle, s +@@ -1560,6 +2003,7 @@ int split_index_node(handle_t *handle, s } /* Add "safe" node to transaction too */ if (safe + 1 != path->ip_frames) { @@ -842,7 +846,7 @@ Index: iam/fs/ext3/namei.c err = ext3_journal_get_write_access(handle, safe->bh); if (err) goto journal_error; -@@ -1596,16 +2036,21 @@ int split_index_node(handle_t *handle, s +@@ -1596,16 +2040,21 @@ int split_index_node(handle_t *handle, s assert_corr(i == 0); @@ -864,7 +868,7 @@ Index: iam/fs/ext3/namei.c /* Shift frames in the path */ memmove(frames + 2, frames + 1, (sizeof path->ip_frames) - 2 * sizeof frames[0]); -@@ -1621,10 +2066,12 @@ int split_index_node(handle_t *handle, s +@@ -1621,10 +2070,12 @@ int split_index_node(handle_t *handle, s err = ext3_journal_get_write_access(handle, bh2); if (err) goto journal_error; @@ -877,7 +881,7 @@ Index: iam/fs/ext3/namei.c count = shift_entries(path, frame, count, entries, entries2, newblock[i]); /* Which index block gets the new entry? */ -@@ -1634,7 +2081,11 @@ int split_index_node(handle_t *handle, s +@@ -1634,7 +2085,11 @@ int split_index_node(handle_t *handle, s frame->at = iam_entry_shift(path, entries2, idx - count + d); frame->entries = entries = entries2; @@ -889,7 +893,7 @@ Index: iam/fs/ext3/namei.c bh_new[i] = bh2; parent->at = iam_entry_shift(path, parent->at, +1); -@@ -1647,20 +2098,25 @@ int split_index_node(handle_t *handle, s +@@ -1647,20 +2102,25 @@ int split_index_node(handle_t *handle, s err = ext3_journal_dirty_metadata(handle, bh2); if (err) goto journal_error; @@ -916,7 +920,7 @@ Index: iam/fs/ext3/namei.c if (nr_splet > 0) { /* * Log ->i_size modification. -@@ -1674,6 +2130,12 @@ journal_error: +@@ -1674,6 +2134,12 @@ journal_error: ext3_std_error(dir->i_sb, err); cleanup: @@ -929,7 +933,7 @@ Index: iam/fs/ext3/namei.c for (i = 0; i < ARRAY_SIZE(bh_new); ++i) { if (bh_new[i] != NULL) brelse(bh_new[i]); -@@ -1695,18 +2157,18 @@ static int ext3_dx_add_entry(handle_t *h +@@ -1695,18 +2161,18 @@ static int ext3_dx_add_entry(handle_t *h struct buffer_head * bh = NULL; struct inode *dir = dentry->d_parent->d_inode; struct ext3_dir_entry_2 *de; @@ -950,7 +954,7 @@ Index: iam/fs/ext3/namei.c isize = dir->i_size; err = param->id_ops->id_node_read(path->ip_container, -@@ -1726,7 +2188,7 @@ static int ext3_dx_add_entry(handle_t *h +@@ -1726,7 +2192,7 @@ static int ext3_dx_add_entry(handle_t *h goto cleanup; } @@ -959,7 +963,7 @@ Index: iam/fs/ext3/namei.c if (err) goto cleanup; -@@ -1742,6 +2204,7 @@ static int ext3_dx_add_entry(handle_t *h +@@ -1742,6 +2208,7 @@ static int ext3_dx_add_entry(handle_t *h journal_error: ext3_std_error(dir->i_sb, err); cleanup: @@ -1106,15 +1110,18 @@ Index: iam/include/linux/lustre_iam.h /* * Format name. */ -@@ -331,6 +349,7 @@ struct iam_leaf_operations { +@@ -329,8 +347,10 @@ struct iam_leaf_operations { + + void (*key_set)(struct iam_leaf *l, const struct iam_key *k); void (*rec_set)(struct iam_leaf *l, const struct iam_rec *r); ++ void (*rec_get)(const struct iam_leaf *l, struct iam_rec *r); int (*key_cmp)(const struct iam_leaf *l, const struct iam_key *k); + int (*key_eq)(const struct iam_leaf *l, const struct iam_key *k); int (*key_size)(const struct iam_leaf *l); /* -@@ -473,7 +492,7 @@ struct iam_path_compat { +@@ -473,7 +493,7 @@ struct iam_path_compat { struct iam_container ipc_container; __u32 ipc_scratch[DX_SCRATCH_KEYS]; struct dx_hash_info *ipc_hinfo; @@ -1123,7 +1130,7 @@ Index: iam/include/linux/lustre_iam.h struct iam_path_descr ipc_descr; struct dx_hash_info ipc_hinfo_area; }; -@@ -554,6 +573,7 @@ struct iam_iterator { +@@ -554,6 +574,7 @@ struct iam_iterator { void iam_path_init(struct iam_path *path, struct iam_container *c, struct iam_path_descr *pd); void iam_path_fini(struct iam_path *path); @@ -1131,6 +1138,31 @@ Index: iam/include/linux/lustre_iam.h void iam_path_compat_init(struct iam_path_compat *path, struct inode *inode); void iam_path_compat_fini(struct iam_path_compat *path); +@@ -683,12 +704,6 @@ static inline int iam_ikeycmp(const stru + return c->ic_descr->id_ops->id_ikeycmp(c, k1, k2); + } + +-static inline void iam_reccpy(const struct iam_path *p, struct iam_rec *rec_dst, +- const struct iam_rec *rec_src) +-{ +- memcpy(rec_dst, rec_src, iam_path_descr(p)->id_rec_size); +-} +- + static inline void *iam_entry_off(struct iam_entry *entry, size_t off) + { + return (void *)((char *)entry + off); +@@ -720,6 +735,11 @@ iam_leaf_ops(const struct iam_leaf *leaf + return iam_leaf_descr(leaf)->id_leaf_ops; + } + ++static inline void iam_reccpy(const struct iam_leaf *leaf, ++ struct iam_rec *rec_dst) ++{ ++ iam_leaf_ops(leaf)->rec_get(leaf, rec_dst); ++} + + /*XXX These stuff put here, just because they are used by iam.c and namei.c*/ + static inline unsigned dx_get_block(struct iam_path *p, struct iam_entry *entry) @@ -848,7 +868,36 @@ static inline struct iam_ikey *iam_path_ return path->ip_data->ipd_key_scratch[nr]; } -- 1.8.3.1