mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
keys: Simplify key description management
Simplify key description management by cramming the word containing the length with the first few chars of the description also. This simplifies the code that generates the index-key used by assoc_array. It should speed up key searching a bit too. Signed-off-by: David Howells <dhowells@redhat.com>
This commit is contained in:
parent
3b8c4a08a4
commit
f771fde820
5 changed files with 43 additions and 50 deletions
|
@ -86,9 +86,20 @@ struct keyring_list;
|
|||
struct keyring_name;
|
||||
|
||||
struct keyring_index_key {
|
||||
union {
|
||||
struct {
|
||||
#ifdef __LITTLE_ENDIAN /* Put desc_len at the LSB of x */
|
||||
u8 desc_len;
|
||||
char desc[sizeof(long) - 1]; /* First few chars of description */
|
||||
#else
|
||||
char desc[sizeof(long) - 1]; /* First few chars of description */
|
||||
u8 desc_len;
|
||||
#endif
|
||||
};
|
||||
unsigned long x;
|
||||
};
|
||||
struct key_type *type;
|
||||
const char *description;
|
||||
size_t desc_len;
|
||||
};
|
||||
|
||||
union key_payload {
|
||||
|
@ -202,6 +213,7 @@ struct key {
|
|||
union {
|
||||
struct keyring_index_key index_key;
|
||||
struct {
|
||||
unsigned long len_desc;
|
||||
struct key_type *type; /* type of key */
|
||||
char *description;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue