summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2004-11-18 15:09:08 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2004-11-18 15:09:08 +0000
commit68e96d160057e41e02c2d54230b19169a52855d0 (patch)
tree4a957da2eb098b29c1faec2892a441000679d3db
parente7b20798a5fc93df22625ee6ea35a3101b73f017 (diff)
enable receive() accounting and use uio_procp for send() accounting, too
ok deraadt, jared, djm
-rw-r--r--sys/kern/uipc_socket.c8
-rw-r--r--sys/nfs/krpc_subr.c3
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index f73e4b93dd8..cddf0d3452f 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.55 2004/09/16 13:11:01 markus Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.56 2004/11/18 15:09:07 markus Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -383,7 +383,6 @@ sosend(so, addr, uio, top, control, flags)
struct mbuf *control;
int flags;
{
- struct proc *p = curproc; /* XXX */
struct mbuf **mp;
struct mbuf *m;
long space, len, mlen, clen = 0;
@@ -411,7 +410,8 @@ sosend(so, addr, uio, top, control, flags)
dontroute =
(flags & MSG_DONTROUTE) && (so->so_options & SO_DONTROUTE) == 0 &&
(so->so_proto->pr_flags & PR_ATOMIC);
- p->p_stats->p_ru.ru_msgsnd++;
+ if (uio && uio->uio_procp)
+ uio->uio_procp->p_stats->p_ru.ru_msgsnd++;
if (control)
clen = control->m_len;
#define snderr(errno) { error = errno; splx(s); goto release; }
@@ -682,10 +682,8 @@ dontblock:
* While we process the initial mbufs containing address and control
* info, we save a copy of m->m_nextpkt into nextrecord.
*/
-#ifdef notyet /* XXXX */
if (uio->uio_procp)
uio->uio_procp->p_stats->p_ru.ru_msgrcv++;
-#endif
KASSERT(m == so->so_rcv.sb_mb);
SBLASTRECORDCHK(&so->so_rcv, "soreceive 1");
SBLASTMBUFCHK(&so->so_rcv, "soreceive 1");
diff --git a/sys/nfs/krpc_subr.c b/sys/nfs/krpc_subr.c
index 64e04506828..bcc4da1eedc 100644
--- a/sys/nfs/krpc_subr.c
+++ b/sys/nfs/krpc_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: krpc_subr.c,v 1.12 2001/11/14 23:37:33 mickey Exp $ */
+/* $OpenBSD: krpc_subr.c,v 1.13 2004/11/18 15:09:07 markus Exp $ */
/* $NetBSD: krpc_subr.c,v 1.12.4.1 1996/06/07 00:52:26 cgd Exp $ */
/*
@@ -367,6 +367,7 @@ krpc_call(sa, prog, vers, func, data, from_p, retries)
m = NULL;
}
auio.uio_resid = len = 1<<16;
+ auio.uio_procp = NULL;
rcvflg = 0;
error = soreceive(so, &from, &auio, &m, NULL, &rcvflg);
if (error == EWOULDBLOCK) {