1 diff -urp RH_2_6_9_42_0_3.orig/fs/dcache.c RH_2_6_9_42_0_3/fs/dcache.c
2 --- RH_2_6_9_42_0_3.orig/fs/dcache.c
3 +++ RH_2_6_9_42_0_3/fs/dcache.c
4 @@ -229,7 +229,14 @@ int d_invalidate(struct dentry * dentry)
5 spin_unlock(&dcache_lock);
10 + /* network invalidation by Lustre */
11 + if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
12 + spin_unlock(&dcache_lock);
17 * Check whether to do a partial shrink_dcache
18 * to get rid of unused child entries.
20 @@ -1187,19 +1194,28 @@ void d_delete(struct dentry * dentry)
21 * Adds a dentry to the hash according to its name.
24 -void d_rehash(struct dentry * entry)
25 +void d_rehash_cond(struct dentry * entry, int lock)
27 struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
29 - spin_lock(&dcache_lock);
31 + spin_lock(&dcache_lock);
32 spin_lock(&entry->d_lock);
33 entry->d_flags &= ~DCACHE_UNHASHED;
34 spin_unlock(&entry->d_lock);
35 entry->d_bucket = list;
36 hlist_add_head_rcu(&entry->d_hash, list);
37 - spin_unlock(&dcache_lock);
39 + spin_unlock(&dcache_lock);
42 +EXPORT_SYMBOL(d_rehash_cond);
44 +void d_rehash(struct dentry * entry)
46 + d_rehash_cond(entry, 1);
49 #define do_switch(x,y) do { \
50 __typeof__ (x) __tmp = x; \
51 x = y; y = __tmp; } while (0)
52 diff -urp RH_2_6_9_42_0_3.orig/include/linux/dcache.h RH_2_6_9_42_0_3/include/linux/dcache.h
53 --- RH_2_6_9_42_0_3.orig/include/linux/dcache.h
54 +++ RH_2_6_9_42_0_3/include/linux/dcache.h
55 @@ -157,6 +157,8 @@ d_iput: no no no yes
57 #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
58 #define DCACHE_UNHASHED 0x0010
59 +#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */
62 extern spinlock_t dcache_lock;