From 06e3247a42f2a483a199d46f38fd11392ef4f8d8 Mon Sep 17 00:00:00 2001 From: wangdi Date: Wed, 4 Oct 2006 17:09:47 +0000 Subject: [PATCH] Branch: b_new_cmd reset . and .. namehash for not distributing them in split --- .../kernel_patches/patches/ext3-iam-separate.patch | 115 +++++++++++---------- 1 file changed, 60 insertions(+), 55 deletions(-) diff --git a/lustre/kernel_patches/patches/ext3-iam-separate.patch b/lustre/kernel_patches/patches/ext3-iam-separate.patch index e7cfaa6..44f4938 100644 --- a/lustre/kernel_patches/patches/ext3-iam-separate.patch +++ b/lustre/kernel_patches/patches/ext3-iam-separate.patch @@ -1,8 +1,8 @@ -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 \ @@ -11,10 +11,10 @@ Index: iam/fs/ext3/Makefile 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: @@ -1353,10 +1353,10 @@ Index: iam/fs/ext3/iam.c +} +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: @@ -2026,10 +2026,10 @@ Index: iam/fs/ext3/iam_htree.c +{ + 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: @@ -2706,11 +2706,11 @@ Index: iam/fs/ext3/iam_lfix.c + 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: + * @@ -2887,9 +2887,14 @@ Index: iam/fs/ext3/iam_lvar.c + + 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 @@ -3613,10 +3618,10 @@ Index: iam/fs/ext3/iam_lvar.c + 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 */ @@ -3724,7 +3729,7 @@ Index: iam/fs/ext3/namei.c { 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; @@ -3744,7 +3749,7 @@ Index: iam/fs/ext3/namei.c #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 @@ -4038,7 +4043,7 @@ Index: iam/fs/ext3/namei.c 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); @@ -4321,7 +4326,7 @@ Index: iam/fs/ext3/namei.c } /* -@@ -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}; @@ -5012,7 +5017,7 @@ Index: iam/fs/ext3/namei.c /* * 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. */ @@ -5032,7 +5037,7 @@ Index: iam/fs/ext3/namei.c 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; } @@ -5107,7 +5112,7 @@ Index: iam/fs/ext3/namei.c /* * 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); } @@ -5145,7 +5150,7 @@ Index: iam/fs/ext3/namei.c #endif -@@ -1897,14 +872,15 @@ static struct buffer_head * ext3_dx_find +@@ -1897,14 +872,15 @@ if (*err != 0) return NULL; } else { @@ -5164,7 +5169,7 @@ Index: iam/fs/ext3/namei.c 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; } @@ -5241,7 +5246,7 @@ Index: iam/fs/ext3/namei.c 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; @@ -5279,7 +5284,7 @@ Index: iam/fs/ext3/namei.c err = ext3_journal_dirty_metadata (handle, bh2); if (err) goto journal_error; -@@ -2175,6 +1172,63 @@ errout: +@@ -2175,6 +1172,63 @@ } #endif @@ -5343,7 +5348,7 @@ Index: iam/fs/ext3/namei.c /* * 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; @@ -5385,7 +5390,7 @@ Index: iam/fs/ext3/namei.c } 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 */ @@ -5411,7 +5416,7 @@ Index: iam/fs/ext3/namei.c /* * 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); } @@ -5473,7 +5478,7 @@ Index: iam/fs/ext3/namei.c 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] || @@ -5483,7 +5488,7 @@ Index: iam/fs/ext3/namei.c 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; @@ -5491,7 +5496,7 @@ Index: iam/fs/ext3/namei.c 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); @@ -5499,7 +5504,7 @@ Index: iam/fs/ext3/namei.c 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. */ @@ -5528,7 +5533,7 @@ Index: iam/fs/ext3/namei.c /* 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; @@ -5613,7 +5618,7 @@ Index: iam/fs/ext3/namei.c } 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); @@ -5622,7 +5627,7 @@ Index: iam/fs/ext3/namei.c 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; @@ -5634,7 +5639,7 @@ Index: iam/fs/ext3/namei.c 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*/ @@ -5648,7 +5653,7 @@ Index: iam/fs/ext3/namei.c 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 @@ -5663,10 +5668,10 @@ Index: iam/fs/ext3/namei.c 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: @@ -5738,7 +5743,7 @@ Index: iam/include/linux/lustre_iam.h }; /* -@@ -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; @@ -5750,7 +5755,7 @@ Index: iam/include/linux/lustre_iam.h 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 */ }; @@ -5810,7 +5815,7 @@ Index: iam/include/linux/lustre_iam.h /* * 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. */ @@ -5821,7 +5826,7 @@ Index: iam/include/linux/lustre_iam.h /* * 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); @@ -5954,7 +5959,7 @@ Index: iam/include/linux/lustre_iam.h }; struct iam_container { -@@ -142,10 +274,17 @@ struct iam_container { +@@ -142,10 +274,17 @@ * container flavor. */ struct iam_descr *ic_descr; @@ -5974,7 +5979,7 @@ Index: iam/include/linux/lustre_iam.h }; /* -@@ -172,36 +311,240 @@ struct iam_path { +@@ -172,36 +311,240 @@ /* * Leaf node: a child of ->ip_frame. */ @@ -6231,7 +6236,7 @@ Index: iam/include/linux/lustre_iam.h */ 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); -- 1.8.3.1