diff options
author | David Howells <dhowells@redhat.com> | 2018-10-20 00:57:58 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-10-24 00:41:08 +0100 |
commit | 35dbfba3111a5ef0663bb89185ce8dfdbef63f8d (patch) | |
tree | 53d00127f785779f24adca8234f395d9f8a6180f /fs/afs/rxrpc.c | |
parent | 06aeb2971457b33c1123af9f307a55f3dc4052c9 (diff) | |
download | linux-35dbfba3111a5ef0663bb89185ce8dfdbef63f8d.tar.bz2 |
afs: Implement the YFS cache manager service
Implement the YFS cache manager service which gives extra capabilities on
top of AFS. This is done by listening for an additional service on the
same port and indicating that anyone requesting an upgrade should be
upgraded to the YFS port.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/rxrpc.c')
-rw-r--r-- | fs/afs/rxrpc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c index e6ab824ab761..ce98e133caa6 100644 --- a/fs/afs/rxrpc.c +++ b/fs/afs/rxrpc.c @@ -16,6 +16,7 @@ #include <net/af_rxrpc.h> #include "internal.h" #include "afs_cm.h" +#include "protocol_yfs.h" struct workqueue_struct *afs_async_calls; @@ -42,6 +43,7 @@ int afs_open_socket(struct afs_net *net) struct sockaddr_rxrpc srx; struct socket *socket; unsigned int min_level; + u16 service_upgrade[2]; int ret; _enter(""); @@ -75,6 +77,19 @@ int afs_open_socket(struct afs_net *net) if (ret < 0) goto error_2; + srx.srx_service = YFS_CM_SERVICE; + ret = kernel_bind(socket, (struct sockaddr *) &srx, sizeof(srx)); + if (ret < 0) + goto error_2; + + service_upgrade[0] = CM_SERVICE; + service_upgrade[1] = YFS_CM_SERVICE; + ret = kernel_setsockopt(socket, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, + (void *)service_upgrade, sizeof(service_upgrade)); + if (ret < 0) + goto error_2; + + rxrpc_kernel_new_call_notification(socket, afs_rx_new_call, afs_rx_discard_new_call); |