summaryrefslogtreecommitdiff
path: root/include/linux/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/key.h')
-rw-r--r--include/linux/key.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index 3db0adce1fda..a6b1edcffc34 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -275,6 +275,10 @@ static inline key_serial_t key_serial(struct key *key)
return key ? key->serial : 0;
}
+#define rcu_dereference_key(KEY) \
+ (rcu_dereference_protected((KEY)->payload.rcudata, \
+ rwsem_is_locked(&((struct key *)(KEY))->sem)))
+
#ifdef CONFIG_SYSCTL
extern ctl_table key_sysctls[];
#endif