aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Dunlap <[email protected]>2014-02-12 10:30:18 -0800
committerBrian Behlendorf <[email protected]>2014-03-31 16:11:21 -0700
commit8c7aa0cfc47578d1d38f80ecb7c66eed7cde5c59 (patch)
tree3f4f8ec16357c89941b544adcd7009a57d0e4893 /include
parent07917db9908516aa3fd55d39d2c1792aca8bebcd (diff)
Replace zpool_events_next() "block" parm w/ "flags"
zpool_events_next() can be called in blocking mode by specifying a non-zero value for the "block" parameter. However, the design of the ZFS Event Daemon (zed) requires additional functionality from zpool_events_next(). Instead of adding additional arguments to the function, it makes more sense to use flags that can be bitwise-or'd together. This commit replaces the zpool_events_next() int "block" parameter with an unsigned bitwise "flags" parameter. It also defines ZEVENT_NONE to specify the default behavior. Since non-blocking mode can be specified with the existing ZEVENT_NONBLOCK flag, the default behavior becomes blocking mode. This, in effect, inverts the previous use of the "block" parameter. Existing callers of zpool_events_next() have been modified to check for the ZEVENT_NONBLOCK flag. Signed-off-by: Chris Dunlap <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Issue #2
Diffstat (limited to 'include')
-rw-r--r--include/libzfs.h3
-rw-r--r--include/sys/zfs_ioctl.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index cb78f1d62..5bc8b03ef 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -408,7 +408,8 @@ extern int zpool_upgrade(zpool_handle_t *, uint64_t);
extern int zpool_get_history(zpool_handle_t *, nvlist_t **);
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_next(libzfs_handle_t *, nvlist_t **, int *, unsigned,
+ 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 *,
diff --git a/include/sys/zfs_ioctl.h b/include/sys/zfs_ioctl.h
index c63b16c78..0ab095c1a 100644
--- a/include/sys/zfs_ioctl.h
+++ b/include/sys/zfs_ioctl.h
@@ -259,6 +259,7 @@ typedef struct zinject_record {
#define ZINJECT_FLUSH_ARC 0x2
#define ZINJECT_UNLOAD_SPA 0x4
+#define ZEVENT_NONE 0x0
#define ZEVENT_NONBLOCK 0x1
#define ZEVENT_SIZE 1024