[Devel,RHEL7,COMMIT] ms/keys: add user_key_payload() helper

Submitted by Konstantin Khorenko on Aug. 11, 2016, 9:50 a.m.

Details

Message ID 201608110950.u7B9ohDD003332@finist_cl7.x64_64.work.ct
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Aug. 11, 2016, 9:50 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.22.2.vz7.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.22.2.vz7.16.5
------>
commit b0e49c4d8dd7139b73aafcbabda5e35e75c90880
Author: Andrey Ryabinin <aryabinin@virtuozzo.com>
Date:   Thu Aug 11 13:50:43 2016 +0400

    ms/keys: add user_key_payload() helper
    
    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 */