- /** return hashed value from @key */
- unsigned (*hs_hash)(cfs_hash_t *hs, void *key, unsigned mask);
- /** return key address of @hnode */
- void * (*hs_key)(cfs_hlist_node_t *hnode);
- /** copy key from @hnode to @key */
- void (*hs_keycpy)(cfs_hlist_node_t *hnode, void *key);
- /** compare @key with key of @hnode */
- int (*hs_keycmp)(void *key, cfs_hlist_node_t *hnode);
- /** return object address of @hnode, i.e: container_of(...hnode) */
- void * (*hs_object)(cfs_hlist_node_t *hnode);
- /** get refcount of item, always called with holding bucket-lock */
- void * (*hs_get)(cfs_hlist_node_t *hnode);
- /** release refcount of item */
- void * (*hs_put)(cfs_hlist_node_t *hnode);
- /** release refcount of item, always called with holding bucket-lock */
- void * (*hs_put_locked)(cfs_hlist_node_t *hnode);
- /** it's called before removing of @hnode */
- void (*hs_exit)(cfs_hlist_node_t *hnode);
+ /** return hashed value from @key */
+ unsigned (*hs_hash)(cfs_hash_t *hs, const void *key, unsigned mask);
+ /** return key address of @hnode */
+ void * (*hs_key)(struct hlist_node *hnode);
+ /** copy key from @hnode to @key */
+ void (*hs_keycpy)(struct hlist_node *hnode, void *key);
+ /**
+ * compare @key with key of @hnode
+ * returns 1 on a match
+ */
+ int (*hs_keycmp)(const void *key, struct hlist_node *hnode);
+ /** return object address of @hnode, i.e: container_of(...hnode) */
+ void * (*hs_object)(struct hlist_node *hnode);
+ /** get refcount of item, always called with holding bucket-lock */
+ void (*hs_get)(cfs_hash_t *hs, struct hlist_node *hnode);
+ /** release refcount of item */
+ void (*hs_put)(cfs_hash_t *hs, struct hlist_node *hnode);
+ /** release refcount of item, always called with holding bucket-lock */
+ void (*hs_put_locked)(cfs_hash_t *hs, struct hlist_node *hnode);
+ /** it's called before removing of @hnode */
+ void (*hs_exit)(cfs_hash_t *hs, struct hlist_node *hnode);