diff options
author | sam <sam@FreeBSD.org> | 2003-11-07 22:57:09 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-11-07 22:57:09 +0000 |
commit | 3eac15aaa3639582c3322e6618f161330a3cd761 (patch) | |
tree | 155ef0fdfb8e324ae21ca64209357e0bad83e00e /sys/nfsclient | |
parent | 866f946f371c2b4d26a0fe2566bc63f5245ddb2e (diff) | |
download | FreeBSD-src-3eac15aaa3639582c3322e6618f161330a3cd761.zip FreeBSD-src-3eac15aaa3639582c3322e6618f161330a3cd761.tar.gz |
Assert GIANT_REQUIRED where sockets are manipulated. This is
preparatory for MPSAFE network commits and ongoing socket
locking work.
Supported by: FreeBSD Foundation
Diffstat (limited to 'sys/nfsclient')
-rw-r--r-- | sys/nfsclient/bootp_subr.c | 4 | ||||
-rw-r--r-- | sys/nfsclient/krpc_subr.c | 2 | ||||
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 8 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 2 |
4 files changed, 16 insertions, 0 deletions
diff --git a/sys/nfsclient/bootp_subr.c b/sys/nfsclient/bootp_subr.c index 957b360..51a618e 100644 --- a/sys/nfsclient/bootp_subr.c +++ b/sys/nfsclient/bootp_subr.c @@ -587,6 +587,8 @@ bootpc_call(struct bootpc_globalcontext *gctx, struct thread *td) int retry; const char *s; + GIANT_REQUIRED; /* XXX until socket locking done */ + /* * Create socket and set its recieve timeout. */ @@ -977,6 +979,8 @@ bootpc_fakeup_interface(struct bootpc_ifcontext *ifctx, struct ifaddr *ifa; struct sockaddr_dl *sdl; + GIANT_REQUIRED; /* XXX until socket locking done */ + error = socreate(AF_INET, &ifctx->so, SOCK_DGRAM, 0, td->td_ucred, td); if (error != 0) panic("nfs_boot: socreate, error=%d", error); diff --git a/sys/nfsclient/krpc_subr.c b/sys/nfsclient/krpc_subr.c index ee401a2..b12bbc6 100644 --- a/sys/nfsclient/krpc_subr.c +++ b/sys/nfsclient/krpc_subr.c @@ -213,6 +213,8 @@ krpc_call(struct sockaddr_in *sa, u_int prog, u_int vers, u_int func, nam = mhead = NULL; from = NULL; + GIANT_REQUIRED; /* XXX until socket locking done */ + /* * Create socket and set its recieve timeout. */ diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 43c28d3..9c82759 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -161,6 +161,8 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep) struct sockaddr *saddr; struct thread *td = &thread0; /* only used for socreate and sobind */ + GIANT_REQUIRED; /* XXX until socket locking done */ + nmp->nm_so = NULL; saddr = nmp->nm_nam; error = socreate(saddr->sa_family, &nmp->nm_so, nmp->nm_sotype, @@ -377,6 +379,8 @@ nfs_disconnect(struct nfsmount *nmp) { struct socket *so; + GIANT_REQUIRED; /* XXX until socket locking done */ + if (nmp->nm_so) { so = nmp->nm_so; nmp->nm_so = NULL; @@ -411,6 +415,8 @@ nfs_send(struct socket *so, struct sockaddr *nam, struct mbuf *top, struct sockaddr *sendnam; int error, soflags, flags; + GIANT_REQUIRED; /* XXX until socket locking done */ + KASSERT(rep, ("nfs_send: called with rep == NULL")); if (rep->r_flags & R_SOFTTERM) { @@ -484,6 +490,8 @@ nfs_receive(struct nfsreq *rep, struct sockaddr **aname, struct mbuf **mp) int error, sotype, rcvflg; struct thread *td = curthread; /* XXX */ + GIANT_REQUIRED; /* XXX until socket locking done */ + /* * Set up arguments for soreceive() */ diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 49980cf..81e256d 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -376,6 +376,8 @@ nfs_mountroot(struct mount *mp, struct thread *td) u_long l; char buf[128]; + GIANT_REQUIRED; /* XXX until socket locking done */ + #if defined(BOOTP_NFSROOT) && defined(BOOTP) bootpc_init(); /* use bootp to get nfs_diskless filled in */ #elif defined(NFS_ROOT) |