Convert fsync vnode operator implementations and usage from the old `waitfor'
argument and MNT_WAIT/MNT_NOWAIT to `flags' and FSYNC_WAIT.
This commit is contained in:
parent
a32a338757
commit
382743ada3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_subr.c,v 1.87 1998/05/18 14:59:49 pk Exp $ */
|
||||
/* $NetBSD: vfs_subr.c,v 1.88 1998/06/05 20:02:18 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -545,7 +545,7 @@ vinvalbuf(vp, flags, cred, p, slpflag, slptimeo)
|
||||
int s, error;
|
||||
|
||||
if (flags & V_SAVE) {
|
||||
if ((error = VOP_FSYNC(vp, cred, MNT_WAIT, p)) != 0)
|
||||
if ((error = VOP_FSYNC(vp, cred, FSYNC_WAIT, p)) != 0)
|
||||
return (error);
|
||||
if (vp->v_dirtyblkhd.lh_first != NULL)
|
||||
panic("vinvalbuf: dirty bufs");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vfs_syscalls.c,v 1.115 1998/03/27 13:02:21 kleink Exp $ */
|
||||
/* $NetBSD: vfs_syscalls.c,v 1.116 1998/06/05 20:04:15 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -2009,7 +2009,7 @@ sys_fsync(p, v, retval)
|
||||
return (error);
|
||||
vp = (struct vnode *)fp->f_data;
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||
error = VOP_FSYNC(vp, fp->f_cred, MNT_WAIT, p);
|
||||
error = VOP_FSYNC(vp, fp->f_cred, FSYNC_WAIT, p);
|
||||
VOP_UNLOCK(vp, 0);
|
||||
return (error);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: spec_vnops.c,v 1.39 1998/03/01 02:21:34 fvdl Exp $ */
|
||||
/* $NetBSD: spec_vnops.c,v 1.40 1998/06/05 19:53:00 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -465,13 +465,13 @@ spec_fsync(v)
|
||||
struct vop_fsync_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct ucred *a_cred;
|
||||
int a_waitfor;
|
||||
int a_flags;
|
||||
struct proc *a_p;
|
||||
} */ *ap = v;
|
||||
register struct vnode *vp = ap->a_vp;
|
||||
|
||||
if (vp->v_type == VBLK)
|
||||
vflushbuf(vp, ap->a_waitfor == MNT_WAIT);
|
||||
vflushbuf(vp, (ap->a_flags & FSYNC_WAIT) != 0);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_vnops.c,v 1.41 1998/04/11 08:51:12 veego Exp $ */
|
||||
/* $NetBSD: union_vnops.c,v 1.42 1998/06/05 19:53:00 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1994, 1995 Jan-Simon Pendry.
|
||||
@ -1040,7 +1040,7 @@ union_fsync(v)
|
||||
vn_lock(targetvp, LK_EXCLUSIVE | LK_RETRY);
|
||||
else
|
||||
FIXUP(VTOUNION(ap->a_vp));
|
||||
error = VOP_FSYNC(targetvp, ap->a_cred, ap->a_waitfor, p);
|
||||
error = VOP_FSYNC(targetvp, ap->a_cred, ap->a_flags, p);
|
||||
if (dolock)
|
||||
VOP_UNLOCK(targetvp, 0);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msdosfs_vfsops.c,v 1.53 1998/03/01 02:25:11 fvdl Exp $ */
|
||||
/* $NetBSD: msdosfs_vfsops.c,v 1.54 1998/06/05 19:53:00 kleink Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
|
||||
@ -888,7 +888,8 @@ loop:
|
||||
goto loop;
|
||||
continue;
|
||||
}
|
||||
if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(vp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
vput(vp);
|
||||
simple_lock(&mntvnode_slock);
|
||||
@ -897,7 +898,8 @@ loop:
|
||||
/*
|
||||
* Force stale file system control information to be flushed.
|
||||
*/
|
||||
if ((error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(pmp->pm_devvp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
#ifdef QUOTA
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_nqlease.c,v 1.24 1998/03/01 02:24:27 fvdl Exp $ */
|
||||
/* $NetBSD: nfs_nqlease.c,v 1.25 1998/06/05 19:53:01 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -1075,7 +1075,7 @@ nqnfs_clientd(nmp, cred, ncd, flag, argp, p)
|
||||
(void) nqnfs_vacated(vp, cred);
|
||||
} else if (vp->v_type == VREG) {
|
||||
(void) VOP_FSYNC(vp, cred,
|
||||
MNT_WAIT, p);
|
||||
FSYNC_WAIT, p);
|
||||
np->n_flag &= ~NMODIFIED;
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_serv.c,v 1.42 1998/03/01 02:24:28 fvdl Exp $ */
|
||||
/* $NetBSD: nfs_serv.c,v 1.43 1998/06/05 19:53:01 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -3079,7 +3079,7 @@ nfsrv_commit(nfsd, slp, procp, mrq)
|
||||
return (0);
|
||||
}
|
||||
for_ret = VOP_GETATTR(vp, &bfor, cred, procp);
|
||||
error = VOP_FSYNC(vp, cred, MNT_WAIT, procp);
|
||||
error = VOP_FSYNC(vp, cred, FSYNC_WAIT, procp);
|
||||
aft_ret = VOP_GETATTR(vp, &aft, cred, procp);
|
||||
vput(vp);
|
||||
nfsm_reply(NFSX_V3WCCDATA + NFSX_V3WRITEVERF);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_vfsops.c,v 1.72 1998/03/24 13:49:21 fvdl Exp $ */
|
||||
/* $NetBSD: nfs_vfsops.c,v 1.73 1998/06/05 19:53:01 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993, 1995
|
||||
@ -911,7 +911,8 @@ loop:
|
||||
continue;
|
||||
if (vget(vp, LK_EXCLUSIVE))
|
||||
goto loop;
|
||||
error = VOP_FSYNC(vp, cred, waitfor, p);
|
||||
error = VOP_FSYNC(vp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p);
|
||||
if (error)
|
||||
allerror = error;
|
||||
vput(vp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_vnops.c,v 1.91 1998/05/08 18:26:55 kleink Exp $ */
|
||||
/* $NetBSD: nfs_vnops.c,v 1.92 1998/06/05 19:53:02 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -1722,7 +1722,7 @@ nfs_link(v)
|
||||
* doesn't get "out of sync" with the server.
|
||||
* XXX There should be a better way!
|
||||
*/
|
||||
VOP_FSYNC(vp, cnp->cn_cred, MNT_WAIT, cnp->cn_proc);
|
||||
VOP_FSYNC(vp, cnp->cn_cred, FSYNC_WAIT, cnp->cn_proc);
|
||||
|
||||
v3 = NFS_ISV3(vp);
|
||||
nfsstats.rpccnt[NFSPROC_LINK]++;
|
||||
@ -2760,11 +2760,12 @@ nfs_fsync(v)
|
||||
struct vnodeop_desc *a_desc;
|
||||
struct vnode * a_vp;
|
||||
struct ucred * a_cred;
|
||||
int a_waitfor;
|
||||
int a_flags;
|
||||
struct proc * a_p;
|
||||
} */ *ap = v;
|
||||
|
||||
return (nfs_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_p, 1));
|
||||
return (nfs_flush(ap->a_vp, ap->a_cred,
|
||||
(ap->a_flags & FSYNC_WAIT) != 0 ? MNT_WAIT : 0, ap->a_p, 1));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ext2fs_vfsops.c,v 1.11 1998/03/18 15:57:26 bouyer Exp $ */
|
||||
/* $NetBSD: ext2fs_vfsops.c,v 1.12 1998/06/05 19:53:02 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997 Manuel Bouyer.
|
||||
@ -814,7 +814,8 @@ loop:
|
||||
if (error == ENOENT)
|
||||
goto loop;
|
||||
}
|
||||
if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(vp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
VOP_UNLOCK(vp, 0);
|
||||
vrele(vp);
|
||||
@ -824,7 +825,8 @@ loop:
|
||||
/*
|
||||
* Force stale file system control information to be flushed.
|
||||
*/
|
||||
if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(ump->um_devvp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
/*
|
||||
* Write back modified superblock.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ffs_vfsops.c,v 1.34 1998/03/18 15:57:28 bouyer Exp $ */
|
||||
/* $NetBSD: ffs_vfsops.c,v 1.35 1998/06/05 19:53:02 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1991, 1993, 1994
|
||||
@ -802,7 +802,8 @@ loop:
|
||||
goto loop;
|
||||
continue;
|
||||
}
|
||||
if ((error = VOP_FSYNC(vp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(vp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
vput(vp);
|
||||
simple_lock(&mntvnode_slock);
|
||||
@ -811,7 +812,8 @@ loop:
|
||||
/*
|
||||
* Force stale file system control information to be flushed.
|
||||
*/
|
||||
if ((error = VOP_FSYNC(ump->um_devvp, cred, waitfor, p)) != 0)
|
||||
if ((error = VOP_FSYNC(ump->um_devvp, cred,
|
||||
waitfor == MNT_WAIT ? FSYNC_WAIT : 0, p)) != 0)
|
||||
allerror = error;
|
||||
#ifdef QUOTA
|
||||
qsync(mp);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: lfs_vnops.c,v 1.15 1998/03/01 02:23:25 fvdl Exp $ */
|
||||
/* $NetBSD: lfs_vnops.c,v 1.16 1998/06/05 19:53:02 kleink Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1986, 1989, 1991, 1993, 1995
|
||||
@ -241,7 +241,7 @@ lfs_fsync(v)
|
||||
|
||||
TIMEVAL_TO_TIMESPEC(&time, &ts);
|
||||
return (VOP_UPDATE(ap->a_vp, &ts, &ts,
|
||||
ap->a_waitfor == MNT_WAIT ? LFS_SYNC : 0));
|
||||
(ap->a_flags & FSYNC_WAIT) != 0 ? LFS_SYNC : 0)); /* XXX */
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user