1 fs/dcache.c | 24 ++++++++++++++++++++----
2 include/linux/dcache.h | 2 ++
3 2 files changed, 22 insertions(+), 4 deletions(-)
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);
12 + /* network invalidation by Lustre */
13 + if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
14 + spin_unlock(&dcache_lock);
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.
25 -void d_rehash(struct dentry * entry)
26 +void d_rehash_cond(struct dentry * entry, int lock)
28 struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
29 - spin_lock(&dcache_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);
37 + spin_unlock(&dcache_lock);
40 +EXPORT_SYMBOL(d_rehash_cond);
42 +void d_rehash(struct dentry * entry)
44 + d_rehash_cond(entry, 1);
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
52 #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
53 #define DCACHE_UNHASHED 0x0010
54 +#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */
57 extern spinlock_t dcache_lock;
59 @@ -254,6 +255,7 @@ extern int have_submounts(struct dentry
60 * This adds the entry to the hash queues.
62 extern void d_rehash(struct dentry *);
63 +extern void d_rehash_cond(struct dentry *, int lock);
66 * d_add - add dentry to hash queues