diff options
-rw-r--r-- | share/man/man9/vwaitforio.9 | 13 | ||||
-rw-r--r-- | sys/kern/spec_vnops.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 10 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 13 | ||||
-rw-r--r-- | sys/sys/vnode.h | 4 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_vnops.c | 4 |
6 files changed, 27 insertions, 21 deletions
diff --git a/share/man/man9/vwaitforio.9 b/share/man/man9/vwaitforio.9 index 009471e5c74..e7b72526ab6 100644 --- a/share/man/man9/vwaitforio.9 +++ b/share/man/man9/vwaitforio.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: vwaitforio.9,v 1.15 2019/03/10 21:31:49 jmc Exp $ +.\" $OpenBSD: vwaitforio.9,v 1.16 2019/07/19 00:54:58 cheloha Exp $ .\" .\" Copyright (c) 2001 Constantine Sapuntzakis .\" All rights reserved. @@ -23,7 +23,7 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 10 2019 $ +.Dd $Mdocdate: July 19 2019 $ .Dt VWAITFORIO 9 .Os .Sh NAME @@ -33,7 +33,12 @@ .In sys/types.h .In sys/vnode.h .Ft int -.Fn vwaitforio "struct vnode *vp" "int slpflag" "char *wmesg" "int slptimeo" +.Fo vwaitforio +.Fa "struct vnode *vp" +.Fa "int slpflag" +.Fa "char *wmesg" +.Fa "uint64_t slptimeo" +.Fc .Sh DESCRIPTION The .Fn vwaitforio @@ -54,7 +59,7 @@ The and .Fa slptimeo arguments indicate flags to be passed to -.Xr tsleep 9 . +.Xr tsleep_nsec 9 . .Pp This function must be called at .Xr splbio 9 . 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 |