summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2017-09-13 12:32:34 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2018-10-29 18:20:07 +0100
commit56e721e399b4ddc00c68cb7ced804846f6ac3f93 (patch)
tree005b81d812a28751be6acf3a675ee96a13bfef0f
parentf0b4a9cb253a8c527f43e9e9961bf6da540c73ec (diff)
downloadlinux-rt-56e721e399b4ddc00c68cb7ced804846f6ac3f93.tar.gz
fs/dcache: bring back explicit INIT_HLIST_BL_HEAD init
Commit 3d375d78593c ("mm: update callers to use HASH_ZERO flag") removed INIT_HLIST_BL_HEAD and uses the ZERO flag instead for the init. However on RT we have also a spinlock which needs an init call so we can't use that. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r--fs/dcache.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 2e7e8d85e9b4..e79ab67b0464 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -3062,6 +3062,8 @@ __setup("dhash_entries=", set_dhash_entries);
static void __init dcache_init_early(void)
{
+ unsigned int loop;
+
/* If hashes are distributed across NUMA nodes, defer
* hash allocation until vmalloc space is available.
*/
@@ -3078,11 +3080,16 @@ static void __init dcache_init_early(void)
NULL,
0,
0);
+
+ for (loop = 0; loop < (1U << d_hash_shift); loop++)
+ INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
+
d_hash_shift = 32 - d_hash_shift;
}
static void __init dcache_init(void)
{
+ unsigned int loop;
/*
* A constructor could be added for stable state like the lists,
* but it is probably not worth it because of the cache nature
@@ -3106,6 +3113,10 @@ static void __init dcache_init(void)
NULL,
0,
0);
+
+ for (loop = 0; loop < (1U << d_hash_shift); loop++)
+ INIT_HLIST_BL_HEAD(dentry_hashtable + loop);
+
d_hash_shift = 32 - d_hash_shift;
}