patch-2.1.61 linux/include/linux/dcache.h
Next file: linux/include/linux/nfs_fs.h
Previous file: linux/include/asm-alpha/socket.h
Back to the patch index
Back to the overall index
- Lines: 26
- Date:
Thu Oct 30 10:50:39 1997
- Orig file:
v2.1.60/linux/include/linux/dcache.h
- Orig date:
Sat Oct 25 02:44:18 1997
diff -u --recursive --new-file v2.1.60/linux/include/linux/dcache.h linux/include/linux/dcache.h
@@ -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 */
@@ -36,6 +37,15 @@
if (sizeof(hash) > sizeof(unsigned int))
hash += hash >> 4*sizeof(hash);
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 {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov