mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
KEYS: Add an RCU payload dereference macro
Add an RCU payload dereference macro as this seems to be a common piece of code amongst key types that use RCU referenced payloads. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
committed by
James Morris
parent
1cc26bada9
commit
633e804e89
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user