From a05cae5186410cda1f92384058df416f17744fac Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Thu, 28 Aug 2008 19:34:58 +0000 Subject: [PATCH] Make ureadc() warn when holding any locks, just like uiomove(). A couple of months ago I was quite impressed, because when I was writing code, I discovered that uiomove() would not allow any locks to be held, while ureadc() did, mainly because ureadc() is implemented using the same building blocks as uiomove(). Let's see if this triggers any aditional witness warnings on our source tree. Reviewed by: atillio --- sys/kern/kern_subr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index c93f262626e..ce1afd24304 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -325,6 +325,9 @@ ureadc(int c, struct uio *uio) struct iovec *iov; char *iov_base; + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "Calling ureadc()"); + again: if (uio->uio_iovcnt == 0 || uio->uio_resid == 0) panic("ureadc");