summaryrefslogtreecommitdiff
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 15:38:25 -0800
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 17:32:38 +0200
commitb5acee084dabd0916f73c65a42fd25e94bc3cd21 (patch)
treecd9ff8cb124705fd6829f018e28bec79376421b4 /include/linux/dcache.h
parentec3bfd045ef0c1490683389cb46ac131e9c79712 (diff)
downloadlwn-b5acee084dabd0916f73c65a42fd25e94bc3cd21.tar.gz
lwn-b5acee084dabd0916f73c65a42fd25e94bc3cd21.zip
dcache-split-inode_lock
dcache_inode_lock can be replaced with per-inode locking. Use existing inode->i_lock for this. This is slightly non-trivial because we sometimes need to find the inode from the dentry, which requires d_inode to be stabilised (either with refcount or d_lock). 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/dcache.h')
-rw-r--r--include/linux/dcache.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index e3bec299113a..1ca2e7fb7a86 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -186,7 +186,6 @@ d_iput: no no yes
#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */
-extern spinlock_t dcache_inode_lock;
extern seqlock_t rename_lock;
/**
@@ -303,23 +302,17 @@ extern char *dentry_path(struct dentry *, char *, int);
/* Allocation counts.. */
/**
- * dget, dget_locked - get a reference to a dentry
+ * dget, dget_dlock - get a reference to a dentry
* @dentry: dentry to get a reference to
*
* Given a dentry or %NULL pointer increment the reference count
* if appropriate and return the dentry. A dentry will not be
- * destroyed when it has references. dget() should never be
- * called for dentries with zero reference counter. For these cases
- * (preferably none, functions in dcache.c are sufficient for normal
- * needs and they take necessary precautions) you should hold dcache_lock
- * and call dget_locked() instead of dget().
+ * destroyed when it has references.
*/
static inline struct dentry *dget_dlock(struct dentry *dentry)
{
- if (dentry) {
- BUG_ON(!dentry->d_count);
+ if (dentry)
dentry->d_count++;
- }
return dentry;
}
@@ -333,9 +326,6 @@ static inline struct dentry *dget(struct dentry *dentry)
return dentry;
}
-extern struct dentry * dget_locked(struct dentry *);
-extern struct dentry * dget_locked_dlock(struct dentry *);
-
extern struct dentry *dget_parent(struct dentry *dentry);
/**