-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- list_del(&dentry->d_hash);
- INIT_LIST_HEAD(&dentry->d_hash);
-#else
- hlist_del_init(&dentry->d_hash);
-#endif
- dput(dentry); /* this will free the dentry memory */
+ char *name = (char *)dentry->d_name.name;
+ unsigned long hash;
+ unsigned char c;
+ char *str_name;
+ int len = 0, name_len = 0;
+
+ name_len = dentry->d_name.len;
+ if (!name_len)
+ return 0;
+ hash = init_name_hash();
+ while (name_len--) {
+ c = *(const unsigned char *)name++;
+ if (c == ':' || c == '\0')
+ break;
+ hash = partial_name_hash(c, hash);
+ len ++;
+ }
+ str->hash = end_name_hash(hash);
+ OBD_ALLOC(str_name, len + 1);
+ memcpy(str_name, dentry->d_name.name, len);
+ qstr_assign(str, str_name, len);
+ if (index && c == ':')
+ *index = simple_strtoul(name, 0, 0);
+ return 0;