[PATCH 2/4] kref: Implement kref_get_unless_zero v3

2012-11-06 Thread Thomas Hellstrom
This function is intended to simplify locking around refcounting for objects that can be looked up from a lookup structure, and which are removed from that lookup structure in the object destructor. Operations on such objects require at least a read lock around lookup + kref_get, and a write lock a

[PATCH 2/4] kref: Implement kref_get_unless_zero v2

2012-11-05 Thread Thomas Hellstrom
This function is intended to simplify locking around refcounting for objects that can be looked up from a lookup structure, and which are removed from that lookup structure in the object destructor. Operations on such objects require at least a read lock around lookup + kref_get, and a write lock a

[PATCH 2/4] kref: Implement kref_get_unless_zero

2012-11-05 Thread Thomas Hellstrom
This function is intended to simplify locking around refcounting for objects that can be looked up from a lookup structure, and which are removed from that lookup structure in the object destructor. Operations on such objects require at least a read lock around lookup + kref_get, and a write lock a