diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-27 23:29:21 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-27 23:29:21 +0200 |
commit | df4c072acb675a4c89882e3c92442978cf94eedd (patch) | |
tree | 00e0559e4e97fc78631912f83f408e074644f601 /ncr.c | |
parent | 9a2369d426b23f77884b01666370140d10b41c19 (diff) | |
download | kernel-crypto-df4c072acb675a4c89882e3c92442978cf94eedd.tar.gz kernel-crypto-df4c072acb675a4c89882e3c92442978cf94eedd.tar.xz kernel-crypto-df4c072acb675a4c89882e3c92442978cf94eedd.zip |
Use ncr_lists instead of list_sem_st in intefaces
Should result in no functionality change.
This makes the code marginally more effective (reducing the number of
"&lst->key" and "&lst->sessions" operations in the code, and moving them
toward dereferences where they can be combined with member accesses),
and more type-safe (prevents mixing the key and session list in most
places because they the difference is only in the low-level accessor
functions).
Most importantly, this allows replacing list_sem_st without having to
touch most of the functions again.
Diffstat (limited to 'ncr.c')
-rw-r--r-- | ncr.c | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -67,8 +67,8 @@ void* ncr_init_lists(void) void ncr_deinit_lists(struct ncr_lists *lst) { if(lst) { - ncr_key_list_deinit(&lst->key); - ncr_sessions_list_deinit(&lst->sessions); + ncr_key_list_deinit(lst); + ncr_sessions_list_deinit(lst); kfree(lst); } } @@ -127,25 +127,25 @@ ncr_ioctl(struct ncr_lists* lst, struct file *filp, switch (cmd) { case NCRIO_KEY_INIT: - return ncr_key_init(&lst->key, arg); + return ncr_key_init(lst, arg); case NCRIO_KEY_DEINIT: - return ncr_key_deinit(&lst->key, arg); + return ncr_key_deinit(lst, arg); case NCRIO_KEY_GENERATE: - return ncr_key_generate(&lst->key, arg); + return ncr_key_generate(lst, arg); case NCRIO_KEY_EXPORT: - return ncr_key_export(&lst->key, arg); + return ncr_key_export(lst, arg); case NCRIO_KEY_IMPORT: - return ncr_key_import(&lst->key, arg); + return ncr_key_import(lst, arg); case NCRIO_KEY_GET_INFO: - return ncr_key_info(&lst->key, arg); + return ncr_key_info(lst, arg); case NCRIO_KEY_WRAP: - return ncr_key_wrap(&lst->key, arg); + return ncr_key_wrap(lst, arg); case NCRIO_KEY_UNWRAP: - return ncr_key_unwrap(&lst->key, arg); + return ncr_key_unwrap(lst, arg); case NCRIO_KEY_STORAGE_WRAP: - return ncr_key_storage_wrap(&lst->key, arg); + return ncr_key_storage_wrap(lst, arg); case NCRIO_KEY_STORAGE_UNWRAP: - return ncr_key_storage_unwrap(&lst->key, arg); + return ncr_key_storage_unwrap(lst, arg); case NCRIO_SESSION_INIT: return ncr_session_init(lst, arg); case NCRIO_SESSION_UPDATE: @@ -158,9 +158,9 @@ ncr_ioctl(struct ncr_lists* lst, struct file *filp, case NCRIO_MASTER_KEY_SET: return ncr_master_key_set(arg); case NCRIO_KEY_GENERATE_PAIR: - return ncr_key_generate_pair(&lst->key, arg); + return ncr_key_generate_pair(lst, arg); case NCRIO_KEY_DERIVE: - return ncr_key_derive(&lst->key, arg); + return ncr_key_derive(lst, arg); default: return -EINVAL; } |