summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-11-22 14:52:16 -0800
committerBrian Behlendorf <[email protected]>2014-03-31 16:10:57 -0700
commit75e3ff58feda2d836c4546c5dc2e98fcd2d1a67b (patch)
tree56f18f143be48ff4b4d06f93ddc730e77cd9a2f6 /include
parenta2f1945ee3ce8eba02ef54168c72f3be8f2cebdc (diff)
Add zpool_events_seek() functionality
The ZFS_IOC_EVENTS_SEEK ioctl was added to allow user space callers to seek around the zevent file descriptor by EID. When a specific EID is passed and it exists the cursor will be positioned there. If the EID is no longer cached by the kernel ENOENT is returned. The caller may also pass ZEVENT_SEEK_START or ZEVENT_SEEK_END to seek to those respective locations. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chris Dunlap <[email protected]> Issue #2
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h1
-rw-r--r--include/sys/fm/util.h3
-rw-r--r--include/sys/fs/zfs.h1
-rw-r--r--include/sys/zfs_ioctl.h3
4 files changed, 7 insertions, 1 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 55dd34c99..cb78f1d62 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -410,6 +410,7 @@ extern int zpool_history_unpack(char *, uint64_t, uint64_t *,
nvlist_t ***, uint_t *);
extern int zpool_events_next(libzfs_handle_t *, nvlist_t **, int *, int, int);
extern int zpool_events_clear(libzfs_handle_t *, int *);
+extern int zpool_events_seek(libzfs_handle_t *, uint64_t, int);
extern void zpool_obj_to_path(zpool_handle_t *, uint64_t, uint64_t, char *,
size_t len);
extern int zfs_ioctl(libzfs_handle_t *, int, struct zfs_cmd *);
diff --git a/include/sys/fm/util.h b/include/sys/fm/util.h
index 9dfd436c1..18fe49073 100644
--- a/include/sys/fm/util.h
+++ b/include/sys/fm/util.h
@@ -71,7 +71,7 @@ typedef struct erpt_dump {
#ifdef _KERNEL
-#define ZEVENT_SHUTDOWN 0x1
+#define ZEVENT_SHUTDOWN 0x1
typedef void zevent_cb_t(nvlist_t *, nvlist_t *);
@@ -99,6 +99,7 @@ extern int zfs_zevent_fd_hold(int, minor_t *, zfs_zevent_t **);
extern void zfs_zevent_fd_rele(int);
extern int zfs_zevent_next(zfs_zevent_t *, nvlist_t **, uint64_t *, uint64_t *);
extern int zfs_zevent_wait(zfs_zevent_t *);
+extern int zfs_zevent_seek(zfs_zevent_t *, uint64_t);
extern void zfs_zevent_init(zfs_zevent_t **);
extern void zfs_zevent_destroy(zfs_zevent_t *);
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 882e9e84a..ae72f834d 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -864,6 +864,7 @@ typedef enum zfs_ioc {
ZFS_IOC_LINUX = ('Z' << 8) + 0x80,
ZFS_IOC_EVENTS_NEXT,
ZFS_IOC_EVENTS_CLEAR,
+ ZFS_IOC_EVENTS_SEEK,
/*
* FreeBSD - 1/64 numbers reserved.
diff --git a/include/sys/zfs_ioctl.h b/include/sys/zfs_ioctl.h
index dad611328..c63b16c78 100644
--- a/include/sys/zfs_ioctl.h
+++ b/include/sys/zfs_ioctl.h
@@ -262,6 +262,9 @@ typedef struct zinject_record {
#define ZEVENT_NONBLOCK 0x1
#define ZEVENT_SIZE 1024
+#define ZEVENT_SEEK_START 0
+#define ZEVENT_SEEK_END UINT64_MAX
+
typedef enum zinject_type {
ZINJECT_UNINITIALIZED,
ZINJECT_DATA_FAULT,