aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 939584648504..19458d399502 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -34,9 +34,8 @@
34#include <linux/swap.h> 34#include <linux/swap.h>
35#include <linux/bootmem.h> 35#include <linux/bootmem.h>
36 36
37/* #define DCACHE_DEBUG 1 */
38 37
39int sysctl_vfs_cache_pressure = 100; 38int sysctl_vfs_cache_pressure __read_mostly = 100;
40EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); 39EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
41 40
42 __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock); 41 __cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock);
@@ -44,7 +43,7 @@ static seqlock_t rename_lock __cacheline_aligned_in_smp = SEQLOCK_UNLOCKED;
44 43
45EXPORT_SYMBOL(dcache_lock); 44EXPORT_SYMBOL(dcache_lock);
46 45
47static kmem_cache_t *dentry_cache; 46static kmem_cache_t *dentry_cache __read_mostly;
48 47
49#define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname)) 48#define DNAME_INLINE_LEN (sizeof(struct dentry)-offsetof(struct dentry,d_iname))
50 49
@@ -59,9 +58,9 @@ static kmem_cache_t *dentry_cache;
59#define D_HASHBITS d_hash_shift 58#define D_HASHBITS d_hash_shift
60#define D_HASHMASK d_hash_mask 59#define D_HASHMASK d_hash_mask
61 60
62static unsigned int d_hash_mask; 61static unsigned int d_hash_mask __read_mostly;
63static unsigned int d_hash_shift; 62static unsigned int d_hash_shift __read_mostly;
64static struct hlist_head *dentry_hashtable; 63static struct hlist_head *dentry_hashtable __read_mostly;
65static LIST_HEAD(dentry_unused); 64static LIST_HEAD(dentry_unused);
66 65
67/* Statistics gathering. */ 66/* Statistics gathering. */
@@ -603,10 +602,6 @@ resume:
603 */ 602 */
604 if (!list_empty(&dentry->d_subdirs)) { 603 if (!list_empty(&dentry->d_subdirs)) {
605 this_parent = dentry; 604 this_parent = dentry;
606#ifdef DCACHE_DEBUG
607printk(KERN_DEBUG "select_parent: descending to %s/%s, found=%d\n",
608dentry->d_parent->d_name.name, dentry->d_name.name, found);
609#endif
610 goto repeat; 605 goto repeat;
611 } 606 }
612 } 607 }
@@ -616,10 +611,6 @@ dentry->d_parent->d_name.name, dentry->d_name.name, found);
616 if (this_parent != parent) { 611 if (this_parent != parent) {
617 next = this_parent->d_u.d_child.next; 612 next = this_parent->d_u.d_child.next;
618 this_parent = this_parent->d_parent; 613 this_parent = this_parent->d_parent;
619#ifdef DCACHE_DEBUG
620printk(KERN_DEBUG "select_parent: ascending to %s/%s, found=%d\n",
621this_parent->d_parent->d_name.name, this_parent->d_name.name, found);
622#endif
623 goto resume; 614 goto resume;
624 } 615 }
625out: 616out:
@@ -798,7 +789,7 @@ struct dentry *d_alloc_name(struct dentry *parent, const char *name)
798 789
799void d_instantiate(struct dentry *entry, struct inode * inode) 790void d_instantiate(struct dentry *entry, struct inode * inode)
800{ 791{
801 if (!list_empty(&entry->d_alias)) BUG(); 792 BUG_ON(!list_empty(&entry->d_alias));
802 spin_lock(&dcache_lock); 793 spin_lock(&dcache_lock);
803 if (inode) 794 if (inode)
804 list_add(&entry->d_alias, &inode->i_dentry); 795 list_add(&entry->d_alias, &inode->i_dentry);
@@ -1719,10 +1710,10 @@ static void __init dcache_init(unsigned long mempages)
1719} 1710}
1720 1711
1721/* SLAB cache for __getname() consumers */ 1712/* SLAB cache for __getname() consumers */
1722kmem_cache_t *names_cachep; 1713kmem_cache_t *names_cachep __read_mostly;
1723 1714
1724/* SLAB cache for file structures */ 1715/* SLAB cache for file structures */
1725kmem_cache_t *filp_cachep; 1716kmem_cache_t *filp_cachep __read_mostly;
1726 1717
1727EXPORT_SYMBOL(d_genocide); 1718EXPORT_SYMBOL(d_genocide);
1728 1719