aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index a15a2e1f5520..7376b61269fb 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -337,12 +337,10 @@ struct dentry * d_find_alias(struct inode *inode)
337 */ 337 */
338void d_prune_aliases(struct inode *inode) 338void d_prune_aliases(struct inode *inode)
339{ 339{
340 struct list_head *tmp, *head = &inode->i_dentry; 340 struct dentry *dentry;
341restart: 341restart:
342 spin_lock(&dcache_lock); 342 spin_lock(&dcache_lock);
343 tmp = head; 343 list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
344 while ((tmp = tmp->next) != head) {
345 struct dentry *dentry = list_entry(tmp, struct dentry, d_alias);
346 spin_lock(&dentry->d_lock); 344 spin_lock(&dentry->d_lock);
347 if (!atomic_read(&dentry->d_count)) { 345 if (!atomic_read(&dentry->d_count)) {
348 __dget_locked(dentry); 346 __dget_locked(dentry);
@@ -463,10 +461,7 @@ void shrink_dcache_sb(struct super_block * sb)
463 * superblock to the most recent end of the unused list. 461 * superblock to the most recent end of the unused list.
464 */ 462 */
465 spin_lock(&dcache_lock); 463 spin_lock(&dcache_lock);
466 next = dentry_unused.next; 464 list_for_each_safe(tmp, next, &dentry_unused) {
467 while (next != &dentry_unused) {
468 tmp = next;
469 next = tmp->next;
470 dentry = list_entry(tmp, struct dentry, d_lru); 465 dentry = list_entry(tmp, struct dentry, d_lru);
471 if (dentry->d_sb != sb) 466 if (dentry->d_sb != sb)
472 continue; 467 continue;
@@ -478,10 +473,7 @@ void shrink_dcache_sb(struct super_block * sb)
478 * Pass two ... free the dentries for this superblock. 473 * Pass two ... free the dentries for this superblock.
479 */ 474 */
480repeat: 475repeat:
481 next = dentry_unused.next; 476 list_for_each_safe(tmp, next, &dentry_unused) {
482 while (next != &dentry_unused) {
483 tmp = next;
484 next = tmp->next;
485 dentry = list_entry(tmp, struct dentry, d_lru); 477 dentry = list_entry(tmp, struct dentry, d_lru);
486 if (dentry->d_sb != sb) 478 if (dentry->d_sb != sb)
487 continue; 479 continue;