diff options
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 5b0fe1b66a23..3ee4b78742b1 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -429,6 +429,46 @@ out: | |||
429 | } | 429 | } |
430 | 430 | ||
431 | /* | 431 | /* |
432 | * Report socket names for nfsdfs | ||
433 | */ | ||
434 | static int one_sock_name(char *buf, struct svc_sock *svsk) | ||
435 | { | ||
436 | int len; | ||
437 | |||
438 | switch(svsk->sk_sk->sk_family) { | ||
439 | case AF_INET: | ||
440 | len = sprintf(buf, "ipv4 %s %u.%u.%u.%u %d\n", | ||
441 | svsk->sk_sk->sk_protocol==IPPROTO_UDP? | ||
442 | "udp" : "tcp", | ||
443 | NIPQUAD(inet_sk(svsk->sk_sk)->rcv_saddr), | ||
444 | inet_sk(svsk->sk_sk)->num); | ||
445 | break; | ||
446 | default: | ||
447 | len = sprintf(buf, "*unknown-%d*\n", | ||
448 | svsk->sk_sk->sk_family); | ||
449 | } | ||
450 | return len; | ||
451 | } | ||
452 | |||
453 | int | ||
454 | svc_sock_names(char *buf, struct svc_serv *serv) | ||
455 | { | ||
456 | struct svc_sock *svsk; | ||
457 | int len = 0; | ||
458 | |||
459 | if (!serv) | ||
460 | return 0; | ||
461 | spin_lock(&serv->sv_lock); | ||
462 | list_for_each_entry(svsk, &serv->sv_permsocks, sk_list) { | ||
463 | int onelen = one_sock_name(buf+len, svsk); | ||
464 | len += onelen; | ||
465 | } | ||
466 | spin_unlock(&serv->sv_lock); | ||
467 | return len; | ||
468 | } | ||
469 | EXPORT_SYMBOL(svc_sock_names); | ||
470 | |||
471 | /* | ||
432 | * Check input queue length | 472 | * Check input queue length |
433 | */ | 473 | */ |
434 | static int | 474 | static int |