Whamcloud - gitweb
b=17569
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-xattr-no-update-ctime-rhel4.patch
1 Index: linux-2.6.9-67.0.20/include/linux/ext3_fs.h
2 ===================================================================
3 --- linux-2.6.9-67.0.20.orig/include/linux/ext3_fs.h
4 +++ linux-2.6.9-67.0.20/include/linux/ext3_fs.h
5 @@ -873,6 +873,13 @@ struct mmp_struct {
6  #define EXT3_MMP_MIN_CHECK_INTERVAL    5
7  
8  /*
9 + * Indicates that ctime should not be updated in ext3_xattr_set_handle()
10 + */
11 +#ifndef XATTR_NO_CTIME
12 +#define XATTR_NO_CTIME 0x80
13 +#endif
14 +
15 +/*
16   * Function prototypes
17   */
18  
19 Index: linux-2.6.9-67.0.20/fs/ext3/xattr.c
20 ===================================================================
21 --- linux-2.6.9-67.0.20.orig/fs/ext3/xattr.c
22 +++ linux-2.6.9-67.0.20/fs/ext3/xattr.c
23 @@ -91,7 +91,7 @@
24  
25  static int ext3_xattr_set_handle2(handle_t *, struct inode *,
26                                   struct buffer_head *,
27 -                                 struct ext3_xattr_header *);
28 +                                 struct ext3_xattr_header *, int);
29  
30  static int ext3_xattr_cache_insert(struct buffer_head *);
31  static struct buffer_head *ext3_xattr_cache_find(handle_t *, struct inode *,
32 @@ -1215,12 +1215,12 @@ skip_replace:
33                 /* This block is now empty. */
34                 if (bh && header == HDR(bh))
35                         unlock_buffer(bh);  /* we were modifying in-place. */
36 -               error = ext3_xattr_set_handle2(handle, inode, bh, NULL);
37 +               error = ext3_xattr_set_handle2(handle, inode, bh, NULL, flags);
38         } else {
39                 ext3_xattr_rehash(header, here);
40                 if (bh && header == HDR(bh))
41                         unlock_buffer(bh);  /* we were modifying in-place. */
42 -               error = ext3_xattr_set_handle2(handle, inode, bh, header);
43 +               error = ext3_xattr_set_handle2(handle, inode, bh, header, flags);
44         }
45  
46  cleanup:
47 @@ -1237,7 +1237,7 @@ cleanup:
48  static int
49  ext3_xattr_set_handle2(handle_t *handle, struct inode *inode,
50                        struct buffer_head *old_bh,
51 -                      struct ext3_xattr_header *header)
52 +                      struct ext3_xattr_header *header, int flags)
53  {
54         struct super_block *sb = inode->i_sb;
55         struct buffer_head *new_bh = NULL;
56 @@ -1311,7 +1311,8 @@ getblk_failed:
57  
58         /* Update the inode. */
59         EXT3_I(inode)->i_file_acl = new_bh ? new_bh->b_blocknr : 0;
60 -       inode->i_ctime = ext3_current_time(inode);
61 +       if (!(flags & XATTR_NO_CTIME))
62 +               inode->i_ctime = ext3_current_time(inode);
63         ext3_mark_inode_dirty(handle, inode);
64         if (IS_SYNC(inode))
65                 handle->h_sync = 1;