+void
+lfs_writevnodes(fs, mp, sp, dirops)
+ struct lfs *fs;
+ struct mount *mp;
+ struct segment *sp;
+ int dirops;
+{
+ struct inode *ip;
+ struct vnode *vp;
+ int error, s;
+
+loop: for (vp = mp->mnt_mounth; vp; vp = vp->v_mountf) {
+ /*
+ * If the vnode that we are about to sync is no longer
+ * associated with this mount point, start over.
+ */
+ if (vp->v_mount != mp)
+ goto loop;
+
+ if (dirops && !(vp->v_flag & VDIROP) ||
+ !dirops && (vp->v_flag & VDIROP))
+ continue;
+ /*
+ * XXX
+ * Up the ref count so we don't get tossed out of
+ * memory.
+ */
+ VREF(vp);
+
+ /*
+ * Write the inode/file if dirty and it's not the
+ * the IFILE.
+ */
+ ip = VTOI(vp);
+ if ((ip->i_flag & (IMOD | IACC | IUPD | ICHG) ||
+ vp->v_dirtyblkhd != NULL) &&
+ ip->i_number != LFS_IFILE_INUM) {
+ if (vp->v_dirtyblkhd != NULL)
+ lfs_writefile(fs, sp, vp);
+ (void) lfs_writeinode(fs, sp, ip);
+ }
+ vp->v_flag &= ~VDIROP;
+ vrele(vp);
+ }
+}
+