aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 18:38:24 -0500
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 11:32:37 -0400
commitebfa7fa2c03891bd25a07fefc7218c273071a659 (patch)
treecb470c3622fc94ec26d2ab273e855d2c096bb550 /include/linux
parent68d0cacc5da18248a173c2fd83f8870f6a242729 (diff)
dcache-chain-hashlock
We can turn the dcache hash locking from a global dcache_hash_lock into per-bucket locking. XXX: should probably use a bit lock in the first bit of the hash pointers to avoid any space bloating (non-atomic unlock means no extra atomics either) Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: John Stultz <johnstul@us.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/dcache.h20
1 files changed, 2 insertions, 18 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 14e4728dd31b..e3bec299113a 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -187,7 +187,6 @@ d_iput: no no yes
187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ 187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */
188 188
189extern spinlock_t dcache_inode_lock; 189extern spinlock_t dcache_inode_lock;
190extern spinlock_t dcache_hash_lock;
191extern seqlock_t rename_lock; 190extern seqlock_t rename_lock;
192 191
193/** 192/**
@@ -205,23 +204,8 @@ extern seqlock_t rename_lock;
205 * 204 *
206 * __d_drop requires dentry->d_lock. 205 * __d_drop requires dentry->d_lock.
207 */ 206 */
208 207void d_drop(struct dentry *dentry);
209static inline void __d_drop(struct dentry *dentry) 208void __d_drop(struct dentry *dentry);
210{
211 if (!(dentry->d_flags & DCACHE_UNHASHED)) {
212 dentry->d_flags |= DCACHE_UNHASHED;
213 spin_lock(&dcache_hash_lock);
214 hlist_del_rcu(&dentry->d_hash);
215 spin_unlock(&dcache_hash_lock);
216 }
217}
218
219static inline void d_drop(struct dentry *dentry)
220{
221 spin_lock(&dentry->d_lock);
222 __d_drop(dentry);
223 spin_unlock(&dentry->d_lock);
224}
225 209
226static inline int dname_external(struct dentry *dentry) 210static inline int dname_external(struct dentry *dentry)
227{ 211{