diff options
author | Brian Behlendorf <[email protected]> | 2013-11-22 16:00:39 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-03-31 16:11:08 -0700 |
commit | 9b101a73203faecdc6d466fe446d787bc341ee14 (patch) | |
tree | 3f66497e6384d35b89dbd89ed06b229a15e13967 /lib/libzfs/libzfs_pool.c | |
parent | 75e3ff58feda2d836c4546c5dc2e98fcd2d1a67b (diff) |
Clarify zpool_events_next() comment
Due to the very poorly chosen argument name 'cleanup_fd' it was
completely unclear that this file descriptor is used to track the
current cursor location. When the file descriptor is created by
opening ZFS_DEV a private cursor is created in the kernel for the
returned file descriptor. Subsequent calls to zpool_events_next()
and zpool_events_seek() then require the file descriptor as an
argument to reposition the cursor. When the file descriptor is
closed the kernel state tracking the cursor is destroyed.
This patch contains no functional change, it just changes a
few variable names and clarifies the documentation.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: Chris Dunlap <[email protected]>
Issue #2
Diffstat (limited to 'lib/libzfs/libzfs_pool.c')
-rw-r--r-- | lib/libzfs/libzfs_pool.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 1b8f3b63a..2054385b8 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -3783,25 +3783,25 @@ zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp) } /* - * Retrieve the next event. If there is a new event available 'nvp' will - * contain a newly allocated nvlist and 'dropped' will be set to the number - * of missed events since the last call to this function. When 'nvp' is - * set to NULL it indicates no new events are available. In either case - * the function returns 0 and it is up to the caller to free 'nvp'. In - * the case of a fatal error the function will return a non-zero value. - * When the function is called in blocking mode it will not return until - * a new event is available. + * Retrieve the next event given the passed 'zevent_fd' file descriptor. + * If there is a new event available 'nvp' will contain a newly allocated + * nvlist and 'dropped' will be set to the number of missed events since + * the last call to this function. When 'nvp' is set to NULL it indicates + * no new events are available. In either case the function returns 0 and + * it is up to the caller to free 'nvp'. In the case of a fatal error the + * function will return a non-zero value. When the function is called in + * blocking mode it will not return until a new event is available. */ int zpool_events_next(libzfs_handle_t *hdl, nvlist_t **nvp, - int *dropped, int block, int cleanup_fd) + int *dropped, int block, int zevent_fd) { zfs_cmd_t zc = {"\0"}; int error = 0; *nvp = NULL; *dropped = 0; - zc.zc_cleanup_fd = cleanup_fd; + zc.zc_cleanup_fd = zevent_fd; if (!block) zc.zc_guid = ZEVENT_NONBLOCK; |