Make some of this look like UFS again.

This commit is contained in:
mycroft 1994-09-19 19:28:07 +00:00
parent 7087c929e8
commit cb0453c424

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vfsops.c,v 1.20 1994/09/19 19:17:54 mycroft Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.21 1994/09/19 19:28:07 mycroft Exp $ */
/*- /*-
* Copyright (C) 1994 Wolfgang Solfrank. * Copyright (C) 1994 Wolfgang Solfrank.
@ -612,12 +612,10 @@ msdosfs_sync(mp, waitfor, cred, p)
{ {
struct vnode *vp; struct vnode *vp;
struct denode *dep; struct denode *dep;
struct msdosfsmount *pmp; struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
int error; int error;
int allerror = 0; int allerror = 0;
pmp = (struct msdosfsmount *) mp->mnt_data;
/* /*
* If we ever switch to not updating all of the fats all the time, * If we ever switch to not updating all of the fats all the time,
* this would be the place to update them from the first one. * this would be the place to update them from the first one.
@ -628,33 +626,36 @@ msdosfs_sync(mp, waitfor, cred, p)
else { else {
/* update fats here */ /* update fats here */
} }
/* /*
* Go thru in memory denodes and write them out along with * Write back each (modified) denode.
* unwritten file blocks.
*/ */
loop: loop:
for (vp = mp->mnt_vnodelist.lh_first; vp; for (vp = mp->mnt_vnodelist.lh_first;
vp = vp->v_mntvnodes.le_next) { vp != NULL;
if (vp->v_mount != mp) /* not ours anymore */ vp = vp->v_mntvnodes.le_next) {
/*
* If the vnode that we are about to sync is no longer
* assoicated with this mount point, start over.
*/
if (vp->v_mount != mp)
goto loop; goto loop;
if (VOP_ISLOCKED(vp)) /* file is busy */ if (VOP_ISLOCKED(vp))
continue; continue;
dep = VTODE(vp); dep = VTODE(vp);
if ((dep->de_flag & DE_UPDATE) == 0 && if ((dep->de_flag & DE_UPDATE) == 0 &&
vp->v_dirtyblkhd.lh_first == NULL) vp->v_dirtyblkhd.lh_first == NULL)
continue; continue;
if (vget(vp, 1)) /* not there anymore? */ if (vget(vp, 1))
goto loop; goto loop;
if (error = VOP_FSYNC(vp, cred, waitfor, p)) if (error = VOP_FSYNC(vp, cred, waitfor, p))
allerror = error; allerror = error;
vput(vp); /* done with this one */ vput(vp);
} }
/* /*
* Flush filesystem control info. * Force stale file system control information to be flushed.
*/ */
vflushbuf(pmp->pm_devvp, waitfor == MNT_WAIT ? B_SYNC : 0); if (error = VOP_FSYNC(pmp->pm_devvp, cred, waitfor, p))
allerror = error;
return allerror; return allerror;
} }