1 Index: linux-stage/fs/ext4/ext4.h
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/ext4.h 2012-08-07 11:52:38.994200699 -0700
4 +++ linux-stage/fs/ext4/ext4.h 2012-08-07 12:28:19.497442862 -0700
9 +#include <linux/dynlocks.h>
10 #include <linux/types.h>
11 #include <linux/blkdev.h>
12 #include <linux/magic.h>
15 ext4_fsblk_t i_file_acl;
17 + /* following fields for parallel directory operations -bzzz */
18 + 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 Index: linux-stage/fs/ext4/namei.c
24 ===================================================================
25 --- linux-stage.orig/fs/ext4/namei.c 2012-08-07 11:52:38.992199430 -0700
26 +++ linux-stage/fs/ext4/namei.c 2012-08-07 12:27:24.845281099 -0700
28 ext4_lblk_t *block, int *err)
30 struct buffer_head *bh;
31 + struct ext4_inode_info *ei = EXT4_I(inode);
33 + /* with parallel dir operations all appends
34 + * have to be serialized -bzzz */
35 + down(&ei->i_append_sem);
37 *block = inode->i_size >> inode->i_sb->s_blocksize_bits;
43 + ei->i_disksize = inode->i_size;
45 + up(&ei->i_append_sem);
49 Index: linux-stage/fs/ext4/super.c
50 ===================================================================
51 --- linux-stage.orig/fs/ext4/super.c 2012-08-07 11:52:39.009197356 -0700
52 +++ linux-stage/fs/ext4/super.c 2012-08-07 12:28:29.499112997 -0700
55 ei->vfs_inode.i_version = 1;
56 ei->vfs_inode.i_data.writeback_index = 0;
57 + sema_init(&ei->i_append_sem, 1);
58 memset(&ei->i_cached_extent, 0, sizeof(struct ext4_ext_cache));
59 INIT_LIST_HEAD(&ei->i_prealloc_list);
60 spin_lock_init(&ei->i_prealloc_lock);