Whamcloud - gitweb
JBD2_HAS_COMPAT_FEATURE was used instead of JBD2_HAS_INCOMPAT_FEATURE for
[fs/lustre-release.git] / lustre / kernel_patches / patches / vfs_races-2.6-suse.patch
1  fs/dcache.c            |   24 ++++++++++++++++++++----
2  include/linux/dcache.h |    2 ++
3  2 files changed, 22 insertions(+), 4 deletions(-)
4
5 --- linux-2.6.0-test1/fs/dcache.c~vfs_races_2.5.72_rev1 2003-07-24 15:52:47.000000000 +0400
6 +++ linux-2.6.0-test1-alexey/fs/dcache.c        2003-09-13 16:21:16.000000000 +0400
7 @@ -212,6 +212,13 @@ int d_invalidate(struct dentry * dentry)
8                 spin_unlock(&dcache_lock);
9                 return 0;
10         }
11 +
12 +       /* network invalidation by Lustre */
13 +       if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
14 +               spin_unlock(&dcache_lock);
15 +               return 0;
16 +       }
17 +
18         /*
19          * Check whether to do a partial shrink_dcache
20          * to get rid of unused child entries.
21 @@ -1135,14 +1142,23 @@ void d_delete(struct dentry * dentry)
22   * Adds a dentry to the hash according to its name.
23   */
24   
25 -void d_rehash(struct dentry * entry)
26 +void d_rehash_cond(struct dentry * entry, int lock)
27  {
28         struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
29 -       spin_lock(&dcache_lock);
30 +       if (lock)
31 +               spin_lock(&dcache_lock);
32         entry->d_vfs_flags &= ~DCACHE_UNHASHED;
33         entry->d_bucket = list;
34         hlist_add_head_rcu(&entry->d_hash, list);
35 -       spin_unlock(&dcache_lock);
36 +       if (lock)
37 +               spin_unlock(&dcache_lock);
38 +}
39 +
40 +EXPORT_SYMBOL(d_rehash_cond);
41 +
42 +void d_rehash(struct dentry * entry)
43 +{
44 +       d_rehash_cond(entry, 1);
45  }
46  
47  #define do_switch(x,y) do { \
48 --- linux-2.6.0-test1/include/linux/dcache.h~vfs_races_2.5.72_rev1      2003-09-13 16:21:05.000000000 +0400
49 +++ linux-2.6.0-test1-alexey/include/linux/dcache.h     2003-09-13 16:21:16.000000000 +0400
50 @@ -156,6 +156,8 @@ d_iput:             no              no              yes
51  
52  #define DCACHE_REFERENCED      0x0008  /* Recently used, don't discard. */
53  #define DCACHE_UNHASHED                0x0010  
54 +#define DCACHE_LUSTRE_INVALID     0x0020  /* Lustre invalidated */
55 +
56  
57  extern spinlock_t dcache_lock;
58  
59 @@ -254,6 +255,7 @@ extern int have_submounts(struct dentry 
60   * This adds the entry to the hash queues.
61   */
62  extern void d_rehash(struct dentry *);
63 +extern void d_rehash_cond(struct dentry *, int lock);
64  
65  /**
66   * d_add - add dentry to hash queues
67
68 _