1 Index: linux-2.6.7-vanilla/fs/dcache.c
2 ===================================================================
3 --- linux-2.6.7-vanilla.orig/fs/dcache.c 2004-07-01 12:09:19.000000000 +0300
4 +++ linux-2.6.7-vanilla/fs/dcache.c 2004-07-01 12:29:12.510193264 +0300
6 spin_unlock(&dcache_lock);
11 + /* network invalidation by Lustre */
12 + if (dentry->d_flags & DCACHE_LUSTRE_INVALID) {
13 + spin_unlock(&dcache_lock);
18 * Check whether to do a partial shrink_dcache
19 * to get rid of unused child entries.
21 @@ -1114,19 +1121,28 @@
22 * Adds a dentry to the hash according to its name.
25 -void d_rehash(struct dentry * entry)
26 +void __d_rehash(struct dentry * entry, int lock)
28 struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
30 - spin_lock(&dcache_lock);
32 + spin_lock(&dcache_lock);
33 spin_lock(&entry->d_lock);
34 entry->d_flags &= ~DCACHE_UNHASHED;
35 spin_unlock(&entry->d_lock);
36 entry->d_bucket = list;
37 hlist_add_head_rcu(&entry->d_hash, list);
38 - spin_unlock(&dcache_lock);
40 + spin_unlock(&dcache_lock);
43 +EXPORT_SYMBOL(__d_rehash);
45 +void d_rehash(struct dentry * entry)
47 + __d_rehash(entry, 1);
50 #define do_switch(x,y) do { \
51 __typeof__ (x) __tmp = x; \
52 x = y; y = __tmp; } while (0)
53 Index: linux-2.6.7-vanilla/include/linux/dcache.h
54 ===================================================================
55 --- linux-2.6.7-vanilla.orig/include/linux/dcache.h 2004-07-01 12:24:53.602553208 +0300
56 +++ linux-2.6.7-vanilla/include/linux/dcache.h 2004-07-01 12:27:29.757814000 +0300
59 #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
60 #define DCACHE_UNHASHED 0x0010
61 +#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */
64 extern spinlock_t dcache_lock;