@@ -1107,6 +1107,14 @@ struct xfs_health_monitor {
__u64 pad2[2]; /* zeroes */
};
+/* Return all health status events, not just deltas */
+#define XFS_HEALTH_MONITOR_VERBOSE (1ULL << 0)
+
+#define XFS_HEALTH_MONITOR_ALL (XFS_HEALTH_MONITOR_VERBOSE)
+
+/* Return events in JSON format */
+#define XFS_HEALTH_MONITOR_FMT_JSON (1)
+
/*
* ioctl commands that are used by Linux filesystems
*/
new file mode 100644
@@ -0,0 +1,63 @@
+{
+ "$comment": [
+ "SPDX-License-Identifier: GPL-2.0-or-later",
+ "Copyright (c) 2024-2025 Oracle. All Rights Reserved.",
+ "Author: Darrick J. Wong <djwong@kernel.org>",
+ "",
+ "This schema file describes the format of the json objects",
+ "readable from the fd returned by the XFS_IOC_HEALTHMON",
+ "ioctl."
+ ],
+
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
+ "$id": "https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/fs/xfs/libxfs/xfs_healthmon.schema.json",
+
+ "title": "XFS Health Monitoring Events",
+
+ "$comment": "Events must be one of the following types:",
+ "oneOf": [
+ {
+ "$ref": "#/$events/lost"
+ }
+ ],
+
+ "$comment": "Simple data types are defined here.",
+ "$defs": {
+ "time_ns": {
+ "title": "Time of Event",
+ "description": "Timestamp of the event, in nanoseconds since the Unix epoch.",
+ "type": "integer"
+ }
+ },
+
+ "$comment": "Event types are defined here.",
+ "$events": {
+ "lost": {
+ "title": "Health Monitoring Events Lost",
+ "$comment": [
+ "Previous health monitoring events were",
+ "dropped due to memory allocation failures",
+ "or queue limits."
+ ],
+ "type": "object",
+
+ "properties": {
+ "type": {
+ "const": "lost"
+ },
+ "time_ns": {
+ "$ref": "#/$defs/time_ns"
+ },
+ "domain": {
+ "const": "mount"
+ }
+ },
+
+ "required": [
+ "type",
+ "time_ns",
+ "domain"
+ ]
+ }
+ }
+}