git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'iso-9660' into block-io
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
vfs.c
diff --git
a/lunaix-os/kernel/fs/vfs.c
b/lunaix-os/kernel/fs/vfs.c
index df374cdf41ad41fcf3cd15592a8419c1f22c4c3d..d0fbb1cbb6ded93406770d38894873da4faf4f49 100644
(file)
--- a/
lunaix-os/kernel/fs/vfs.c
+++ b/
lunaix-os/kernel/fs/vfs.c
@@
-112,10
+112,10
@@
inline struct hbucket*
__dcache_hash(struct v_dnode* parent, uint32_t* hash)
{
uint32_t _hash = *hash;
__dcache_hash(struct v_dnode* parent, uint32_t* hash)
{
uint32_t _hash = *hash;
- // 与parent的指针值做加法,来减小碰撞的可能性。
- _hash += (uint32_t)parent;
// 确保低位更加随机
_hash = _hash ^ (_hash >> VFS_HASHBITS);
// 确保低位更加随机
_hash = _hash ^ (_hash >> VFS_HASHBITS);
+ // 与parent的指针值做加法,来减小碰撞的可能性。
+ _hash += (uint32_t)parent;
*hash = _hash;
return &dnode_cache[_hash & VFS_HASH_MASK];
}
*hash = _hash;
return &dnode_cache[_hash & VFS_HASH_MASK];
}