gfs2.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Chung-Chiang Cheng <cccheng@synology.com>
To: agruenba@redhat.com
Cc: gfs2@lists.linux.dev, shepjeng@gmail.com, kernel@cccheng.net,
	Chung-Chiang Cheng <cccheng@synology.com>
Subject: [PATCH] gfs2: drop filesystem-specific hash function
Date: Wed, 22 Nov 2023 13:57:39 +0800	[thread overview]
Message-ID: <20231122055739.4140979-1-cccheng@synology.com> (raw)

Prior to commit 8387ff2577eb ("vfs: make the string hashes salt the
hash"), the dentry hash lookup function, d_hash(), incorporated
hash"), the dentry hash lookup function, d_hash(), incorporated
additional salt from parent directories into the hash value before
returning the result.  However, after this commit, the dentry hash
generator should internally add its own salt to prevent identical
filenames from being placed in the same hash bucket within the
dentry_hashtable. This ensures that the hash distribution remains
uniform and efficient. Since GFS2 doesn't modify the filename and
the dentry hash doesn't need to match the on-disk hash function,
the filesystem-specific hash function can be eliminated.

Signed-off-by: Chung-Chiang Cheng <cccheng@synology.com>
---
 fs/gfs2/dentry.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/fs/gfs2/dentry.c b/fs/gfs2/dentry.c
index 2e215e8c3c88..87b53c53d0f1 100644
--- a/fs/gfs2/dentry.c
+++ b/fs/gfs2/dentry.c
@@ -77,12 +77,6 @@ static int gfs2_drevalidate(struct dentry *dentry, unsigned int flags)
 	return valid;
 }
 
-static int gfs2_dhash(const struct dentry *dentry, struct qstr *str)
-{
-	str->hash = gfs2_disk_hash(str->name, str->len);
-	return 0;
-}
-
 static int gfs2_dentry_delete(const struct dentry *dentry)
 {
 	struct gfs2_inode *ginode;
@@ -102,7 +96,6 @@ static int gfs2_dentry_delete(const struct dentry *dentry)
 
 const struct dentry_operations gfs2_dops = {
 	.d_revalidate = gfs2_drevalidate,
-	.d_hash = gfs2_dhash,
 	.d_delete = gfs2_dentry_delete,
 };
 
-- 
2.34.1


                 reply	other threads:[~2023-11-22  6:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231122055739.4140979-1-cccheng@synology.com \
    --to=cccheng@synology.com \
    --cc=agruenba@redhat.com \
    --cc=gfs2@lists.linux.dev \
    --cc=kernel@cccheng.net \
    --cc=shepjeng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).