/* Returns positive length of the filled-in string on success; otherwise a negative errno value is returned if an error occurs.  */
int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen)
/* Returns positive length of the filled-in string on success; otherwise a negative errno value is returned if an error occurs.  */
int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen)
{
	struct svc_xprt *xprt;
	int len, totlen;
	char *pos;
	if (!serv)
		return 0;
	spin_lock_bh(&serv->sv_lock);
	pos = buf;
	totlen = 0;
	list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
		len = svc_one_xprt_name(xprt, pos, buflen - totlen);
		if (len < 0) {
			*buf = '\0';
			totlen = len;
		}
		if (len <= 0)
			break;
		pos += len;
		totlen += len;
	}
	spin_unlock_bh(&serv->sv_lock);
	return totlen;
}