aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zed/zed_event.h
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2020-06-23 01:53:34 +0900
committerGitHub <[email protected]>2020-06-22 09:53:34 -0700
commit68301ba20e0a6543304a63d22b558fddea130d79 (patch)
tree43957064dfa3f0f3571fc73878d76cf37620bd86 /cmd/zed/zed_event.h
parent42d8d1d66ac1d3629ab22f65cd0787933cfb60ab (diff)
zed additional features
This commit adds two features to zed, that macOS desires. The first is that when you unload the kernel module, zed would enter into a cpubusy loop calling zfs_events_next() repeatedly. We now look for ENODEV, returned by kernel, so zed can exit gracefully. Second feature is -I (idle) (alas -P persist was taken) is for the deamon to; 1; if started without ZFS kernel module, stick around waiting for it. 2; if kernel module is unloaded, go back to 1. This is due to daemons in macOS is started by launchctl, and is expected to stick around. Currently, the busy loop only exists when errno is ENODEV. This is to ensure that functionality that upstream expects is not changed. It did not care about errors before, and it still does not. (with the exception of ENODEV). However, it is probably better that all errors (ERESTART notwithstanding) exits the loop, and the issues complaining about zed taking all CPU will go away. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #10476
Diffstat (limited to 'cmd/zed/zed_event.h')
-rw-r--r--cmd/zed/zed_event.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zed/zed_event.h b/cmd/zed/zed_event.h
index 9f37b80fe..c1455c3a0 100644
--- a/cmd/zed/zed_event.h
+++ b/cmd/zed/zed_event.h
@@ -17,13 +17,13 @@
#include <stdint.h>
-void zed_event_init(struct zed_conf *zcp);
+int zed_event_init(struct zed_conf *zcp);
void zed_event_fini(struct zed_conf *zcp);
int zed_event_seek(struct zed_conf *zcp, uint64_t saved_eid,
int64_t saved_etime[]);
-void zed_event_service(struct zed_conf *zcp);
+int zed_event_service(struct zed_conf *zcp);
#endif /* !ZED_EVENT_H */