Quote:
Originally Posted by ao.yuan.young
What should I do to solve the problem??
|
Instead of this (old):
Code:
if(list_empty(&d.d_hash)) foo();
Use this (new: not a “literal” translation, but the preferred usage):
Code:
if(d_unhashed(&d)) foo();
Quote:
Originally Posted by ao.yuan.young
Another question is that there are two function concerned with hlist defined in list.h: hlist_unhash and hlist_empty. What are the differences between the two functions?
|
The first tells if a particular node is currently “headed” by a hash. The second tells if a particular head has a node. Also, the type
struct hlist_node* may be safely cast to
struct hlist_head*, so the first works only on nodes, yet the second works on nodes and heads.