diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:38 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:23 -0500 |
commit | b5c84bf6f6fa3a7dfdcb556023a62953574b60ee (patch) | |
tree | 7a2c299a180713e21d5cb653cb933121adf53c31 /include/linux | |
parent | 949854d02455080d20cd3e1db28a3a18daf7599d (diff) |
fs: dcache remove dcache_lock
dcache_lock no longer protects anything. remove it.
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/dcache.h | 5 | ||||
-rw-r--r-- | include/linux/fs.h | 6 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 2 | ||||
-rw-r--r-- | include/linux/fsnotify_backend.h | 11 | ||||
-rw-r--r-- | include/linux/namei.h | 1 |
5 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index c963ebada922..a2ceb94b0e38 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -183,7 +183,6 @@ struct dentry_operations { | |||
183 | #define DCACHE_GENOCIDE 0x0200 | 183 | #define DCACHE_GENOCIDE 0x0200 |
184 | 184 | ||
185 | extern spinlock_t dcache_inode_lock; | 185 | extern spinlock_t dcache_inode_lock; |
186 | extern spinlock_t dcache_lock; | ||
187 | extern seqlock_t rename_lock; | 186 | extern seqlock_t rename_lock; |
188 | 187 | ||
189 | static inline int dname_external(struct dentry *dentry) | 188 | static inline int dname_external(struct dentry *dentry) |
@@ -296,8 +295,8 @@ extern char *dentry_path(struct dentry *, char *, int); | |||
296 | * destroyed when it has references. dget() should never be | 295 | * destroyed when it has references. dget() should never be |
297 | * called for dentries with zero reference counter. For these cases | 296 | * called for dentries with zero reference counter. For these cases |
298 | * (preferably none, functions in dcache.c are sufficient for normal | 297 | * (preferably none, functions in dcache.c are sufficient for normal |
299 | * needs and they take necessary precautions) you should hold dcache_lock | 298 | * needs and they take necessary precautions) you should hold d_lock |
300 | * and call dget_locked() instead of dget(). | 299 | * and call dget_dlock() instead of dget(). |
301 | */ | 300 | */ |
302 | static inline struct dentry *dget_dlock(struct dentry *dentry) | 301 | static inline struct dentry *dget_dlock(struct dentry *dentry) |
303 | { | 302 | { |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 090f0eacde29..296cf2fde945 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1378,7 +1378,7 @@ struct super_block { | |||
1378 | #else | 1378 | #else |
1379 | struct list_head s_files; | 1379 | struct list_head s_files; |
1380 | #endif | 1380 | #endif |
1381 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1381 | /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */ |
1382 | struct list_head s_dentry_lru; /* unused dentry lru */ | 1382 | struct list_head s_dentry_lru; /* unused dentry lru */ |
1383 | int s_nr_dentry_unused; /* # of dentry on lru */ | 1383 | int s_nr_dentry_unused; /* # of dentry on lru */ |
1384 | 1384 | ||
@@ -2446,6 +2446,10 @@ static inline ino_t parent_ino(struct dentry *dentry) | |||
2446 | { | 2446 | { |
2447 | ino_t res; | 2447 | ino_t res; |
2448 | 2448 | ||
2449 | /* | ||
2450 | * Don't strictly need d_lock here? If the parent ino could change | ||
2451 | * then surely we'd have a deeper race in the caller? | ||
2452 | */ | ||
2449 | spin_lock(&dentry->d_lock); | 2453 | spin_lock(&dentry->d_lock); |
2450 | res = dentry->d_parent->d_inode->i_ino; | 2454 | res = dentry->d_parent->d_inode->i_ino; |
2451 | spin_unlock(&dentry->d_lock); | 2455 | spin_unlock(&dentry->d_lock); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index b10bcdeaef76..2a53f10712b3 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -17,7 +17,6 @@ | |||
17 | 17 | ||
18 | /* | 18 | /* |
19 | * fsnotify_d_instantiate - instantiate a dentry for inode | 19 | * fsnotify_d_instantiate - instantiate a dentry for inode |
20 | * Called with dcache_lock held. | ||
21 | */ | 20 | */ |
22 | static inline void fsnotify_d_instantiate(struct dentry *dentry, | 21 | static inline void fsnotify_d_instantiate(struct dentry *dentry, |
23 | struct inode *inode) | 22 | struct inode *inode) |
@@ -62,7 +61,6 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
62 | 61 | ||
63 | /* | 62 | /* |
64 | * fsnotify_d_move - dentry has been moved | 63 | * fsnotify_d_move - dentry has been moved |
65 | * Called with dcache_lock and dentry->d_lock held. | ||
66 | */ | 64 | */ |
67 | static inline void fsnotify_d_move(struct dentry *dentry) | 65 | static inline void fsnotify_d_move(struct dentry *dentry) |
68 | { | 66 | { |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 7380763595d3..69ad89b50489 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -329,9 +329,15 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
329 | { | 329 | { |
330 | struct dentry *parent; | 330 | struct dentry *parent; |
331 | 331 | ||
332 | assert_spin_locked(&dcache_lock); | ||
333 | assert_spin_locked(&dentry->d_lock); | 332 | assert_spin_locked(&dentry->d_lock); |
334 | 333 | ||
334 | /* | ||
335 | * Serialisation of setting PARENT_WATCHED on the dentries is provided | ||
336 | * by d_lock. If inotify_inode_watched changes after we have taken | ||
337 | * d_lock, the following __fsnotify_update_child_dentry_flags call will | ||
338 | * find our entry, so it will spin until we complete here, and update | ||
339 | * us with the new state. | ||
340 | */ | ||
335 | parent = dentry->d_parent; | 341 | parent = dentry->d_parent; |
336 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) | 342 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) |
337 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; | 343 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; |
@@ -341,15 +347,12 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
341 | 347 | ||
342 | /* | 348 | /* |
343 | * fsnotify_d_instantiate - instantiate a dentry for inode | 349 | * fsnotify_d_instantiate - instantiate a dentry for inode |
344 | * Called with dcache_lock held. | ||
345 | */ | 350 | */ |
346 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) | 351 | static inline void __fsnotify_d_instantiate(struct dentry *dentry, struct inode *inode) |
347 | { | 352 | { |
348 | if (!inode) | 353 | if (!inode) |
349 | return; | 354 | return; |
350 | 355 | ||
351 | assert_spin_locked(&dcache_lock); | ||
352 | |||
353 | spin_lock(&dentry->d_lock); | 356 | spin_lock(&dentry->d_lock); |
354 | __fsnotify_update_dcache_flags(dentry); | 357 | __fsnotify_update_dcache_flags(dentry); |
355 | spin_unlock(&dentry->d_lock); | 358 | spin_unlock(&dentry->d_lock); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 05b441d93642..aec730b53935 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -41,7 +41,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
41 | * - require a directory | 41 | * - require a directory |
42 | * - ending slashes ok even for nonexistent files | 42 | * - ending slashes ok even for nonexistent files |
43 | * - internal "there are more path components" flag | 43 | * - internal "there are more path components" flag |
44 | * - locked when lookup done with dcache_lock held | ||
45 | * - dentry cache is untrusted; force a real lookup | 44 | * - dentry cache is untrusted; force a real lookup |
46 | */ | 45 | */ |
47 | #define LOOKUP_FOLLOW 1 | 46 | #define LOOKUP_FOLLOW 1 |