1 Index: linux-2.6.11/fs/dcache.c
2 ===================================================================
3 --- linux-2.6.11.orig/fs/dcache.c 2005-04-13 22:44:37.698760922 -0400
4 +++ linux-2.6.11/fs/dcache.c 2005-04-13 22:44:50.482498026 -0400
6 spin_unlock(&dcache_lock);
9 -static void __d_rehash(struct dentry * entry, struct hlist_head *list)
10 +static void __d_rehash_internal(struct dentry * entry, struct hlist_head *list)
13 entry->d_flags &= ~DCACHE_UNHASHED;
14 @@ -1197,15 +1197,24 @@
15 * Adds a dentry to the hash according to its name.
18 -void d_rehash(struct dentry * entry)
19 +void __d_rehash(struct dentry * entry, int lock)
21 struct hlist_head *list = d_hash(entry->d_parent, entry->d_name.hash);
23 - spin_lock(&dcache_lock);
25 + spin_lock(&dcache_lock);
26 spin_lock(&entry->d_lock);
27 - __d_rehash(entry, list);
28 + __d_rehash_internal(entry, list);
29 spin_unlock(&entry->d_lock);
30 - spin_unlock(&dcache_lock);
32 + spin_unlock(&dcache_lock);
35 +EXPORT_SYMBOL(__d_rehash);
37 +void d_rehash(struct dentry * entry)
39 + __d_rehash(entry, 1);
42 #define do_switch(x,y) do { \
46 list = d_hash(target->d_parent, target->d_name.hash);
47 - __d_rehash(dentry, list);
48 + __d_rehash_internal(dentry, list);
50 /* Unhash the target: dput() will then get rid of it */
52 Index: linux-2.6.11/include/linux/dcache.h
53 ===================================================================
54 --- linux-2.6.11.orig/include/linux/dcache.h 2005-04-13 22:35:23.515178600 -0400
55 +++ linux-2.6.11/include/linux/dcache.h 2005-04-13 22:44:43.188221365 -0400
58 #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */
59 #define DCACHE_UNHASHED 0x0010
60 +#define DCACHE_LUSTRE_INVALID 0x0020 /* Lustre invalidated */
63 extern spinlock_t dcache_lock;