lkml.org 
[lkml]   [1997]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectminor addition to dcache.h
This patch adds a routine for computing dentry hash codes to dcache.h. 
Since several filesystems (nfs, smbfs, amybe more?) need to do this, it
would be better to have one routine to do it correctly.

Regards,
Bill--- include/linux/dcache.h.old Sat Oct 25 07:43:21 1997
+++ include/linux/dcache.h Thu Oct 30 11:22:59 1997
@@ -17,7 +17,8 @@
*/
struct qstr {
const unsigned char * name;
- unsigned int len, hash;
+ unsigned int len;
+ unsigned int hash;
};

/* Name hashing routines. Initial hash value */
@@ -38,6 +39,15 @@
return (unsigned int) hash;
}

+/* Compute the hash for a name string. */
+static inline unsigned int full_name_hash(const char * name, unsigned int len)
+{
+ unsigned long hash = init_name_hash();
+ while (len--)
+ hash = partial_name_hash(*name++, hash);
+ return end_name_hash(hash);
+}
+
struct dentry {
int d_count;
unsigned int d_flags;
\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.035 / U:0.924 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site