aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2021-09-10 02:44:21 +0900
committerGitHub <[email protected]>2021-09-09 10:44:21 -0700
commit5a54a4e0517959dd917c0f78d692f7364e597a68 (patch)
tree1b8ea31a0f6bbb79fe9b8d62da80f3b1954a81ed /include
parent2079111f42a90b123f484337b43a549b7c5e50ba (diff)
Upstream: Add snapshot and zvol events
For kernel to send snapshot mount/unmount events to zed. For kernel to send symlink creates/removes on zvol plumbing. (/dev/run/dsk/zvol/$pool/$zvol -> /dev/diskX) If zed misses the ENODEV, all errors after are EINVAL. Treat any error as kernel module failure. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #12416
Diffstat (limited to 'include')
-rw-r--r--include/sys/fm/fs/zfs.h9
-rw-r--r--include/sys/spa.h2
-rw-r--r--include/sys/zio.h2
3 files changed, 13 insertions, 0 deletions
diff --git a/include/sys/fm/fs/zfs.h b/include/sys/fm/fs/zfs.h
index 6491606d3..cd080c8ee 100644
--- a/include/sys/fm/fs/zfs.h
+++ b/include/sys/fm/fs/zfs.h
@@ -110,6 +110,10 @@ extern "C" {
#define FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_BITS "bad_cleared_bits"
#define FM_EREPORT_PAYLOAD_ZFS_BAD_SET_HISTOGRAM "bad_set_histogram"
#define FM_EREPORT_PAYLOAD_ZFS_BAD_CLEARED_HISTOGRAM "bad_cleared_histogram"
+#define FM_EREPORT_PAYLOAD_ZFS_SNAPSHOT_NAME "snapshot_name"
+#define FM_EREPORT_PAYLOAD_ZFS_DEVICE_NAME "device_name"
+#define FM_EREPORT_PAYLOAD_ZFS_RAW_DEVICE_NAME "raw_name"
+#define FM_EREPORT_PAYLOAD_ZFS_VOLUME "volume"
#define FM_EREPORT_FAILMODE_WAIT "wait"
#define FM_EREPORT_FAILMODE_CONTINUE "continue"
@@ -119,6 +123,11 @@ extern "C" {
#define FM_RESOURCE_AUTOREPLACE "autoreplace"
#define FM_RESOURCE_STATECHANGE "statechange"
+#define FM_RESOURCE_ZFS_SNAPSHOT_MOUNT "snapshot_mount"
+#define FM_RESOURCE_ZFS_SNAPSHOT_UNMOUNT "snapshot_unmount"
+#define FM_RESOURCE_ZVOL_CREATE_SYMLINK "zvol_create"
+#define FM_RESOURCE_ZVOL_REMOVE_SYMLINK "zvol_remove"
+
#ifdef __cplusplus
}
#endif
diff --git a/include/sys/spa.h b/include/sys/spa.h
index f811d6f5a..2ae467877 100644
--- a/include/sys/spa.h
+++ b/include/sys/spa.h
@@ -1170,6 +1170,8 @@ extern void spa_configfile_set(spa_t *, nvlist_t *, boolean_t);
/* asynchronous event notification */
extern void spa_event_notify(spa_t *spa, vdev_t *vdev, nvlist_t *hist_nvl,
const char *name);
+extern void zfs_ereport_zvol_post(const char *subclass, const char *name,
+ const char *device_name, const char *raw_name);
/* waiting for pool activities to complete */
extern int spa_wait(const char *pool, zpool_wait_activity_t activity,
diff --git a/include/sys/zio.h b/include/sys/zio.h
index 2d34481f6..5b606eaf8 100644
--- a/include/sys/zio.h
+++ b/include/sys/zio.h
@@ -673,6 +673,8 @@ extern int zfs_ereport_post_checksum(spa_t *spa, vdev_t *vd,
struct zio_bad_cksum *info);
void zio_vsd_default_cksum_report(zio_t *zio, zio_cksum_report_t *zcr);
+extern void zfs_ereport_snapshot_post(const char *subclass, spa_t *spa,
+ const char *name);
/* Called from spa_sync(), but primarily an injection handler */
extern void spa_handle_ignored_writes(spa_t *spa);