X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=fs%2Fdcache.c;h=1b4a3a34ec57f20d605386c129c9ebf315dd1765;hb=4a13b0b35ff4c6cf122ee708355ff4ddcaedeb0e;hp=313b54b2b8f2cb0f074fd122f7b929f67b60cee8;hpb=c0897856553d45aee1780bed455b7c2e888dd64b;p=linux-2.6-omap-h63xx.git diff --git a/fs/dcache.c b/fs/dcache.c index 313b54b2b8f..1b4a3a34ec5 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -14,7 +14,6 @@ * the dcache entry is deleted or garbage collected. */ -#include #include #include #include @@ -39,7 +38,7 @@ int sysctl_vfs_cache_pressure __read_mostly = 100; EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock); -static seqlock_t rename_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED; +static __cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock); EXPORT_SYMBOL(dcache_lock); @@ -406,7 +405,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 +521,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 +636,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++; } @@ -1341,10 +1339,10 @@ void d_move(struct dentry * dentry, struct dentry * target) */ if (target < dentry) { spin_lock(&target->d_lock); - spin_lock(&dentry->d_lock); + spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); } else { spin_lock(&dentry->d_lock); - spin_lock(&target->d_lock); + spin_lock_nested(&target->d_lock, DENTRY_D_LOCK_NESTED); } /* Move the dentry to the target hash queue, if on different bucket */