aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index e45212f2777e..9d9fac583dd3 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -23,6 +23,7 @@
23#include <linux/rwsem.h> 23#include <linux/rwsem.h>
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25#include <linux/assoc_array.h> 25#include <linux/assoc_array.h>
26#include <linux/refcount.h>
26 27
27#ifdef __KERNEL__ 28#ifdef __KERNEL__
28#include <linux/uidgid.h> 29#include <linux/uidgid.h>
@@ -135,7 +136,7 @@ static inline bool is_key_possessed(const key_ref_t key_ref)
135 * - Kerberos TGTs and tickets 136 * - Kerberos TGTs and tickets
136 */ 137 */
137struct key { 138struct key {
138 atomic_t usage; /* number of references */ 139 refcount_t usage; /* number of references */
139 key_serial_t serial; /* key serial number */ 140 key_serial_t serial; /* key serial number */
140 union { 141 union {
141 struct list_head graveyard_link; 142 struct list_head graveyard_link;
@@ -242,7 +243,7 @@ extern void key_put(struct key *key);
242 243
243static inline struct key *__key_get(struct key *key) 244static inline struct key *__key_get(struct key *key)
244{ 245{
245 atomic_inc(&key->usage); 246 refcount_inc(&key->usage);
246 return key; 247 return key;
247} 248}
248 249