diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:43 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:24 -0500 |
commit | dc0474be3e27463d4d4a2793f82366eed906f223 (patch) | |
tree | 41f75e638442cb343bacdcfbabb17ffc3bd5b4ce /include/linux/dcache.h | |
parent | 357f8e658bba8a085c4a5d4331e30894be8096b8 (diff) |
fs: dcache rationalise dget variants
dget_locked was a shortcut to avoid the lazy lru manipulation when we already
held dcache_lock (lru manipulation was relatively cheap at that point).
However, how that the lru lock is an innermost one, we never hold it at any
caller, so the lock cost can now be avoided. We already have well working lazy
dcache LRU, so it should be fine to defer LRU manipulations to scan time.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r-- | include/linux/dcache.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index a2ceb94b0e38..ca648685f0cc 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -287,23 +287,17 @@ extern char *dentry_path(struct dentry *, char *, int); | |||
287 | /* Allocation counts.. */ | 287 | /* Allocation counts.. */ |
288 | 288 | ||
289 | /** | 289 | /** |
290 | * dget, dget_locked - get a reference to a dentry | 290 | * dget, dget_dlock - get a reference to a dentry |
291 | * @dentry: dentry to get a reference to | 291 | * @dentry: dentry to get a reference to |
292 | * | 292 | * |
293 | * Given a dentry or %NULL pointer increment the reference count | 293 | * Given a dentry or %NULL pointer increment the reference count |
294 | * if appropriate and return the dentry. A dentry will not be | 294 | * if appropriate and return the dentry. A dentry will not be |
295 | * destroyed when it has references. dget() should never be | 295 | * destroyed when it has references. |
296 | * called for dentries with zero reference counter. For these cases | ||
297 | * (preferably none, functions in dcache.c are sufficient for normal | ||
298 | * needs and they take necessary precautions) you should hold d_lock | ||
299 | * and call dget_dlock() instead of dget(). | ||
300 | */ | 296 | */ |
301 | static inline struct dentry *dget_dlock(struct dentry *dentry) | 297 | static inline struct dentry *dget_dlock(struct dentry *dentry) |
302 | { | 298 | { |
303 | if (dentry) { | 299 | if (dentry) |
304 | BUG_ON(!dentry->d_count); | ||
305 | dentry->d_count++; | 300 | dentry->d_count++; |
306 | } | ||
307 | return dentry; | 301 | return dentry; |
308 | } | 302 | } |
309 | 303 | ||
@@ -317,9 +311,6 @@ static inline struct dentry *dget(struct dentry *dentry) | |||
317 | return dentry; | 311 | return dentry; |
318 | } | 312 | } |
319 | 313 | ||
320 | extern struct dentry * dget_locked(struct dentry *); | ||
321 | extern struct dentry * dget_locked_dlock(struct dentry *); | ||
322 | |||
323 | extern struct dentry *dget_parent(struct dentry *dentry); | 314 | extern struct dentry *dget_parent(struct dentry *dentry); |
324 | 315 | ||
325 | /** | 316 | /** |