[RFC PATCH 07/20] ceph: add comments in ceph_hash.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx>

We have a lot of declarations and not enough good
comments on it.

Claude AI generated comments for CephFS metadata structure
declarations in include/linux/ceph/*.h. These comments
have been reviewed, checked, and corrected.

This patch adds comments for constant and method declarations
in /include/linux/ceph/ceph_hash.h.

Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@xxxxxxx>
cc: Alex Markuze <amarkuze@xxxxxxxxxx>
cc: Ilya Dryomov <idryomov@xxxxxxxxx>
cc: Ceph Development <ceph-devel@xxxxxxxxxxxxxxx>
---
 include/linux/ceph/ceph_hash.h | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/linux/ceph/ceph_hash.h b/include/linux/ceph/ceph_hash.h
index fda474c7a5d6..8ea203f6fbfa 100644
--- a/include/linux/ceph/ceph_hash.h
+++ b/include/linux/ceph/ceph_hash.h
@@ -2,13 +2,30 @@
 #ifndef FS_CEPH_HASH_H
 #define FS_CEPH_HASH_H
 
-#define CEPH_STR_HASH_LINUX      0x1  /* linux dcache hash */
-#define CEPH_STR_HASH_RJENKINS   0x2  /* robert jenkins' */
+/*
+ * String hashing algorithm type constants used for Ceph directory layout hashing.
+ * These determine how directory entries are distributed across metadata servers.
+ */
+/* Linux dcache hash algorithm - matches kernel dcache string hashing */
+#define CEPH_STR_HASH_LINUX      0x1
+/* Robert Jenkins' hash algorithm - provides good distribution properties */
+#define CEPH_STR_HASH_RJENKINS   0x2
 
+/*
+ * String hashing function interfaces for Ceph filesystem operations.
+ * Used primarily for consistent directory entry placement across MDS nodes.
+ */
+
+/* Compute Linux dcache-style hash of a string */
 extern unsigned ceph_str_hash_linux(const char *s, unsigned len);
+
+/* Compute Robert Jenkins hash of a string */
 extern unsigned ceph_str_hash_rjenkins(const char *s, unsigned len);
 
+/* Generic hash function dispatcher - calls appropriate algorithm based on type */
 extern unsigned ceph_str_hash(int type, const char *s, unsigned len);
+
+/* Get human-readable name for a hash algorithm type */
 extern const char *ceph_str_hash_name(int type);
 
 #endif
-- 
2.51.0





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux