Whamcloud - gitweb
LU-162 Export ext4_discard_preallocations for ldiskfs
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4-wantedi-2.6-rhel6.patch
1 Index: linux-2.6.32.i386/fs/ext4/namei.c
2 ===================================================================
3 --- linux-2.6.32.i386.orig/fs/ext4/namei.c      2010-04-07 00:16:32.000000000 +0530
4 +++ linux-2.6.32.i386/fs/ext4/namei.c   2010-04-07 00:17:09.000000000 +0530
5 @@ -144,6 +144,17 @@
6         u16 size;
7  };
8  
9 +/*
10 + * dentry_param used by ext4_new_inode_wantedi()
11 + */
12 +#define LVFS_DENTRY_PARAM_MAGIC                20070216UL
13 +struct lvfs_dentry_params
14 +{
15 +       unsigned long   ldp_inum;
16 +       unsigned long   ldp_flags;
17 +       u32             ldp_magic;
18 +};
19 +
20  static inline ext4_lblk_t dx_get_block(struct dx_entry *entry);
21  static void dx_set_block(struct dx_entry *entry, ext4_lblk_t value);
22  static inline unsigned dx_get_hash(struct dx_entry *entry);
23 @@ -1751,6 +1762,19 @@
24         return err;
25  }
26  
27 +static unsigned ext4_dentry_goal(struct super_block *sb, struct dentry *dentry)
28 +{
29 +       unsigned inum = EXT4_SB(sb)->s_inode_goal;
30 +
31 +       if (dentry->d_fsdata != NULL) {
32 +               struct lvfs_dentry_params *param = dentry->d_fsdata;
33 +
34 +               if (param->ldp_magic == LVFS_DENTRY_PARAM_MAGIC)
35 +                       inum = param->ldp_inum;
36 +       }
37 +       return inum;
38 +}
39 +
40  /*
41   * By the time this is called, we already have created
42   * the directory cache entry for the new file, but it