summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-11-25 11:33:51 +0000
committermpi <mpi@openbsd.org>2019-11-25 11:33:51 +0000
commit517561b52fe751a10fca95fbf09e6e9f631b188e (patch)
tree007a11b6ac170f5e7c1b8599425bb08eb33450af /sys/ufs
parentConvert to tsleep_nsec(9) and use the correct timeout period in msec. (diff)
downloadwireguard-openbsd-517561b52fe751a10fca95fbf09e6e9f631b188e.tar.xz
wireguard-openbsd-517561b52fe751a10fca95fbf09e6e9f631b188e.zip
Convert infinite sleeps to tsleep_nsec(9).
ok bluhm@, cheloha@
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_softdep.c10
-rw-r--r--sys/ufs/mfs/mfs_vfsops.c4
-rw-r--r--sys/ufs/ufs/ufs_quota.c16
3 files changed, 15 insertions, 15 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index edf206c1713..bde1bcc82ad 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_softdep.c,v 1.144 2019/07/19 00:24:31 cheloha Exp $ */
+/* $OpenBSD: ffs_softdep.c,v 1.145 2019/11/25 11:33:51 mpi Exp $ */
/*
* Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved.
@@ -852,7 +852,7 @@ softdep_flushworklist(struct mount *oldmnt, int *countp, struct proc *p)
*/
while (softdep_worklist_busy) {
softdep_worklist_req += 1;
- tsleep(&softdep_worklist_req, PRIBIO, "softflush", 0);
+ tsleep_nsec(&softdep_worklist_req, PRIBIO, "softflush", INFSLP);
softdep_worklist_req -= 1;
}
softdep_worklist_busy = -1;
@@ -5312,7 +5312,7 @@ request_cleanup(int resource, int islocked)
timeout_add(&proc_waiting_timeout, tickdelay > 2 ? tickdelay : 2);
s = FREE_LOCK_INTERLOCKED(&lk);
- (void) tsleep((caddr_t)&proc_waiting, PPAUSE, "softupdate", 0);
+ tsleep_nsec(&proc_waiting, PPAUSE, "softupdate", INFSLP);
ACQUIRE_LOCK_INTERLOCKED(&lk, s);
proc_waiting -= 1;
if (islocked == 0)
@@ -5574,7 +5574,7 @@ getdirtybuf(struct buf *bp, int waitfor)
return (0);
bp->b_flags |= B_WANTED;
s = FREE_LOCK_INTERLOCKED(&lk);
- tsleep((caddr_t)bp, PRIBIO + 1, "sdsdty", 0);
+ tsleep_nsec(bp, PRIBIO+1, "sdsdty", INFSLP);
ACQUIRE_LOCK_INTERLOCKED(&lk, s);
return (-1);
}
@@ -5602,7 +5602,7 @@ drain_output(struct vnode *vp, int islocked)
while (vp->v_numoutput) {
vp->v_bioflag |= VBIOWAIT;
s = FREE_LOCK_INTERLOCKED(&lk);
- tsleep((caddr_t)&vp->v_numoutput, PRIBIO + 1, "drain_output", 0);
+ tsleep_nsec(&vp->v_numoutput, PRIBIO+1, "drain_output", INFSLP);
ACQUIRE_LOCK_INTERLOCKED(&lk, s);
}
if (!islocked)
diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c
index cb4ca90a741..ff3bc46102b 100644
--- a/sys/ufs/mfs/mfs_vfsops.c
+++ b/sys/ufs/mfs/mfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfs_vfsops.c,v 1.55 2017/12/11 05:27:40 deraadt Exp $ */
+/* $OpenBSD: mfs_vfsops.c,v 1.56 2019/11/25 11:33:51 mpi Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.10 1996/02/09 22:31:28 christos Exp $ */
/*
@@ -196,7 +196,7 @@ mfs_start(struct mount *mp, int flags, struct proc *p)
sleepreturn = 0;
continue;
}
- sleepreturn = tsleep(vp, PWAIT | PCATCH, "mfsidl", 0);
+ sleepreturn = tsleep_nsec(vp, PWAIT | PCATCH, "mfsidl", INFSLP);
}
return (0);
}
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index 53d27d8b92f..2db8696154a 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_quota.c,v 1.45 2019/10/06 16:24:14 beck Exp $ */
+/* $OpenBSD: ufs_quota.c,v 1.46 2019/11/25 11:33:51 mpi Exp $ */
/* $NetBSD: ufs_quota.c,v 1.8 1996/02/09 22:36:09 christos Exp $ */
/*
@@ -212,7 +212,7 @@ ufs_quota_alloc_blocks2(struct inode *ip, daddr_t change,
continue;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "chkdq", 0);
+ tsleep_nsec(dq, PINOD+1, "chkdq", INFSLP);
}
dq->dq_curblocks += change;
dq->dq_flags |= DQ_MOD;
@@ -242,7 +242,7 @@ ufs_quota_free_blocks2(struct inode *ip, daddr_t change,
continue;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "chkdq", 0);
+ tsleep_nsec(dq, PINOD+1, "chkdq", INFSLP);
}
if (dq->dq_curblocks >= change)
dq->dq_curblocks -= change;
@@ -338,7 +338,7 @@ ufs_quota_alloc_inode2(struct inode *ip, struct ucred *cred,
continue;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "chkiq", 0);
+ tsleep_nsec(dq, PINOD+1, "chkiq", INFSLP);
}
dq->dq_curinodes++;
dq->dq_flags |= DQ_MOD;
@@ -365,7 +365,7 @@ ufs_quota_free_inode2(struct inode *ip, struct ucred *cred,
continue;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "chkiq", 0);
+ tsleep_nsec(dq, PINOD+1, "chkiq", INFSLP);
}
if (dq->dq_curinodes > 0)
dq->dq_curinodes--;
@@ -667,7 +667,7 @@ setquota(struct mount *mp, u_long id, int type, caddr_t addr)
dq = ndq;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "setquota", 0);
+ tsleep_nsec(dq, PINOD+1, "setquota", INFSLP);
}
/*
* Copy all but the current values.
@@ -731,7 +731,7 @@ setuse(struct mount *mp, u_long id, int type, caddr_t addr)
dq = ndq;
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+1, "setuse", 0);
+ tsleep_nsec(dq, PINOD+1, "setuse", INFSLP);
}
/*
* Reset time limit if have a soft limit and were
@@ -990,7 +990,7 @@ dqsync(struct vnode *vp, struct dquot *dq)
vn_lock(dqvp, LK_EXCLUSIVE | LK_RETRY);
while (dq->dq_flags & DQ_LOCK) {
dq->dq_flags |= DQ_WANT;
- (void) tsleep(dq, PINOD+2, "dqsync", 0);
+ tsleep_nsec(dq, PINOD+2, "dqsync", INFSLP);
if ((dq->dq_flags & DQ_MOD) == 0) {
if (vp != dqvp)
VOP_UNLOCK(dqvp);