From 8000a91d499119f947c1c2a191f7ec2946392ec2 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 14 Jan 2005 08:09:42 +0000 Subject: Eliminate constant and unused arguments to nwfs_vinvalbuf() --- sys/fs/nwfs/nwfs.h | 3 +-- sys/fs/nwfs/nwfs_io.c | 28 +++++++++------------------- sys/fs/nwfs/nwfs_node.c | 2 +- sys/fs/nwfs/nwfs_vnops.c | 6 +++--- 4 files changed, 14 insertions(+), 25 deletions(-) (limited to 'sys') diff --git a/sys/fs/nwfs/nwfs.h b/sys/fs/nwfs/nwfs.h index 3b25998..d7b2f62 100644 --- a/sys/fs/nwfs/nwfs.h +++ b/sys/fs/nwfs/nwfs.h @@ -76,8 +76,7 @@ struct nwmount { int ncp_conn_logged_in(struct nwmount *); int nwfs_ioctl(struct vop_ioctl_args *ap); int nwfs_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td); -int nwfs_vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, - struct thread *td, int intrflg); +int nwfs_vinvalbuf(struct vnode *vp, struct thread *td); extern struct vop_vector nwfs_vnodeops; diff --git a/sys/fs/nwfs/nwfs_io.c b/sys/fs/nwfs/nwfs_io.c index 5d51754..56d5949 100644 --- a/sys/fs/nwfs/nwfs_io.c +++ b/sys/fs/nwfs/nwfs_io.c @@ -185,7 +185,7 @@ nwfs_readvnode(struct vnode *vp, struct uio *uiop, struct ucred *cred) { error = VOP_GETATTR(vp, &vattr, cred, td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, td); if (error) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -219,7 +219,7 @@ nwfs_writevnode(vp, uiop, cred, ioflag) if (ioflag & (IO_APPEND | IO_SYNC)) { if (np->n_flag & NMODIFIED) { nwfs_attr_cacheremove(vp); - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, td); if (error) return (error); } if (ioflag & IO_APPEND) { @@ -592,38 +592,28 @@ nwfs_putpages(ap) * doing the flush, just wait for completion. */ int -nwfs_vinvalbuf(vp, flags, cred, td, intrflg) +nwfs_vinvalbuf(vp, td) struct vnode *vp; - int flags; - struct ucred *cred; struct thread *td; - int intrflg; { struct nwnode *np = VTONW(vp); /* struct nwmount *nmp = VTONWFS(vp);*/ - int error = 0, slpflag, slptimeo; + int error = 0; if (vp->v_iflag & VI_XLOCK) return (0); - if (intrflg) { - slpflag = PCATCH; - slptimeo = 2 * hz; - } else { - slpflag = 0; - slptimeo = 0; - } while (np->n_flag & NFLUSHINPROG) { np->n_flag |= NFLUSHWANT; - error = tsleep(&np->n_flag, PRIBIO + 2, "nwfsvinv", slptimeo); + error = tsleep(&np->n_flag, PRIBIO + 2, "nwfsvinv", 2 * hz); error = ncp_chkintr(NWFSTOCONN(VTONWFS(vp)), td); - if (error == EINTR && intrflg) + if (error == EINTR) return EINTR; } np->n_flag |= NFLUSHINPROG; - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); while (error) { - if (intrflg && (error == ERESTART || error == EINTR)) { + if (error == ERESTART || error == EINTR) { np->n_flag &= ~NFLUSHINPROG; if (np->n_flag & NFLUSHWANT) { np->n_flag &= ~NFLUSHWANT; @@ -631,7 +621,7 @@ nwfs_vinvalbuf(vp, flags, cred, td, intrflg) } return EINTR; } - error = vinvalbuf(vp, flags, td, slpflag, 0); + error = vinvalbuf(vp, V_SAVE, td, PCATCH, 0); } np->n_flag &= ~(NMODIFIED | NFLUSHINPROG); if (np->n_flag & NFLUSHWANT) { diff --git a/sys/fs/nwfs/nwfs_node.c b/sys/fs/nwfs/nwfs_node.c index 5b2d120..31c1944 100644 --- a/sys/fs/nwfs/nwfs_node.c +++ b/sys/fs/nwfs/nwfs_node.c @@ -292,7 +292,7 @@ nwfs_inactive(ap) NCPVNDEBUG("%s: %d\n", VTONW(vp)->n_name, vrefcnt(vp)); if (np->opened) { - error = nwfs_vinvalbuf(vp, V_SAVE, cred, td, 1); + error = nwfs_vinvalbuf(vp, td); error = ncp_close_file(NWFSTOCONN(VTONWFS(vp)), &np->n_fh, td, cred); np->opened = 0; } diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c index 95be2a7..6f719f1 100644 --- a/sys/fs/nwfs/nwfs_vnops.c +++ b/sys/fs/nwfs/nwfs_vnops.c @@ -172,7 +172,7 @@ nwfs_open(ap) } if (vp->v_type == VDIR) return 0; /* nothing to do now */ if (np->n_flag & NMODIFIED) { - if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR) return (error); np->n_atime = 0; error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); @@ -182,7 +182,7 @@ nwfs_open(ap) error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_td); if (error) return (error); if (np->n_mtime != vattr.va_mtime.tv_sec) { - if ((error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1)) == EINTR) + if ((error = nwfs_vinvalbuf(vp, ap->a_td)) == EINTR) return (error); np->n_mtime = vattr.va_mtime.tv_sec; } @@ -237,7 +237,7 @@ nwfs_close(ap) return 0; } mtx_unlock(&vp->v_interlock); - error = nwfs_vinvalbuf(vp, V_SAVE, ap->a_cred, ap->a_td, 1); + error = nwfs_vinvalbuf(vp, ap->a_td); mtx_lock(&vp->v_interlock); if (np->opened == 0) { mtx_unlock(&vp->v_interlock); -- cgit v1.1