Skip to contentSkip to conversation

gfs2: drop filesystem-specific hash function

PATCH New Chung-Chiang Cheng 1 participant 1 message Nov 22, 2023 GFS2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gfs2: drop filesystem-specific hash function

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.

---
 fs/gfs2/dentry.c | 7 -------
 1 file changed, 7 deletions(-)
fs/gfs2/dentry.c +0 -7
index 2e215e8c3c88..87b53c53d0f1 100644
@@ -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,
 };
 
Signature · 1 line
2.34.1