ocfs2: special case recovery lock in dlmlock_remote()
[cascardo/linux.git] / fs / dcache.c
index 313b54b..48b44a7 100644 (file)
@@ -406,7 +406,7 @@ static void prune_dcache(int count, struct super_block *sb)
                cond_resched_lock(&dcache_lock);
 
                tmp = dentry_unused.prev;
-               if (unlikely(sb)) {
+               if (sb) {
                        /* Try to find a dentry for this sb, but don't try
                         * too hard, if they aren't near the tail they will
                         * be moved down again soon
@@ -522,8 +522,7 @@ void shrink_dcache_sb(struct super_block * sb)
                dentry = list_entry(tmp, struct dentry, d_lru);
                if (dentry->d_sb != sb)
                        continue;
-               list_del(tmp);
-               list_add(tmp, &dentry_unused);
+               list_move(tmp, &dentry_unused);
        }
 
        /*
@@ -638,7 +637,7 @@ resume:
                 * of the unused list for prune_dcache
                 */
                if (!atomic_read(&dentry->d_count)) {
-                       list_add(&dentry->d_lru, dentry_unused.prev);
+                       list_add_tail(&dentry->d_lru, &dentry_unused);
                        dentry_stat.nr_unused++;
                        found++;
                }