diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-01-11 14:30:25 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-01-11 14:30:25 +0000 |
commit | fe5006b3911a1bf8debd27c9b475e69d6781b88e (patch) | |
tree | f8712588dd5df8c50280b85147888c6e8446874d /sys/kern | |
parent | 6b119c72edce2705c3740cc49b84e597d72110ed (diff) |
Convert infinite sleeps to tsleep_nsec(9).
ok bluhm@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_extent.c | 17 | ||||
-rw-r--r-- | sys/kern/subr_log.c | 5 | ||||
-rw-r--r-- | sys/kern/tty_pty.c | 9 |
3 files changed, 15 insertions, 16 deletions
diff --git a/sys/kern/subr_extent.c b/sys/kern/subr_extent.c index 43e4aa20357..8208e4d1e13 100644 --- a/sys/kern/subr_extent.c +++ b/sys/kern/subr_extent.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_extent.c,v 1.62 2019/09/11 12:30:34 kettenis Exp $ */ +/* $OpenBSD: subr_extent.c,v 1.63 2020/01/11 14:30:24 mpi Exp $ */ /* $NetBSD: subr_extent.c,v 1.7 1996/11/21 18:46:34 cgd Exp $ */ /*- @@ -58,7 +58,7 @@ #define malloc(s, t, flags) malloc(s) #define free(p, t, s) free(p) -#define tsleep(chan, pri, str, timo) (EWOULDBLOCK) +#define tsleep_nsec(c, p, s, t) (EWOULDBLOCK) #define wakeup(chan) ((void)0) struct pool { @@ -489,9 +489,9 @@ extent_alloc_region(struct extent *ex, u_long start, u_long size, int flags) */ if (flags & EX_WAITSPACE) { ex->ex_flags |= EXF_WANTED; - error = tsleep(ex, + error = tsleep_nsec(ex, PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), - "extnt", 0); + "extnt", INFSLP); if (error) return (error); goto alloc_start; @@ -901,8 +901,9 @@ skip: */ if (flags & EX_WAITSPACE) { ex->ex_flags |= EXF_WANTED; - error = tsleep(ex, - PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), "extnt", 0); + error = tsleep_nsec(ex, + PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), + "extnt", INFSLP); if (error) return (error); goto alloc_start; @@ -1140,9 +1141,9 @@ extent_alloc_region_descriptor(struct extent *ex, int flags) if ((flags & EX_WAITOK) == 0) return (NULL); ex->ex_flags |= EXF_FLWANTED; - if (tsleep(&fex->fex_freelist, + if (tsleep_nsec(&fex->fex_freelist, PRIBIO | ((flags & EX_CATCH) ? PCATCH : 0), - "extnt", 0)) + "extnt", INFSLP)) return (NULL); } rp = LIST_FIRST(&fex->fex_freelist); diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index 590f48cb385..78d842b714b 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_log.c,v 1.63 2020/01/08 16:27:41 visa Exp $ */ +/* $OpenBSD: subr_log.c,v 1.64 2020/01/11 14:30:24 mpi Exp $ */ /* $NetBSD: subr_log.c,v 1.11 1996/03/30 22:24:44 christos Exp $ */ /* @@ -205,8 +205,7 @@ logread(dev_t dev, struct uio *uio, int flag) goto out; } logsoftc.sc_state |= LOG_RDWAIT; - error = tsleep(mbp, LOG_RDPRI | PCATCH, - "klog", 0); + error = tsleep_nsec(mbp, LOG_RDPRI | PCATCH, "klog", INFSLP); if (error) goto out; } diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index e30b7cebe5d..4104106c927 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_pty.c,v 1.95 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: tty_pty.c,v 1.96 2020/01/11 14:30:24 mpi Exp $ */ /* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */ /* @@ -477,8 +477,8 @@ ptcread(dev_t dev, struct uio *uio, int flag) return (0); /* EOF */ if (flag & IO_NDELAY) return (EWOULDBLOCK); - error = tsleep(&tp->t_outq.c_cf, TTIPRI | PCATCH, - ttyin, 0); + error = tsleep_nsec(&tp->t_outq.c_cf, TTIPRI | PCATCH, ttyin, + INFSLP); if (error) return (error); } @@ -587,8 +587,7 @@ block: error = EWOULDBLOCK; goto done; } - error = tsleep(&tp->t_rawq.c_cf, TTOPRI | PCATCH, - ttyout, 0); + error = tsleep_nsec(&tp->t_rawq.c_cf, TTOPRI | PCATCH, ttyout, INFSLP); if (error == 0) goto again; |