]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: create a special file to pass filesystem health to userspace
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Aug 2024 22:54:55 +0000 (15:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 14 Aug 2024 03:08:26 +0000 (20:08 -0700)
Create an ioctl that installs a file descriptor backed by an anon_inode
file that will convey filesystem health events to userspace.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_fs.h

index 0bff9171eb783648c2af0a1d3d2ecc9f512ec17e..afbe6bf0915b038cba9b51f77896e04760f57d45 100644 (file)
@@ -1094,6 +1094,13 @@ struct xfs_map_freesp {
        __u64   pad;            /* must be zero */
 };
 
+struct xfs_health_monitor {
+       __u64   flags;          /* flags */
+       __u8    format;         /* output format */
+       __u8    pad1[7];        /* zeroes */
+       __u64   pad2[2];        /* zeroes */
+};
+
 /*
  * ioctl commands that are used by Linux filesystems
  */
@@ -1135,6 +1142,7 @@ struct xfs_map_freesp {
 #define XFS_IOC_RTGROUP_GEOMETRY _IOWR('X', 65, struct xfs_rtgroup_geometry)
 #define XFS_IOC_GETFSREFCOUNTS _IOWR('X', 66, struct xfs_getfsrefs_head)
 #define XFS_IOC_MAP_FREESP     _IOW ('X', 67, struct xfs_map_freesp)
+#define XFS_IOC_HEALTH_MONITOR _IOW ('X', 68, struct xfs_health_monitor)
 
 /*
  * ioctl commands that replace IRIX syssgi()'s