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, 10 insertions, 15 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index a1d86c7f3e66..e88c23b85a32 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -34,7 +34,6 @@
34#include <linux/bootmem.h> 34#include <linux/bootmem.h>
35#include "internal.h" 35#include "internal.h"
36 36
37
38int sysctl_vfs_cache_pressure __read_mostly = 100; 37int sysctl_vfs_cache_pressure __read_mostly = 100;
39EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure); 38EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
40 39
@@ -948,9 +947,6 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
948 dentry->d_op = NULL; 947 dentry->d_op = NULL;
949 dentry->d_fsdata = NULL; 948 dentry->d_fsdata = NULL;
950 dentry->d_mounted = 0; 949 dentry->d_mounted = 0;
951#ifdef CONFIG_PROFILING
952 dentry->d_cookie = NULL;
953#endif
954 INIT_HLIST_NODE(&dentry->d_hash); 950 INIT_HLIST_NODE(&dentry->d_hash);
955 INIT_LIST_HEAD(&dentry->d_lru); 951 INIT_LIST_HEAD(&dentry->d_lru);
956 INIT_LIST_HEAD(&dentry->d_subdirs); 952 INIT_LIST_HEAD(&dentry->d_subdirs);
@@ -1336,7 +1332,7 @@ err_out:
1336 * 1332 *
1337 * Searches the children of the parent dentry for the name in question. If 1333 * Searches the children of the parent dentry for the name in question. If
1338 * the dentry is found its reference count is incremented and the dentry 1334 * the dentry is found its reference count is incremented and the dentry
1339 * is returned. The caller must use d_put to free the entry when it has 1335 * is returned. The caller must use dput to free the entry when it has
1340 * finished using it. %NULL is returned on failure. 1336 * finished using it. %NULL is returned on failure.
1341 * 1337 *
1342 * __d_lookup is dcache_lock free. The hash list is protected using RCU. 1338 * __d_lookup is dcache_lock free. The hash list is protected using RCU.
@@ -1620,8 +1616,11 @@ static void switch_names(struct dentry *dentry, struct dentry *target)
1620 */ 1616 */
1621 memcpy(dentry->d_iname, target->d_name.name, 1617 memcpy(dentry->d_iname, target->d_name.name,
1622 target->d_name.len + 1); 1618 target->d_name.len + 1);
1619 dentry->d_name.len = target->d_name.len;
1620 return;
1623 } 1621 }
1624 } 1622 }
1623 do_switch(dentry->d_name.len, target->d_name.len);
1625} 1624}
1626 1625
1627/* 1626/*
@@ -1681,7 +1680,6 @@ already_unhashed:
1681 1680
1682 /* Switch the names.. */ 1681 /* Switch the names.. */
1683 switch_names(dentry, target); 1682 switch_names(dentry, target);
1684 do_switch(dentry->d_name.len, target->d_name.len);
1685 do_switch(dentry->d_name.hash, target->d_name.hash); 1683 do_switch(dentry->d_name.hash, target->d_name.hash);
1686 1684
1687 /* ... and switch the parents */ 1685 /* ... and switch the parents */
@@ -1791,7 +1789,6 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
1791 struct dentry *dparent, *aparent; 1789 struct dentry *dparent, *aparent;
1792 1790
1793 switch_names(dentry, anon); 1791 switch_names(dentry, anon);
1794 do_switch(dentry->d_name.len, anon->d_name.len);
1795 do_switch(dentry->d_name.hash, anon->d_name.hash); 1792 do_switch(dentry->d_name.hash, anon->d_name.hash);
1796 1793
1797 dparent = dentry->d_parent; 1794 dparent = dentry->d_parent;
@@ -1911,7 +1908,8 @@ static int prepend_name(char **buffer, int *buflen, struct qstr *name)
1911 * Convert a dentry into an ASCII path name. If the entry has been deleted 1908 * Convert a dentry into an ASCII path name. If the entry has been deleted
1912 * the string " (deleted)" is appended. Note that this is ambiguous. 1909 * the string " (deleted)" is appended. Note that this is ambiguous.
1913 * 1910 *
1914 * Returns the buffer or an error code if the path was too long. 1911 * Returns a pointer into the buffer or an error code if the
1912 * path was too long.
1915 * 1913 *
1916 * "buflen" should be positive. Caller holds the dcache_lock. 1914 * "buflen" should be positive. Caller holds the dcache_lock.
1917 * 1915 *
@@ -1987,7 +1985,10 @@ Elong:
1987 * Convert a dentry into an ASCII path name. If the entry has been deleted 1985 * Convert a dentry into an ASCII path name. If the entry has been deleted
1988 * the string " (deleted)" is appended. Note that this is ambiguous. 1986 * the string " (deleted)" is appended. Note that this is ambiguous.
1989 * 1987 *
1990 * Returns the buffer or an error code if the path was too long. 1988 * Returns a pointer into the buffer or an error code if the path was
1989 * too long. Note: Callers should use the returned pointer, not the passed
1990 * in buffer, to use the name! The implementation often starts at an offset
1991 * into the buffer, and may leave 0 bytes at the start.
1991 * 1992 *
1992 * "buflen" should be positive. 1993 * "buflen" should be positive.
1993 */ 1994 */
@@ -2313,9 +2314,6 @@ static void __init dcache_init(void)
2313/* SLAB cache for __getname() consumers */ 2314/* SLAB cache for __getname() consumers */
2314struct kmem_cache *names_cachep __read_mostly; 2315struct kmem_cache *names_cachep __read_mostly;
2315 2316
2316/* SLAB cache for file structures */
2317struct kmem_cache *filp_cachep __read_mostly;
2318
2319EXPORT_SYMBOL(d_genocide); 2317EXPORT_SYMBOL(d_genocide);
2320 2318
2321void __init vfs_caches_init_early(void) 2319void __init vfs_caches_init_early(void)
@@ -2337,9 +2335,6 @@ void __init vfs_caches_init(unsigned long mempages)
2337 names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0, 2335 names_cachep = kmem_cache_create("names_cache", PATH_MAX, 0,
2338 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL); 2336 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
2339 2337
2340 filp_cachep = kmem_cache_create("filp", sizeof(struct file), 0,
2341 SLAB_HWCACHE_ALIGN|SLAB_PANIC, NULL);
2342
2343 dcache_init(); 2338 dcache_init();
2344 inode_init(); 2339 inode_init();
2345 files_init(mempages); 2340 files_init(mempages);