Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / ext3-extents-asyncdel-2.4.21-chaos.patch
1 Index: 57chaos/fs/ext3/inode.c
2 ===================================================================
3 --- 57chaos.orig/fs/ext3/inode.c        2004-06-21 14:15:31.000000000 -0700
4 +++ 57chaos/fs/ext3/inode.c     2004-06-21 14:19:27.000000000 -0700
5 @@ -2270,6 +2270,12 @@ void ext3_truncate_thread(struct inode *
6  
7         memcpy(nei->i_data, oei->i_data, sizeof(nei->i_data));
8         memset(oei->i_data, 0, sizeof(oei->i_data));
9 +       if (EXT3_I(old_inode)->i_flags & EXT3_EXTENTS_FL) {
10 +               EXT3_I(new_inode)->i_flags |= EXT3_EXTENTS_FL;
11 +               ext3_extents_initialize_blockmap(handle, old_inode);
12 +       } else {
13 +               EXT3_I(new_inode)->i_flags &= ~EXT3_EXTENTS_FL;
14 +       }
15  
16         nei->i_disksize = oei->i_disksize;
17         nei->i_state |= EXT3_STATE_DELETE;
18 @@ -2522,6 +2526,13 @@ void ext3_read_inode(struct inode * inod
19         else
20                 EXT3_I(inode)->i_extra_isize = 0;
21  
22 +       if (EXT3_I(inode)->i_flags & EXT3_EXTENTS_FL) {
23 +               inode->u.ext3_i.i_cached_extent[0] = 0;
24 +               inode->u.ext3_i.i_cached_extent[1] = 0;
25 +               inode->u.ext3_i.i_cached_extent[2] = 0;
26 +               inode->u.ext3_i.i_cached_extent[3] = 0;
27 +       }
28 +
29         if (S_ISREG(inode->i_mode)) {
30                 inode->i_op = &ext3_file_inode_operations;
31                 inode->i_fop = &ext3_file_operations;