[Devel,rh7,1/2] keys: add user_key_payload() helper

Submitted by Andrey Ryabinin on Aug. 10, 2016, 12:14 p.m.

Details

Message ID 1470831256-28346-1-git-send-email-aryabinin@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Andrey Ryabinin Aug. 10, 2016, 12:14 p.m.
This backports simple helper from upstream commit
146aa8b1453b ("KEYS: Merge the type-specific data with the payload data")

To be used in dm-crypt.

https://jira.sw.ru/browse/PSBM-44218

Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
---
 include/keys/user-type.h | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/include/keys/user-type.h b/include/keys/user-type.h
index 5e452c8..717c9bf 100644
--- a/include/keys/user-type.h
+++ b/include/keys/user-type.h
@@ -46,5 +46,9 @@  extern void user_describe(const struct key *user, struct seq_file *m);
 extern long user_read(const struct key *key,
 		      char __user *buffer, size_t buflen);
 
+static inline const struct user_key_payload *user_key_payload(const struct key *key)
+{
+	return (struct user_key_payload *)rcu_dereference_key(key);
+}
 
 #endif /* _KEYS_USER_TYPE_H */