aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2010-01-29 18:38:25 -0500
committerThomas Gleixner <tglx@linutronix.de>2010-04-27 11:32:38 -0400
commitb5acee084dabd0916f73c65a42fd25e94bc3cd21 (patch)
treecd9ff8cb124705fd6829f018e28bec79376421b4 /include
parentec3bfd045ef0c1490683389cb46ac131e9c79712 (diff)
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')
-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
186 186
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;
190extern seqlock_t rename_lock; 189extern seqlock_t rename_lock;
191 190
192/** 191/**
@@ -303,23 +302,17 @@ extern char *dentry_path(struct dentry *, char *, int);
303/* Allocation counts.. */ 302/* Allocation counts.. */
304 303
305/** 304/**
306 * dget, dget_locked - get a reference to a dentry 305 * dget, dget_dlock - get a reference to a dentry
307 * @dentry: dentry to get a reference to 306 * @dentry: dentry to get a reference to
308 * 307 *
309 * Given a dentry or %NULL pointer increment the reference count 308 * Given a dentry or %NULL pointer increment the reference count
310 * if appropriate and return the dentry. A dentry will not be 309 * if appropriate and return the dentry. A dentry will not be
311 * destroyed when it has references. dget() should never be 310 * destroyed when it has references.
312 * called for dentries with zero reference counter. For these cases
313 * (preferably none, functions in dcache.c are sufficient for normal
314 * needs and they take necessary precautions) you should hold dcache_lock
315 * and call dget_locked() instead of dget().
316 */ 311 */
317static inline struct dentry *dget_dlock(struct dentry *dentry) 312static inline struct dentry *dget_dlock(struct dentry *dentry)
318{ 313{
319 if (dentry) { 314 if (dentry)
320 BUG_ON(!dentry->d_count);
321 dentry->d_count++; 315 dentry->d_count++;
322 }
323 return dentry; 316 return dentry;
324} 317}
325 318
@@ -333,9 +326,6 @@ static inline struct dentry *dget(struct dentry *dentry)
333 return dentry; 326 return dentry;
334} 327}
335 328
336extern struct dentry * dget_locked(struct dentry *);
337extern struct dentry * dget_locked_dlock(struct dentry *);
338
339extern struct dentry *dget_parent(struct dentry *dentry); 329extern struct dentry *dget_parent(struct dentry *dentry);
340 330
341/** 331/**