summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2019-07-19 00:55:00 +0000
committercheloha <cheloha@cvs.openbsd.org>2019-07-19 00:55:00 +0000
commit7263f55befbf6ca97e11f606962ac7d89fd93b4e (patch)
tree232c3e676706c88d2d1eb5ae1c7cd79f4e41bf8a /sys
parenta329fbc6fd800a0e08888634a811fc200f33fbaa (diff)
vwaitforio(9): tsleep(9) -> tsleep_nsec(9); ok visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/spec_vnops.c4
-rw-r--r--sys/kern/vfs_subr.c10
-rw-r--r--sys/nfs/nfs_vnops.c13
-rw-r--r--sys/sys/vnode.h4
-rw-r--r--sys/ufs/ffs/ffs_vnops.c4
5 files changed, 18 insertions, 17 deletions
diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c
index 1c455186a3d..9d31d42fe5a 100644
--- a/sys/kern/spec_vnops.c
+++ b/sys/kern/spec_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_vnops.c,v 1.95 2018/07/07 15:41:25 visa Exp $ */
+/* $OpenBSD: spec_vnops.c,v 1.96 2019/07/19 00:54:59 cheloha Exp $ */
/* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */
/*
@@ -441,7 +441,7 @@ loop:
goto loop;
}
if (ap->a_waitfor == MNT_WAIT) {
- vwaitforio (vp, 0, "spec_fsync", 0);
+ vwaitforio (vp, 0, "spec_fsync", INFSLP);
#ifdef DIAGNOSTIC
if (!LIST_EMPTY(&vp->v_dirtyblkhd)) {
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index a6ecfe2e92e..55ff411a6f1 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.290 2019/06/28 13:25:09 visa Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.291 2019/07/19 00:54:59 cheloha Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1858,7 +1858,7 @@ fs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
* Manipulates v_numoutput. Must be called at splbio()
*/
int
-vwaitforio(struct vnode *vp, int slpflag, char *wmesg, int timeo)
+vwaitforio(struct vnode *vp, int slpflag, char *wmesg, uint64_t timeo)
{
int error = 0;
@@ -1866,7 +1866,7 @@ vwaitforio(struct vnode *vp, int slpflag, char *wmesg, int timeo)
while (vp->v_numoutput) {
vp->v_bioflag |= VBIOWAIT;
- error = tsleep(&vp->v_numoutput,
+ error = tsleep_nsec(&vp->v_numoutput,
slpflag | (PRIBIO + 1), wmesg, timeo);
if (error)
break;
@@ -1914,7 +1914,7 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, struct proc *p,
if (flags & V_SAVE) {
s = splbio();
- vwaitforio(vp, 0, "vinvalbuf", 0);
+ vwaitforio(vp, 0, "vinvalbuf", INFSLP);
if (!LIST_EMPTY(&vp->v_dirtyblkhd)) {
splx(s);
if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) != 0)
@@ -2026,7 +2026,7 @@ loop:
splx(s);
return;
}
- vwaitforio(vp, 0, "vflushbuf", 0);
+ vwaitforio(vp, 0, "vflushbuf", INFSLP);
if (!LIST_EMPTY(&vp->v_dirtyblkhd)) {
splx(s);
#ifdef DIAGNOSTIC
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 5a4544898d1..35bef8a1bba 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.180 2019/01/18 13:40:34 bluhm Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.181 2019/07/19 00:54:59 cheloha Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2845,7 +2845,8 @@ nfs_flush(struct vnode *vp, struct ucred *cred, int waitfor, struct proc *p,
int i;
struct buf *nbp;
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
- int s, error = 0, slptimeo = 0, slpflag = 0, retv, bvecpos;
+ uint64_t slptimeo = INFSLP;
+ int s, error = 0, slpflag = 0, retv, bvecpos;
int passone = 1;
u_quad_t off = (u_quad_t)-1, endoff = 0, toff;
#ifndef NFS_COMMITBVECSIZ
@@ -2942,15 +2943,15 @@ loop:
if (waitfor != MNT_WAIT || passone)
continue;
bp->b_flags |= B_WANTED;
- error = tsleep(bp, slpflag | (PRIBIO + 1),
- "nfsfsync", slptimeo);
+ error = tsleep_nsec(bp, slpflag | (PRIBIO + 1),
+ "nfsfsync", slptimeo);
splx(s);
if (error) {
if (nfs_sigintr(nmp, NULL, p))
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
- slptimeo = 2 * hz;
+ slptimeo = SEC_TO_NSEC(2);
}
}
goto loop;
@@ -2985,7 +2986,7 @@ loop:
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
- slptimeo = 2 * hz;
+ slptimeo = SEC_TO_NSEC(2);
}
goto loop2;
}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index c7d6964d056..1117e6e892f 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnode.h,v 1.150 2019/02/17 22:17:28 tedu Exp $ */
+/* $OpenBSD: vnode.h,v 1.151 2019/07/19 00:54:59 cheloha Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
@@ -600,7 +600,7 @@ void vgonel(struct vnode *, struct proc *);
int vinvalbuf(struct vnode *, int, struct ucred *, struct proc *,
int, int);
void vntblinit(void);
-int vwaitforio(struct vnode *, int, char *, int);
+int vwaitforio(struct vnode *, int, char *, uint64_t);
void vwakeup(struct vnode *);
void vput(struct vnode *);
int vrecycle(struct vnode *, struct proc *);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index f5cf41063c6..1bb581fb5b7 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vnops.c,v 1.93 2018/12/23 10:46:51 natano Exp $ */
+/* $OpenBSD: ffs_vnops.c,v 1.94 2019/07/19 00:54:59 cheloha Exp $ */
/* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */
/*
@@ -486,7 +486,7 @@ loop:
goto loop;
}
if (ap->a_waitfor == MNT_WAIT) {
- vwaitforio(vp, 0, "ffs_fsync", 0);
+ vwaitforio(vp, 0, "ffs_fsync", INFSLP);
/*
* Ensure that any filesystem metadata associated