diff options
author | rwatson <rwatson@FreeBSD.org> | 2006-07-24 15:20:08 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2006-07-24 15:20:08 +0000 |
commit | 40868fda8a777cd2639ad89e252401b8b27c8c91 (patch) | |
tree | b3a0ac6c1795bad8df68bc26486cfcd7d7e796ec /sys/netsmb | |
parent | 0dd0f8ec80a478a694b1ee6de99c7b84a2d3aa2b (diff) | |
download | FreeBSD-src-40868fda8a777cd2639ad89e252401b8b27c8c91.zip FreeBSD-src-40868fda8a777cd2639ad89e252401b8b27c8c91.tar.gz |
soreceive_generic(), and sopoll_generic(). Add new functions sosend(),
soreceive(), and sopoll(), which are wrappers for pru_sosend,
pru_soreceive, and pru_sopoll, and are now used univerally by socket
consumers rather than either directly invoking the old so*() functions
or directly invoking the protocol switch method (about an even split
prior to this commit).
This completes an architectural change that was begun in 1996 to permit
protocols to provide substitute implementations, as now used by UDP.
Consumers now uniformly invoke sosend(), soreceive(), and sopoll() to
perform these operations on sockets -- in particular, distributed file
systems and socket system calls.
Architectural head nod: sam, gnn, wollman
Diffstat (limited to 'sys/netsmb')
-rw-r--r-- | sys/netsmb/smb_trantcp.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/sys/netsmb/smb_trantcp.c b/sys/netsmb/smb_trantcp.c index 6c17e5d..4c273cd 100644 --- a/sys/netsmb/smb_trantcp.c +++ b/sys/netsmb/smb_trantcp.c @@ -75,8 +75,7 @@ SYSCTL_DECL(_net_smb); SYSCTL_INT(_net_smb, OID_AUTO, tcpsndbuf, CTLFLAG_RW, &smb_tcpsndbuf, 0, ""); SYSCTL_INT(_net_smb, OID_AUTO, tcprcvbuf, CTLFLAG_RW, &smb_tcprcvbuf, 0, ""); -#define nb_sosend(so,m,flags,td) (so)->so_proto->pr_usrreqs->pru_sosend( \ - so, NULL, 0, m, 0, flags, td) +#define nb_sosend(so,m,flags,td) sosend(so, NULL, 0, m, 0, flags, td) static int nbssn_recv(struct nbpcb *nbp, struct mbuf **mpp, int *lenp, u_int8_t *rpcodep, struct thread *td); @@ -98,8 +97,7 @@ nb_setsockopt_int(struct socket *so, int level, int name, int val) static __inline int nb_poll(struct nbpcb *nbp, int events, struct thread *td) { - return nbp->nbp_tso->so_proto->pr_usrreqs->pru_sopoll(nbp->nbp_tso, - events, NULL, td); + return sopoll(nbp->nbp_tso, events, NULL, td); } static int @@ -377,8 +375,7 @@ nbssn_recvhdr(struct nbpcb *nbp, int *lenp, auio.uio_offset = 0; auio.uio_resid = sizeof(len); auio.uio_td = td; - error = so->so_proto->pr_usrreqs->pru_soreceive - (so, (struct sockaddr **)NULL, &auio, + error = soreceive(so, (struct sockaddr **)NULL, &auio, (struct mbuf **)NULL, (struct mbuf **)NULL, &flags); if (error) return error; @@ -461,8 +458,7 @@ nbssn_recv(struct nbpcb *nbp, struct mbuf **mpp, int *lenp, */ do { rcvflg = MSG_WAITALL; - error = so->so_proto->pr_usrreqs->pru_soreceive - (so, (struct sockaddr **)NULL, + error = soreceive(so, (struct sockaddr **)NULL, &auio, &tm, (struct mbuf **)NULL, &rcvflg); } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); |