Subversion Repositories HelenOS

Rev

Rev 2596 | Rev 2679 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2596 Rev 2652
Line 172... Line 172...
172
hash_index_t nodes_hash(unsigned long key[])
172
hash_index_t nodes_hash(unsigned long key[])
173
{
173
{
174
    hash_index_t a = key[KEY_FS_HANDLE] << (NODES_BUCKETS_LOG / 4);
174
    hash_index_t a = key[KEY_FS_HANDLE] << (NODES_BUCKETS_LOG / 4);
175
    hash_index_t b = (a | key[KEY_DEV_HANDLE]) << (NODES_BUCKETS_LOG / 2);
175
    hash_index_t b = (a | key[KEY_DEV_HANDLE]) << (NODES_BUCKETS_LOG / 2);
176
   
176
   
177
    return (b | key[KEY_INDEX]) & ~(NODES_BUCKETS - 1);
177
    return (b | key[KEY_INDEX]) & (NODES_BUCKETS - 1);
178
}
178
}
179
 
179
 
180
int nodes_compare(unsigned long key[], hash_count_t keys, link_t *item)
180
int nodes_compare(unsigned long key[], hash_count_t keys, link_t *item)
181
{
181
{
182
    vfs_node_t *node = hash_table_get_instance(item, vfs_node_t, nh_link);
182
    vfs_node_t *node = hash_table_get_instance(item, vfs_node_t, nh_link);