mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
svc: Change services to use new svc_create_xprt service
Modify the various kernel RPC svcs to use the svc_create_xprt service. Signed-off-by: Tom Tucker <[email protected]> Acked-by: Neil Brown <[email protected]> Reviewed-by: Chuck Lever <[email protected]> Reviewed-by: Greg Banks <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
This commit is contained in:
parent
b700cbb11f
commit
d7c9f1ed97
6 changed files with 12 additions and 37 deletions
|
|
@ -219,13 +219,12 @@ lockd(struct svc_rqst *rqstp)
|
|||
module_put_and_exit(0);
|
||||
}
|
||||
|
||||
|
||||
static int find_socket(struct svc_serv *serv, int proto)
|
||||
static int find_xprt(struct svc_serv *serv, char *proto)
|
||||
{
|
||||
struct svc_sock *svsk;
|
||||
int found = 0;
|
||||
list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
|
||||
if (svsk->sk_sk->sk_protocol == proto) {
|
||||
if (strcmp(svsk->sk_xprt.xpt_class->xcl_name, proto) == 0) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
|
@ -243,13 +242,13 @@ static int make_socks(struct svc_serv *serv, int proto)
|
|||
int err = 0;
|
||||
|
||||
if (proto == IPPROTO_UDP || nlm_udpport)
|
||||
if (!find_socket(serv, IPPROTO_UDP))
|
||||
err = svc_makesock(serv, IPPROTO_UDP, nlm_udpport,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
if (!find_xprt(serv, "udp"))
|
||||
err = svc_create_xprt(serv, "udp", nlm_udpport,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
|
||||
if (!find_socket(serv, IPPROTO_TCP))
|
||||
err = svc_makesock(serv, IPPROTO_TCP, nlm_tcpport,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
if (!find_xprt(serv, "tcp"))
|
||||
err = svc_create_xprt(serv, "tcp", nlm_tcpport,
|
||||
SVC_SOCK_DEFAULTS);
|
||||
|
||||
if (err >= 0) {
|
||||
warned = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue