From: NeilBrown <[email protected]> d_rehash() is no longer used. Is existence implies that it might be safe to unhash and rehash ad dentry, and with proposed locking changes that will no longer be the case. So remove it.
Signed-off-by: NeilBrown <[email protected]> --- Documentation/filesystems/porting.rst | 7 +++++++ fs/dcache.c | 15 --------------- include/linux/dcache.h | 5 ----- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/Documentation/filesystems/porting.rst b/Documentation/filesystems/porting.rst index 4712403fd98e..154a38cd7801 100644 --- a/Documentation/filesystems/porting.rst +++ b/Documentation/filesystems/porting.rst @@ -1389,3 +1389,10 @@ from an internal table when needed. d_alloc() is no longer exported as its use can be racy. Use d_alloc_name() when object creation is controlled separately from standard filesystem interface, and d_alloc_parallel() or d_alloc_noblock() when standard interfaces can be used. + +--- +**mandatory** + +d_rehash() is gone. It should never be needed. Only unhash a dentry if +you really don't want it. + diff --git a/fs/dcache.c b/fs/dcache.c index 4ebbbcc5aec4..abb96ad8e015 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2627,21 +2627,6 @@ static void __d_rehash(struct dentry *entry) hlist_bl_unlock(b); } -/** - * d_rehash - add an entry back to the hash - * @entry: dentry to add to the hash - * - * Adds a dentry to the hash according to its name. - */ - -void d_rehash(struct dentry * entry) -{ - spin_lock(&entry->d_lock); - __d_rehash(entry); - spin_unlock(&entry->d_lock); -} -EXPORT_SYMBOL(d_rehash); - #define PAR_LOOKUP_WQ_BITS 8 #define PAR_LOOKUP_WQS (1 << PAR_LOOKUP_WQ_BITS) static wait_queue_head_t par_wait_table[PAR_LOOKUP_WQS] __cacheline_aligned; diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 31b4a831ecdb..eb1a59b6fca7 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -277,11 +277,6 @@ extern struct dentry *d_find_alias_rcu(struct inode *); /* test whether we have any submounts in a subdir tree */ extern int path_has_submounts(const struct path *); -/* - * This adds the entry to the hash queues. - */ -extern void d_rehash(struct dentry *); - /* used for rename() and baskets */ extern void d_move(struct dentry *, struct dentry *); extern void d_exchange(struct dentry *, struct dentry *); -- 2.50.0.107.gf914562f5916.dirty
