summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_socket.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2012-10-18 20:22:17 +0000
committerandre <andre@FreeBSD.org>2012-10-18 20:22:17 +0000
commitbd86ceebe0c287f846f0bc2d526000512434483b (patch)
treefb96372d15866ae09ef05bd56dec10086dd9ae41 /sys/kern/uipc_socket.c
parent1fb45e9f39b637d5b55bf144f243d50b19988a48 (diff)
downloadFreeBSD-src-bd86ceebe0c287f846f0bc2d526000512434483b.zip
FreeBSD-src-bd86ceebe0c287f846f0bc2d526000512434483b.tar.gz
Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within
zero copy specialized sosend_copyin() helper function.
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r--sys/kern/uipc_socket.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 8340e47..7f4106a 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -890,9 +890,7 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space,
long len;
ssize_t resid;
int error;
-#ifdef ZERO_COPY_SOCKETS
int cow_send;
-#endif
*retmp = top = NULL;
mp = &top;
@@ -900,11 +898,8 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space,
resid = uio->uio_resid;
error = 0;
do {
-#ifdef ZERO_COPY_SOCKETS
cow_send = 0;
-#endif /* ZERO_COPY_SOCKETS */
if (resid >= MINCLSIZE) {
-#ifdef ZERO_COPY_SOCKETS
if (top == NULL) {
m = m_gethdr(M_WAITOK, MT_DATA);
m->m_pkthdr.len = 0;
@@ -924,15 +919,6 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space,
m_clget(m, M_WAITOK);
len = min(min(MCLBYTES, resid), *space);
}
-#else /* ZERO_COPY_SOCKETS */
- if (top == NULL) {
- m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR);
- m->m_pkthdr.len = 0;
- m->m_pkthdr.rcvif = NULL;
- } else
- m = m_getcl(M_WAIT, MT_DATA, 0);
- len = min(min(MCLBYTES, resid), *space);
-#endif /* ZERO_COPY_SOCKETS */
} else {
if (top == NULL) {
m = m_gethdr(M_WAIT, MT_DATA);
@@ -957,11 +943,9 @@ sosend_copyin(struct uio *uio, struct mbuf **retmp, int atomic, long *space,
}
*space -= len;
-#ifdef ZERO_COPY_SOCKETS
if (cow_send)
error = 0;
else
-#endif /* ZERO_COPY_SOCKETS */
error = uiomove(mtod(m, void *), (int)len, uio);
resid = uio->uio_resid;
m->m_len = len;
@@ -980,7 +964,7 @@ out:
*retmp = top;
return (error);
}
-#endif /*ZERO_COPY_SOCKETS*/
+#endif /* ZERO_COPY_SOCKETS */
#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT)
OpenPOWER on IntegriCloud