diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c index b4b7d549d1df..8f363e91a64f 100644 --- a/lib/libc/rpc/auth_des.c +++ b/lib/libc/rpc/auth_des.c @@ -52,6 +52,7 @@ #undef NIS #include #include "un-namespace.h" +#include "mt_misc.h" #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)auth_des.c 2.2 88/07/29 4.0 RPCSRC; from 1.9 88/02/08 SMI"; @@ -481,7 +482,6 @@ static struct auth_ops * authdes_ops(void) { static struct auth_ops ops; - extern mutex_t authdes_ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/auth_none.c b/lib/libc/rpc/auth_none.c index 8546af317ab3..01ad70139c7c 100644 --- a/lib/libc/rpc/auth_none.c +++ b/lib/libc/rpc/auth_none.c @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" #define MAX_MARSHAL_SIZE 20 @@ -81,7 +82,6 @@ authnone_create() struct authnone_private *ap = authnone_private; XDR xdr_stream; XDR *xdrs; - extern mutex_t authnone_lock; mutex_lock(&authnone_lock); if (ap == 0) { @@ -113,7 +113,6 @@ authnone_marshal(AUTH *client, XDR *xdrs) { struct authnone_private *ap; bool_t dummy; - extern mutex_t authnone_lock; assert(xdrs != NULL); @@ -161,7 +160,6 @@ static struct auth_ops * authnone_ops() { static struct auth_ops ops; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/auth_unix.c b/lib/libc/rpc/auth_unix.c index 29082bd99102..3fcccd4a0619 100644 --- a/lib/libc/rpc/auth_unix.c +++ b/lib/libc/rpc/auth_unix.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" /* auth_unix.c */ static void authunix_nextverf (AUTH *); @@ -356,7 +357,6 @@ static struct auth_ops * authunix_ops() { static struct auth_ops ops; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/clnt_dg.c b/lib/libc/rpc/clnt_dg.c index ff97379935fc..761cc651e427 100644 --- a/lib/libc/rpc/clnt_dg.c +++ b/lib/libc/rpc/clnt_dg.c @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" #define RPC_MAX_BACKOFF 30 /* seconds */ @@ -92,7 +93,6 @@ static void clnt_dg_destroy(CLIENT *); * at a time. */ static int *dg_fd_locks; -extern mutex_t clnt_fd_lock; static cond_t *dg_cv; #define release_fd_lock(fd, mask) { \ mutex_lock(&clnt_fd_lock); \ @@ -754,7 +754,6 @@ static struct clnt_ops * clnt_dg_ops() { static struct clnt_ops ops; - extern mutex_t ops_lock; sigset_t mask; sigset_t newmask; diff --git a/lib/libc/rpc/clnt_raw.c b/lib/libc/rpc/clnt_raw.c index 5b11a5f2470b..9d34a3d445cf 100644 --- a/lib/libc/rpc/clnt_raw.c +++ b/lib/libc/rpc/clnt_raw.c @@ -57,8 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" - -extern mutex_t clntraw_lock; +#include "mt_misc.h" #define MCALL_MSG_SIZE 24 @@ -296,7 +295,6 @@ static struct clnt_ops * clnt_raw_ops() { static struct clnt_ops ops; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/clnt_simple.c b/lib/libc/rpc/clnt_simple.c index ae9c87f6e34f..12b6679f240f 100644 --- a/lib/libc/rpc/clnt_simple.c +++ b/lib/libc/rpc/clnt_simple.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 64 @@ -112,7 +113,6 @@ rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) enum clnt_stat clnt_stat; struct timeval timeout, tottimeout; static thread_key_t rpc_call_key; - extern mutex_t tsd_lock; int main_thread = 1; if ((main_thread = thr_main())) { diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c index 10780a55523d..e15caac9e908 100644 --- a/lib/libc/rpc/clnt_vc.c +++ b/lib/libc/rpc/clnt_vc.c @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" #define MCALL_MSG_SIZE 24 @@ -129,7 +130,6 @@ struct ct_data { * should be the first thing fixed. One step at a time. */ static int *vc_fd_locks; -extern mutex_t clnt_fd_lock; static cond_t *vc_cv; #define release_fd_lock(fd, mask) { \ mutex_lock(&clnt_fd_lock); \ @@ -753,7 +753,6 @@ static struct clnt_ops * clnt_vc_ops() { static struct clnt_ops ops; - extern mutex_t ops_lock; sigset_t mask, newmask; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/getpublickey.c b/lib/libc/rpc/getpublickey.c index 57b327e47b8c..d7b3736b25d1 100644 --- a/lib/libc/rpc/getpublickey.c +++ b/lib/libc/rpc/getpublickey.c @@ -63,7 +63,7 @@ int (*__getpublickey_LOCAL)() = 0; /* * Get somebody's public key */ -int +static int __getpublickey_real(netname, publickey) char *netname; char *publickey; diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c index be4cf82a9a46..615f24d9e867 100644 --- a/lib/libc/rpc/key_call.c +++ b/lib/libc/rpc/key_call.c @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" #define KEY_TIMEOUT 5 /* per-try timeout in seconds */ @@ -307,7 +308,6 @@ int vers; int main_thread; int fd; static thread_key_t key_call_key; - extern mutex_t tsd_lock; #define TOTAL_TIMEOUT 30 /* total timeout talking to keyserver */ #define TOTAL_TRIES 5 /* Number of tries */ diff --git a/lib/libc/rpc/mt_misc.c b/lib/libc/rpc/mt_misc.c index da9c96861334..62416117382d 100644 --- a/lib/libc/rpc/mt_misc.c +++ b/lib/libc/rpc/mt_misc.c @@ -11,6 +11,25 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" + +/* Take these objects out of the application namespace. */ +#define svc_lock __svc_lock +#define svc_fd_lock __svc_fd_lock +#define rpcbaddr_cache_lock __rpcbaddr_cache_lock +#define authdes_ops_lock __authdes_ops_lock +#define authnone_lock __authnone_lock +#define authsvc_lock __authsvc_lock +#define clnt_fd_lock __clnt_fd_lock +#define clntraw_lock __clntraw_lock +#define dupreq_lock __dupreq_lock +#define loopnconf_lock __loopnconf_lock +#define ops_lock __ops_lock +#define proglst_lock __proglst_lock +#define rpcsoc_lock __rpcsoc_lock +#define svcraw_lock __svcraw_lock +#define tsd_lock __tsd_lock +#define xprtlist_lock __xprtlist_lock /* protects the services list (svc.c) */ pthread_rwlock_t svc_lock = PTHREAD_RWLOCK_INITIALIZER; @@ -21,22 +40,12 @@ pthread_rwlock_t svc_fd_lock = PTHREAD_RWLOCK_INITIALIZER; /* protects the RPCBIND address cache */ pthread_rwlock_t rpcbaddr_cache_lock = PTHREAD_RWLOCK_INITIALIZER; -/* protects authdes cache (svcauth_des.c) */ -pthread_mutex_t authdes_lock = PTHREAD_MUTEX_INITIALIZER; - /* serializes authdes ops initializations */ pthread_mutex_t authdes_ops_lock = PTHREAD_MUTEX_INITIALIZER; /* protects des stats list */ pthread_mutex_t svcauthdesstats_lock = PTHREAD_MUTEX_INITIALIZER; -#ifdef KERBEROS -/* auth_kerb.c serialization */ -pthread_mutex_t authkerb_lock = PTHREAD_MUTEX_INITIALIZER; -/* protects kerb stats list */ -pthread_mutex_t svcauthkerbstats_lock = PTHREAD_MUTEX_INITIALIZER; -#endif /* KERBEROS */ - /* auth_none.c serialization */ pthread_mutex_t authnone_lock = PTHREAD_MUTEX_INITIALIZER; @@ -49,27 +58,15 @@ pthread_mutex_t clnt_fd_lock = PTHREAD_MUTEX_INITIALIZER; /* clnt_raw.c serialization */ pthread_mutex_t clntraw_lock = PTHREAD_MUTEX_INITIALIZER; -/* domainname and domain_fd (getdname.c) and default_domain (rpcdname.c) */ -pthread_mutex_t dname_lock = PTHREAD_MUTEX_INITIALIZER; - /* dupreq variables (svc_dg.c) */ pthread_mutex_t dupreq_lock = PTHREAD_MUTEX_INITIALIZER; -/* protects first_time and hostname (key_call.c) */ -pthread_mutex_t keyserv_lock = PTHREAD_MUTEX_INITIALIZER; - -/* serializes rpc_trace() (rpc_trace.c) */ -pthread_mutex_t libnsl_trace_lock = PTHREAD_MUTEX_INITIALIZER; - /* loopnconf (rpcb_clnt.c) */ pthread_mutex_t loopnconf_lock = PTHREAD_MUTEX_INITIALIZER; /* serializes ops initializations */ pthread_mutex_t ops_lock = PTHREAD_MUTEX_INITIALIZER; -/* protects ``port'' static in bindresvport() */ -pthread_mutex_t portnum_lock = PTHREAD_MUTEX_INITIALIZER; - /* protects proglst list (svc_simple.c) */ pthread_mutex_t proglst_lock = PTHREAD_MUTEX_INITIALIZER; @@ -85,9 +82,6 @@ pthread_mutex_t tsd_lock = PTHREAD_MUTEX_INITIALIZER; /* xprtlist (svc_generic.c) */ pthread_mutex_t xprtlist_lock = PTHREAD_MUTEX_INITIALIZER; -/* serializes calls to public key routines */ -pthread_mutex_t serialize_pkey = PTHREAD_MUTEX_INITIALIZER; - #undef rpc_createerr struct rpc_createerr rpc_createerr; diff --git a/lib/libc/rpc/mt_misc.h b/lib/libc/rpc/mt_misc.h new file mode 100644 index 000000000000..c706faf3625a --- /dev/null +++ b/lib/libc/rpc/mt_misc.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 12006 The FreeBSD Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _MT_MISC_H +#define _MT_MISC_H + +/* Take these locks out of the application namespace. */ +#define svc_lock __svc_lock +#define svc_fd_lock __svc_fd_lock +#define rpcbaddr_cache_lock __rpcbaddr_cache_lock +#define authdes_ops_lock __authdes_ops_lock +#define authnone_lock __authnone_lock +#define authsvc_lock __authsvc_lock +#define clnt_fd_lock __clnt_fd_lock +#define clntraw_lock __clntraw_lock +#define dupreq_lock __dupreq_lock +#define loopnconf_lock __loopnconf_lock +#define ops_lock __ops_lock +#define proglst_lock __proglst_lock +#define rpcsoc_lock __rpcsoc_lock +#define svcraw_lock __svcraw_lock +#define tsd_lock __tsd_lock +#define xprtlist_lock __xprtlist_lock + +extern pthread_rwlock_t svc_lock; +extern pthread_rwlock_t svc_fd_lock; +extern pthread_rwlock_t rpcbaddr_cache_lock; +extern pthread_mutex_t authdes_ops_lock; +extern pthread_mutex_t svcauthdesstats_lock; +extern pthread_mutex_t authnone_lock; +extern pthread_mutex_t authsvc_lock; +extern pthread_mutex_t clnt_fd_lock; +extern pthread_mutex_t clntraw_lock; +extern pthread_mutex_t dupreq_lock; +extern pthread_mutex_t loopnconf_lock; +extern pthread_mutex_t ops_lock; +extern pthread_mutex_t proglst_lock; +extern pthread_mutex_t rpcsoc_lock; +extern pthread_mutex_t svcraw_lock; +extern pthread_mutex_t tsd_lock; +extern pthread_mutex_t xprtlist_lock; + +#endif diff --git a/lib/libc/rpc/rpc_com.h b/lib/libc/rpc/rpc_com.h index a7cfd9730d04..f2bf11f5bf2c 100644 --- a/lib/libc/rpc/rpc_com.h +++ b/lib/libc/rpc/rpc_com.h @@ -74,8 +74,6 @@ int __rpc_socktype2seman(int); void *rpc_nullproc(CLIENT *); int __rpc_sockisbound(int); -struct netbuf *__rpcb_findaddr(rpcprog_t, rpcvers_t, const struct netconfig *, - const char *, CLIENT **); struct netbuf *__rpcb_findaddr_timed(rpcprog_t, rpcvers_t, const struct netconfig *, const char *host, CLIENT **clpp, struct timeval *tp); diff --git a/lib/libc/rpc/rpc_generic.c b/lib/libc/rpc/rpc_generic.c index 4baa63315494..a5168c457fe7 100644 --- a/lib/libc/rpc/rpc_generic.c +++ b/lib/libc/rpc/rpc_generic.c @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" struct handle { NCONF_HANDLE *nhandle; @@ -236,7 +237,6 @@ __rpc_getconfip(nettype) struct netconfig *dummy; int main_thread; static thread_key_t tcp_key, udp_key; - extern mutex_t tsd_lock; if ((main_thread = thr_main())) { netid_udp = netid_udp_main; diff --git a/lib/libc/rpc/rpc_soc.c b/lib/libc/rpc/rpc_soc.c index 7a9830186a70..59220634db13 100644 --- a/lib/libc/rpc/rpc_soc.c +++ b/lib/libc/rpc/rpc_soc.c @@ -74,8 +74,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" - -extern mutex_t rpcsoc_lock; +#include "mt_misc.h" static CLIENT *clnt_com_create(struct sockaddr_in *, rpcprog_t, rpcvers_t, int *, u_int, u_int, char *); @@ -399,7 +398,6 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) void *resultsp; /* pointer to results */ resultproc_t eachresult; /* call with each result obtained */ { - extern mutex_t tsd_lock; if (thr_main()) clnt_broadcast_result_main = eachresult; diff --git a/lib/libc/rpc/rpcb_clnt.c b/lib/libc/rpc/rpcb_clnt.c index d92115814c7e..ac34c3454394 100644 --- a/lib/libc/rpc/rpcb_clnt.c +++ b/lib/libc/rpc/rpcb_clnt.c @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" static struct timeval tottimeout = { 60, 0 }; static const struct timeval rmttimeout = { 3, 0 }; @@ -165,7 +166,6 @@ __rpc_control(request, info) * block all clnt_create's if we are trying to connect to a host that's down, * since the lock will be held all during that time. */ -extern rwlock_t rpcbaddr_cache_lock; /* * The routines check_cache(), add_cache(), delete_cache() manage the @@ -448,7 +448,6 @@ local_rpcb() CLIENT *client; static struct netconfig *loopnconf; static char *hostname; - extern mutex_t loopnconf_lock; int sock; size_t tsize; struct netbuf nbuf; @@ -675,7 +674,7 @@ got_entry(relp, nconf) * Quick check to see if rpcbind is up. Tries to connect over * local transport. */ -bool_t +static bool_t __rpcbind_is_up() { struct netconfig *nconf; diff --git a/lib/libc/rpc/svc.c b/lib/libc/rpc/svc.c index 4241eecf07cd..b924bdec7847 100644 --- a/lib/libc/rpc/svc.c +++ b/lib/libc/rpc/svc.c @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" #define RQCRED_SIZE 400 /* this size is excessive */ @@ -84,9 +85,6 @@ static struct svc_callout { void (*sc_dispatch)(struct svc_req *, SVCXPRT *); } *svc_head; -extern rwlock_t svc_lock; -extern rwlock_t svc_fd_lock; - static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *); static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock); diff --git a/lib/libc/rpc/svc_auth.c b/lib/libc/rpc/svc_auth.c index 05202d094ec2..eb1a5f2f4a93 100644 --- a/lib/libc/rpc/svc_auth.c +++ b/lib/libc/rpc/svc_auth.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" /* * svcauthsw is the bdevsw of server side authentication. @@ -100,7 +101,6 @@ _authenticate(rqst, msg) int cred_flavor; struct authsvc *asp; enum auth_stat dummy; - extern mutex_t authsvc_lock; /* VARIABLES PROTECTED BY authsvc_lock: asp, Auths */ @@ -172,7 +172,6 @@ svc_auth_reg(cred_flavor, handler) enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *); { struct authsvc *asp; - extern mutex_t authsvc_lock; switch (cred_flavor) { case AUTH_NULL: diff --git a/lib/libc/rpc/svc_dg.c b/lib/libc/rpc/svc_dg.c index 14e927c5a33c..1c602bc57ed2 100644 --- a/lib/libc/rpc/svc_dg.c +++ b/lib/libc/rpc/svc_dg.c @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" #define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) #define rpc_buffer(xprt) ((xprt)->xp_p1) @@ -306,7 +307,6 @@ svc_dg_ops(xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ @@ -392,8 +392,6 @@ struct cl_cache { (xid % (SPARSENESS * ((struct cl_cache *) \ su_data(transp)->su_cache)->uc_size)) -extern mutex_t dupreq_lock; - /* * Enable use of the cache. Returns 1 on success, 0 on failure. * Note: there is no disable. diff --git a/lib/libc/rpc/svc_generic.c b/lib/libc/rpc/svc_generic.c index 6df52e686ef2..7f6cfb84eaeb 100644 --- a/lib/libc/rpc/svc_generic.c +++ b/lib/libc/rpc/svc_generic.c @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" extern int __svc_vc_setflag(SVCXPRT *, int); @@ -89,7 +90,6 @@ svc_create(dispatch, prognum, versnum, nettype) SVCXPRT *xprt; struct netconfig *nconf; void *handle; - extern mutex_t xprtlist_lock; /* VARIABLES PROTECTED BY xprtlist_lock: xprtlist */ diff --git a/lib/libc/rpc/svc_raw.c b/lib/libc/rpc/svc_raw.c index ba5b0170f2a1..32d1ff765b23 100644 --- a/lib/libc/rpc/svc_raw.c +++ b/lib/libc/rpc/svc_raw.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "un-namespace.h" +#include "mt_misc.h" #ifndef UDPMSGSIZE #define UDPMSGSIZE 8800 @@ -70,8 +71,6 @@ static struct svc_raw_private { char verf_body[MAX_AUTH_BYTES]; } *svc_raw_private; -extern mutex_t svcraw_lock; - static enum xprt_stat svc_raw_stat(SVCXPRT *); static bool_t svc_raw_recv(SVCXPRT *, struct rpc_msg *); static bool_t svc_raw_reply(SVCXPRT *, struct rpc_msg *); @@ -239,7 +238,6 @@ svc_raw_ops(xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops */ diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index 13ddac86a0a2..b4627d65875b 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -52,13 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include "rpc_com.h" +#include "mt_misc.h" void svc_run() { fd_set readfds, cleanfds; struct timeval timeout; - extern rwlock_t svc_fd_lock; timeout.tv_sec = 30; timeout.tv_usec = 0; @@ -92,8 +92,6 @@ svc_run() void svc_exit() { - extern rwlock_t svc_fd_lock; - rwlock_wrlock(&svc_fd_lock); FD_ZERO(&svc_fdset); rwlock_unlock(&svc_fd_lock); diff --git a/lib/libc/rpc/svc_simple.c b/lib/libc/rpc/svc_simple.c index 2acae4b3a5ff..95d34a60a9fb 100644 --- a/lib/libc/rpc/svc_simple.c +++ b/lib/libc/rpc/svc_simple.c @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" #include "rpc_com.h" +#include "mt_misc.h" static void universal(struct svc_req *, SVCXPRT *); @@ -106,8 +107,6 @@ rpc_reg(prognum, versnum, procnum, progname, inproc, outproc, nettype) struct netconfig *nconf; int done = FALSE; void *handle; - extern mutex_t proglst_lock; - if (procnum == NULLPROC) { @@ -250,7 +249,6 @@ universal(rqstp, transp) char *outdata; char *xdrbuf; struct proglst *pl; - extern mutex_t proglst_lock; /* * enforce "procnum 0 is echo" convention diff --git a/lib/libc/rpc/svc_vc.c b/lib/libc/rpc/svc_vc.c index 35846946479d..50c66512bed2 100644 --- a/lib/libc/rpc/svc_vc.c +++ b/lib/libc/rpc/svc_vc.c @@ -68,10 +68,9 @@ __FBSDID("$FreeBSD$"); #include #include "rpc_com.h" +#include "mt_misc.h" #include "un-namespace.h" -extern rwlock_t svc_fd_lock; - static SVCXPRT *makefd_xprt(int, u_int, u_int); static bool_t rendezvous_request(SVCXPRT *, struct rpc_msg *); static enum xprt_stat rendezvous_stat(SVCXPRT *); @@ -672,7 +671,6 @@ svc_vc_ops(xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; - extern mutex_t ops_lock; /* VARIABLES PROTECTED BY ops_lock: ops, ops2 */ @@ -697,7 +695,6 @@ svc_vc_rendezvous_ops(xprt) { static struct xp_ops ops; static struct xp_ops2 ops2; - extern mutex_t ops_lock; mutex_lock(&ops_lock); if (ops.xp_recv == NULL) {