1 diff -rupN linux-2.6.27.21-0.1_1//fs/ext4/ext4_i.h linux-2.6.27.21-0.1_2//fs/ext4/ext4_i.h
2 --- linux-2.6.27.21-0.1_1//fs/ext4/ext4_i.h 2009-08-24 13:00:59.000000000 +0530
3 +++ linux-2.6.27.21-0.1_2//fs/ext4/ext4_i.h 2009-08-24 13:01:25.000000000 +0530
8 +#include <linux/dynlocks.h>
9 #include <linux/rwsem.h>
10 #include <linux/rbtree.h>
11 #include <linux/seqlock.h>
12 @@ -56,7 +57,9 @@ struct ext4_inode_info {
14 ext4_fsblk_t i_file_acl;
17 + /* following fields for parallel directory operations -bzzz */
18 + struct dynlock i_htree_lock;
19 + struct semaphore i_append_sem;
21 * i_block_group is the number of the block group which contains
22 * this file's inode. Constant across the lifetime of the inode,
23 diff -rupN linux-2.6.27.21-0.1_1//fs/ext4/namei.c linux-2.6.27.21-0.1_2//fs/ext4/namei.c
24 --- linux-2.6.27.21-0.1_1//fs/ext4/namei.c 2009-08-24 13:00:59.000000000 +0530
25 +++ linux-2.6.27.21-0.1_2//fs/ext4/namei.c 2009-08-24 13:03:45.000000000 +0530
26 @@ -55,6 +55,11 @@ static struct buffer_head *ext4_append(h
27 ext4_lblk_t *block, int *err)
29 struct buffer_head *bh;
30 + struct ext4_inode_info *ei = EXT4_I(inode);
32 + /* with parallel dir operations all appends
33 + * have to be serialized -bzzz */
34 + down(&ei->i_append_sem);
36 *block = inode->i_size >> inode->i_sb->s_blocksize_bits;
38 @@ -67,7 +72,9 @@ static struct buffer_head *ext4_append(h
42 + ei->i_disksize = inode->i_size;
44 + up(&ei->i_append_sem);
48 diff -rupN linux-2.6.27.21-0.1_1//fs/ext4/super.c linux-2.6.27.21-0.1_2//fs/ext4/super.c
49 --- linux-2.6.27.21-0.1_1//fs/ext4/super.c 2009-08-24 13:00:59.000000000 +0530
50 +++ linux-2.6.27.21-0.1_2//fs/ext4/super.c 2009-08-24 13:01:25.000000000 +0530
51 @@ -635,6 +635,8 @@ static struct inode *ext4_alloc_inode(st
53 ei->vfs_inode.i_version = 1;
54 ei->vfs_inode.i_data.writeback_index = 0;
55 + dynlock_init(&ei->i_htree_lock);
56 + sema_init(&ei->i_append_sem, 1);
57 memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
58 INIT_LIST_HEAD(&ei->i_prealloc_list);
59 spin_lock_init(&ei->i_prealloc_lock);