aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mount.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-11-05 20:52:49 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-11-05 20:52:49 +0000
commitf10845877e962a7dcdc4cf9b9614bdfcdac46d59 (patch)
treeb495fb0ec206d192cfac4c57740b7b0fd2e09063 /sys/sys/mount.h
parent6a32dae2b755792c6dbb7fa1bc7ee54fdb912dc0 (diff)
downloadsrc-f10845877e962a7dcdc4cf9b9614bdfcdac46d59.tar.gz
src-f10845877e962a7dcdc4cf9b9614bdfcdac46d59.zip
Suspend all writeable local filesystems on power suspend.
This ensures that no writes are pending in memory, either metadata or user data, but not including dirty pages not yet converted to fs writes. Only filesystems declared local are suspended. Note that this does not guarantee absence of the metadata errors or leaks if resume is not done: for instance, on UFS unlinked but opened inodes are leaked and require fsck to gc. Reviewed by: markj Discussed with: imp Tested by: imp (previous version), pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D27054
Notes
Notes: svn path=/head/; revision=367398
Diffstat (limited to 'sys/sys/mount.h')
-rw-r--r--sys/sys/mount.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 06646f80d08b..ee8d916c2432 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -463,6 +463,7 @@ struct mntoptnames {
#define MNTK_VMSETSIZE_BUG 0x00010000
#define MNTK_UNIONFS 0x00020000 /* A hack for F_ISUNIONSTACK */
#define MNTK_FPLOOKUP 0x00040000 /* fast path lookup is supported */
+#define MNTK_SUSPEND_ALL 0x00080000 /* Suspended by all-fs suspension */
#define MNTK_NOASYNC 0x00800000 /* disable async */
#define MNTK_UNMOUNT 0x01000000 /* unmount in progress */
#define MNTK_MWAIT 0x02000000 /* waiting for unmount to finish */
@@ -1048,6 +1049,9 @@ void vfs_dump_mount_counters(struct mount *);
enum mount_counter { MNT_COUNT_REF, MNT_COUNT_LOCKREF, MNT_COUNT_WRITEOPCOUNT };
int vfs_mount_fetch_counter(struct mount *, enum mount_counter);
+void suspend_all_fs(void);
+void resume_all_fs(void);
+
/*
* Code transitioning mnt_vfs_ops to > 0 issues IPIs until it observes
* all CPUs not executing code enclosed by mnt_thread_in_ops_pcpu.