diff options
author | Nick Piggin <npiggin@suse.de> | 2010-01-29 15:38:23 -0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-04-27 17:32:35 +0200 |
commit | 6465e96519c08e46bd8e366ad5e7039fa9a035bb (patch) | |
tree | 0f25c38d5e264976180be92ef1d189255e57d3aa /include | |
parent | a9865fc4ed12399c21bc7393d8f12431c563d18d (diff) | |
download | lwn-6465e96519c08e46bd8e366ad5e7039fa9a035bb.tar.gz lwn-6465e96519c08e46bd8e366ad5e7039fa9a035bb.zip |
fs-dcache_lock-remove
dcache_lock no longer protects anything (I hope). remove it.
This breaks a lot of the tree where I haven't thought about the problem,
but it simplifies the dcache.c code quite a bit (and it's also probably
a good thing to break unconverted code). So I include this here before
making further changes to the locking.
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')
-rw-r--r-- | include/linux/dcache.h | 17 | ||||
-rw-r--r-- | include/linux/fs.h | 4 | ||||
-rw-r--r-- | include/linux/fsnotify_backend.h | 5 |
3 files changed, 12 insertions, 14 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 0bd92fdeb153..14e4728dd31b 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -150,13 +150,13 @@ struct dentry_operations { /* locking rules: - big lock dcache_lock d_lock may block -d_revalidate: no no no yes -d_hash no no no yes -d_compare: no yes yes no -d_delete: no yes no no -d_release: no no no yes -d_iput: no no no yes + big lock d_lock may block +d_revalidate: no no yes +d_hash no no yes +d_compare: no yes no +d_delete: no no no +d_release: no no yes +d_iput: no no yes */ /* d_flags entries */ @@ -188,7 +188,6 @@ d_iput: no no no yes extern spinlock_t dcache_inode_lock; extern spinlock_t dcache_hash_lock; -extern spinlock_t dcache_lock; extern seqlock_t rename_lock; /** @@ -219,11 +218,9 @@ static inline void __d_drop(struct dentry *dentry) static inline void d_drop(struct dentry *dentry) { - spin_lock(&dcache_lock); spin_lock(&dentry->d_lock); __d_drop(dentry); spin_unlock(&dentry->d_lock); - spin_unlock(&dcache_lock); } static inline int dname_external(struct dentry *dentry) diff --git a/include/linux/fs.h b/include/linux/fs.h index 66f47653d23f..2c3dede519f1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2395,6 +2395,10 @@ static inline ino_t parent_ino(struct dentry *dentry) { ino_t res; + /* + * Don't strictly need d_lock here? If the parent ino could change + * then surely we'd have a deeper race in the caller? + */ spin_lock(&dentry->d_lock); res = dentry->d_parent->d_inode->i_ino; spin_unlock(&dentry->d_lock); diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 4d6f47b51189..a6db0585cf04 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h @@ -276,10 +276,10 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) { struct dentry *parent; - assert_spin_locked(&dcache_lock); assert_spin_locked(&dentry->d_lock); parent = dentry->d_parent; + /* XXX: after dcache_lock removal, there is a race with parent->d_inode and fsnotify_inode_watches_children. must fix */ if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; else @@ -288,15 +288,12 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) /* * fsnotify_d_instantiate - instantiate a dentry for inode - * Called with dcache_lock held. */ static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) { if (!inode) return; - assert_spin_locked(&dcache_lock); - spin_lock(&dentry->d_lock); __fsnotify_update_dcache_flags(dentry); spin_unlock(&dentry->d_lock); |