Whamcloud - gitweb
Branch HEAD
[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,7 +212,14 @@ int d_invalidate(struct dentry * dentry)
8                 spin_unlock(&dcache_lock);
9                 return 0;
10         }
11 -       /*
12 +
13 +        /* network invalidation by Lustre */
14 +       if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
15 +               spin_unlock(&dcache_lock);
16 +               return 0;
17 +       }
18 +
19 +        /*
20          * Check whether to do a partial shrink_dcache
21          * to get rid of unused child entries.
22          */
23 @@ -1135,14 +1142,23 @@ void d_delete(struct dentry * dentry)
24   * Adds a dentry to the hash according to its name.
25   */
26   
27 -void d_rehash(struct dentry * entry)
28 +void __d_rehash(struct dentry * entry, int lock)
29  {
30         struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
31 -       spin_lock(&dcache_lock);
32 +       if (lock)
33 +               spin_lock(&dcache_lock);
34         entry->d_vfs_flags &= ~DCACHE_UNHASHED;
35         entry->d_bucket = list;
36         hlist_add_head_rcu(&entry->d_hash, list);
37 -       spin_unlock(&dcache_lock);
38 +       if (lock)
39 +               spin_unlock(&dcache_lock);
40 +}
41 +
42 +EXPORT_SYMBOL(__d_rehash);
43 +
44 +void d_rehash(struct dentry * entry)
45 +{
46 +       __d_rehash(entry, 1);
47  }
48  
49  #define do_switch(x,y) do { \
50 --- linux-2.6.0-test1/include/linux/dcache.h~vfs_races_2.5.72_rev1      2003-09-13 16:21:05.000000000 +0400
51 +++ linux-2.6.0-test1-alexey/include/linux/dcache.h     2003-09-13 16:21:16.000000000 +0400
52 @@ -156,6 +156,8 @@ d_iput:             no              no              yes
53  
54  #define DCACHE_REFERENCED      0x0008  /* Recently used, don't discard. */
55  #define DCACHE_UNHASHED                0x0010  
56 +#define DCACHE_LUSTRE_INVALID     0x0020  /* Lustre invalidated */
57 +
58  
59  extern spinlock_t dcache_lock;
60  
61
62 _