summaryrefslogtreecommitdiffstats
path: root/include/linux/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index ae1177302d70..abc68555bac3 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -82,9 +82,16 @@ struct cred;
82 82
83struct key_type; 83struct key_type;
84struct key_owner; 84struct key_owner;
85struct key_tag;
85struct keyring_list; 86struct keyring_list;
86struct keyring_name; 87struct keyring_name;
87 88
89struct key_tag {
90 struct rcu_head rcu;
91 refcount_t usage;
92 bool removed; /* T when subject removed */
93};
94
88struct keyring_index_key { 95struct keyring_index_key {
89 /* [!] If this structure is altered, the union in struct key must change too! */ 96 /* [!] If this structure is altered, the union in struct key must change too! */
90 unsigned long hash; /* Hash value */ 97 unsigned long hash; /* Hash value */
@@ -101,6 +108,7 @@ struct keyring_index_key {
101 unsigned long x; 108 unsigned long x;
102 }; 109 };
103 struct key_type *type; 110 struct key_type *type;
111 struct key_tag *domain_tag; /* Domain of operation */
104 const char *description; 112 const char *description;
105}; 113};
106 114
@@ -218,6 +226,7 @@ struct key {
218 unsigned long hash; 226 unsigned long hash;
219 unsigned long len_desc; 227 unsigned long len_desc;
220 struct key_type *type; /* type of key */ 228 struct key_type *type; /* type of key */
229 struct key_tag *domain_tag; /* Domain of operation */
221 char *description; 230 char *description;
222 }; 231 };
223 }; 232 };
@@ -268,6 +277,7 @@ extern struct key *key_alloc(struct key_type *type,
268extern void key_revoke(struct key *key); 277extern void key_revoke(struct key *key);
269extern void key_invalidate(struct key *key); 278extern void key_invalidate(struct key *key);
270extern void key_put(struct key *key); 279extern void key_put(struct key *key);
280extern bool key_put_tag(struct key_tag *tag);
271 281
272static inline struct key *__key_get(struct key *key) 282static inline struct key *__key_get(struct key *key)
273{ 283{