mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 13:41:30 +00:00
KEYS: Define a __key_get() wrapper to use rather than atomic_inc()
Define a __key_get() wrapper to use rather than atomic_inc() on the key usage count as this makes it easier to hook in refcount error debugging. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
d0a059cac6
commit
ccc3e6d9c9
5 changed files with 27 additions and 20 deletions
|
@ -219,11 +219,15 @@ extern void key_revoke(struct key *key);
|
|||
extern void key_invalidate(struct key *key);
|
||||
extern void key_put(struct key *key);
|
||||
|
||||
static inline struct key *__key_get(struct key *key)
|
||||
{
|
||||
atomic_inc(&key->usage);
|
||||
return key;
|
||||
}
|
||||
|
||||
static inline struct key *key_get(struct key *key)
|
||||
{
|
||||
if (key)
|
||||
atomic_inc(&key->usage);
|
||||
return key;
|
||||
return key ? __key_get(key) : key;
|
||||
}
|
||||
|
||||
static inline void key_ref_put(key_ref_t key_ref)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue