aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-09-24 05:35:18 -0400
committerDavid Howells <dhowells@redhat.com>2013-09-24 05:35:18 -0400
commitb2a4df200d570b2c33a57e1ebfa5896e4bc81b69 (patch)
tree7fa48ae3c5ecff90d6d1f662fd91af5ddf74d56d /include/linux
parent3cb989501c2688cacbb7dc4b0d353faf838f53a1 (diff)
KEYS: Expand the capacity of a keyring
Expand the capacity of a keyring to be able to hold a lot more keys by using the previously added associative array implementation. Currently the maximum capacity is: (PAGE_SIZE - sizeof(header)) / sizeof(struct key *) which, on a 64-bit system, is a little more 500. However, since this is being used for the NFS uid mapper, we need more than that. The new implementation gives us effectively unlimited capacity. With some alterations, the keyutils testsuite runs successfully to completion after this patch is applied. The alterations are because (a) keyrings that are simply added to no longer appear ordered and (b) some of the errors have changed a bit. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/key.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/linux/key.h b/include/linux/key.h
index ef596c7af585..2417f789d29b 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -22,6 +22,7 @@
22#include <linux/sysctl.h> 22#include <linux/sysctl.h>
23#include <linux/rwsem.h> 23#include <linux/rwsem.h>
24#include <linux/atomic.h> 24#include <linux/atomic.h>
25#include <linux/assoc_array.h>
25 26
26#ifdef __KERNEL__ 27#ifdef __KERNEL__
27#include <linux/uidgid.h> 28#include <linux/uidgid.h>
@@ -196,11 +197,13 @@ struct key {
196 * whatever 197 * whatever
197 */ 198 */
198 union { 199 union {
199 unsigned long value; 200 union {
200 void __rcu *rcudata; 201 unsigned long value;
201 void *data; 202 void __rcu *rcudata;
202 struct keyring_list __rcu *subscriptions; 203 void *data;
203 } payload; 204 } payload;
205 struct assoc_array keys;
206 };
204}; 207};
205 208
206extern struct key *key_alloc(struct key_type *type, 209extern struct key *key_alloc(struct key_type *type,