Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7318226e authored by David Howells's avatar David Howells Committed by David S. Miller
Browse files

[AF_RXRPC]: Key facility changes for AF_RXRPC



Export the keyring key type definition and document its availability.

Add alternative types into the key's type_data union to make it more useful.
Not all users necessarily want to use it as a list_head (AF_RXRPC doesn't, for
example), so make it clear that it can be used in other ways.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 071b6386
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -859,6 +859,18 @@ payload contents" for more information.
	void unregister_key_type(struct key_type *type);
	void unregister_key_type(struct key_type *type);




Under some circumstances, it may be desirable to desirable to deal with a
bundle of keys.  The facility provides access to the keyring type for managing
such a bundle:

	struct key_type key_type_keyring;

This can be used with a function such as request_key() to find a specific
keyring in a process's keyrings.  A keyring thus found can then be searched
with keyring_search().  Note that it is not possible to use request_key() to
search a specific keyring, so using keyrings in this way is of limited utility.


===================================
===================================
NOTES ON ACCESSING PAYLOAD CONTENTS
NOTES ON ACCESSING PAYLOAD CONTENTS
===================================
===================================
+2 −0
Original line number Original line Diff line number Diff line
@@ -160,6 +160,8 @@ struct key {
	 */
	 */
	union {
	union {
		struct list_head	link;
		struct list_head	link;
		unsigned long		x[2];
		void			*p[2];
	} type_data;
	} type_data;


	/* key data
	/* key data
+2 −0
Original line number Original line Diff line number Diff line
@@ -66,6 +66,8 @@ struct key_type key_type_keyring = {
	.read		= keyring_read,
	.read		= keyring_read,
};
};


EXPORT_SYMBOL(key_type_keyring);

/*
/*
 * semaphore to serialise link/link calls to prevent two link calls in parallel
 * semaphore to serialise link/link calls to prevent two link calls in parallel
 * introducing a cycle
 * introducing a cycle