Author: mjg
Date: Thu Nov 19 08:16:45 2020
New Revision: 367835
URL: https://svnweb.freebsd.org/changeset/base/367835

Log:
  pipe: tidy up pipelock

Modified:
  head/sys/kern/sys_pipe.c

Modified: head/sys/kern/sys_pipe.c
==============================================================================
--- head/sys/kern/sys_pipe.c    Thu Nov 19 07:23:39 2020        (r367834)
+++ head/sys/kern/sys_pipe.c    Thu Nov 19 08:16:45 2020        (r367835)
@@ -614,14 +614,17 @@ pipespace(struct pipe *cpipe, int size)
 static __inline int
 pipelock(struct pipe *cpipe, int catch)
 {
-       int error;
+       int error, prio;
 
        PIPE_LOCK_ASSERT(cpipe, MA_OWNED);
+
+       prio = PRIBIO;
+       if (catch)
+               prio |= PCATCH;
        while (cpipe->pipe_state & PIPE_LOCKFL) {
                cpipe->pipe_state |= PIPE_LWANT;
                error = msleep(cpipe, PIPE_MTX(cpipe),
-                   catch ? (PRIBIO | PCATCH) : PRIBIO,
-                   "pipelk", 0);
+                   prio, "pipelk", 0);
                if (error != 0)
                        return (error);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to