aboutsummaryrefslogtreecommitdiffstats
path: root/fs/dcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/dcache.c')
-rw-r--r--fs/dcache.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index d30ce699ae4b..7a5b51440afa 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -106,8 +106,7 @@ static inline struct hlist_bl_head *d_hash(const struct dentry *parent,
106 unsigned int hash) 106 unsigned int hash)
107{ 107{
108 hash += (unsigned long) parent / L1_CACHE_BYTES; 108 hash += (unsigned long) parent / L1_CACHE_BYTES;
109 hash = hash + (hash >> d_hash_shift); 109 return dentry_hashtable + hash_32(hash, d_hash_shift);
110 return dentry_hashtable + (hash & d_hash_mask);
111} 110}
112 111
113/* Statistics gathering. */ 112/* Statistics gathering. */
@@ -2656,6 +2655,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
2656 dentry->d_parent = dentry; 2655 dentry->d_parent = dentry;
2657 list_del_init(&dentry->d_u.d_child); 2656 list_del_init(&dentry->d_u.d_child);
2658 anon->d_parent = dparent; 2657 anon->d_parent = dparent;
2658 if (likely(!d_unhashed(anon))) {
2659 hlist_bl_lock(&anon->d_sb->s_anon);
2660 __hlist_bl_del(&anon->d_hash);
2661 anon->d_hash.pprev = NULL;
2662 hlist_bl_unlock(&anon->d_sb->s_anon);
2663 }
2659 list_move(&anon->d_u.d_child, &dparent->d_subdirs); 2664 list_move(&anon->d_u.d_child, &dparent->d_subdirs);
2660 2665
2661 write_seqcount_end(&dentry->d_seq); 2666 write_seqcount_end(&dentry->d_seq);
@@ -2714,7 +2719,6 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
2714 write_seqlock(&rename_lock); 2719 write_seqlock(&rename_lock);
2715 __d_materialise_dentry(dentry, new); 2720 __d_materialise_dentry(dentry, new);
2716 write_sequnlock(&rename_lock); 2721 write_sequnlock(&rename_lock);
2717 __d_drop(new);
2718 _d_rehash(new); 2722 _d_rehash(new);
2719 spin_unlock(&new->d_lock); 2723 spin_unlock(&new->d_lock);
2720 spin_unlock(&inode->i_lock); 2724 spin_unlock(&inode->i_lock);
@@ -2778,7 +2782,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
2778 * could splice into our tree? */ 2782 * could splice into our tree? */
2779 __d_materialise_dentry(dentry, alias); 2783 __d_materialise_dentry(dentry, alias);
2780 write_sequnlock(&rename_lock); 2784 write_sequnlock(&rename_lock);
2781 __d_drop(alias);
2782 goto found; 2785 goto found;
2783 } else { 2786 } else {
2784 /* Nope, but we must(!) avoid directory 2787 /* Nope, but we must(!) avoid directory