-/* $OpenBSD: vfs_subr.c,v 1.263 2017/12/11 14:11:22 bluhm Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.264 2017/12/14 20:20:38 deraadt Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
return (0);
}
- if (va->flags & WRITEDEMOTE) {
- vp->v_op = &dead_vops;
- vp->v_tag = VT_NON;
+ /*
+ * If set, this is allowed to ignore vnodes which don't
+ * have changes pending to disk.
+ * XXX Might be nice to check per-fs "inode" flags, but
+ * generally the filesystem is sync'd already, right?
+ */
+ if ((va->flags & IGNORECLEAN) &&
+ LIST_EMPTY(&vp->v_dirtyblkhd))
return (0);
- }
#ifdef DEBUG
if (busyprt)
-/* $OpenBSD: vnode.h,v 1.141 2017/12/11 05:27:40 deraadt Exp $ */
+/* $OpenBSD: vnode.h,v 1.142 2017/12/14 20:20:38 deraadt Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
#define FORCECLOSE 0x0002 /* vflush: force file closeure */
#define WRITECLOSE 0x0004 /* vflush: only close writeable files */
#define DOCLOSE 0x0008 /* vclean: close active files */
-#define WRITEDEMOTE 0x0010 /* vflush: ok if some writes remain */
+#define IGNORECLEAN 0x0010 /* vflush: ignore clean vnodes */
#define V_SAVE 0x0001 /* vinvalbuf: sync file first */
#define V_SAVEMETA 0x0002 /* vinvalbuf: leave indirect blocks */
-/* $OpenBSD: ffs_vfsops.c,v 1.169 2017/12/14 17:25:39 guenther Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.170 2017/12/14 20:20:38 deraadt Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
if (ronly == 0 && (mp->mnt_flag & MNT_RDONLY)) {
/* Flush any dirty data */
- mp->mnt_flag &= ~MNT_RDONLY;
VFS_SYNC(mp, MNT_WAIT, p->p_ucred, p);
- mp->mnt_flag |= MNT_RDONLY;
/*
* Get rid of files open for writing.
*/
flags = WRITECLOSE;
if (args == NULL)
- flags |= WRITEDEMOTE;
+ flags |= IGNORECLEAN;
if (mp->mnt_flag & MNT_FORCE)
flags |= FORCECLOSE;
if (fs->fs_flags & FS_DOSOFTDEP) {
mp->mnt_flag &= ~MNT_SOFTDEP;
} else
error = ffs_flushfiles(mp, flags, p);
+ mp->mnt_flag |= MNT_RDONLY;
ronly = 1;
}