1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Tidy up the zero-copy receive path: Remove an unneeded argument to

uiomoveco() and userspaceco().
This commit is contained in:
Alan Cox 2004-12-08 05:25:08 +00:00
parent 90688d137c
commit 1c4dbedac4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=138539
3 changed files with 6 additions and 11 deletions

View File

@ -211,8 +211,7 @@ uiomove_frombuf(void *buf, int buflen, struct uio *uio)
* Experimental support for zero-copy I/O
*/
static int
userspaceco(void *cp, u_int cnt, struct uio *uio, struct vm_object *obj,
int disposable)
userspaceco(void *cp, u_int cnt, struct uio *uio, int disposable)
{
struct iovec *iov;
int error;
@ -220,7 +219,6 @@ userspaceco(void *cp, u_int cnt, struct uio *uio, struct vm_object *obj,
iov = uio->uio_iov;
if (uio->uio_rw == UIO_READ) {
if ((so_zero_copy_receive != 0)
&& (obj == NULL)
&& ((cnt & PAGE_MASK) == 0)
&& ((((intptr_t) iov->iov_base) & PAGE_MASK) == 0)
&& ((uio->uio_offset & PAGE_MASK) == 0)
@ -254,8 +252,7 @@ userspaceco(void *cp, u_int cnt, struct uio *uio, struct vm_object *obj,
}
int
uiomoveco(void *cp, int n, struct uio *uio, struct vm_object *obj,
int disposable)
uiomoveco(void *cp, int n, struct uio *uio, int disposable)
{
struct iovec *iov;
u_int cnt;
@ -283,7 +280,7 @@ uiomoveco(void *cp, int n, struct uio *uio, struct vm_object *obj,
if (ticks - PCPU_GET(switchticks) >= hogticks)
uio_yield();
error = userspaceco(cp, cnt, uio, obj, disposable);
error = userspaceco(cp, cnt, uio, disposable);
if (error)
return (error);

View File

@ -902,8 +902,7 @@ soreceive_rcvoob(so, uio, flags)
error = uiomoveco(mtod(m, void *),
min(uio->uio_resid, m->m_len),
uio, pg->object,
disposable);
uio, disposable);
} else
#endif /* ZERO_COPY_SOCKETS */
error = uiomove(mtod(m, void *),
@ -1246,7 +1245,7 @@ soreceive(so, psa, uio, mp0, controlp, flagsp)
uio->uio_offset =IDX_TO_OFF(pg->pindex);
error = uiomoveco(mtod(m, char *) + moff,
(int)len, uio,pg->object,
(int)len, uio,
disposable);
} else
#endif /* ZERO_COPY_SOCKETS */

View File

@ -94,8 +94,7 @@ int uiomove(void *cp, int n, struct uio *uio);
int uiomove_frombuf(void *buf, int buflen, struct uio *uio);
int uiomove_fromphys(struct vm_page *ma[], vm_offset_t offset, int n,
struct uio *uio);
int uiomoveco(void *cp, int n, struct uio *uio, struct vm_object *obj,
int disposable);
int uiomoveco(void *cp, int n, struct uio *uio, int disposable);
#else /* !_KERNEL */