-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New stable API (For Initial Review) #3299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Richard Yao <ryao@gentoo.org>
…nd_t Signed-off-by: Richard Yao <ryao@gentoo.org>
We retain the ability to pass index values for backward compatibility with older tools, but this functionality is depreciated. Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
lzc_send_ext() accepts an nvlist of additional options that modify send behavior. Right now only one such additional option is supported: "fromorigin", it instructs to produce an incremental stream for a cloned filesystem starting from its origin snapshot. To do: consider passing the options via 'opts' nvlist rather than 'innvl'
this is libzfs_core counterpart for ZFS_IOC_SEND_PROGRESS
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
This implements a stable zfs list API. inspired by the CLI `zfs list`. It unifies several existing API calls into a single call that provides an almost complete subset of the functionality provided by `zfs list`. The existing API calls that this supercedes are: - ZFS_IOC_OBJSET_STATS - ZFS_IOC_OBJSET_ZPLPROPS - ZFS_IOC_DATASET_LIST_NEXT - ZFS_IOC_SNAPSHOT_LIST_NEXT - ZFS_IOC_GET_BOOKMARKS (stable lzc API) Since ZFS_IOC_GET_BOOKMARKS is a stable API, it has been left untouched. The functionality absent from the API that is present in `zfs list` is the ability to sort and request data on specific properties. Under this API, userland is (still) expected to sort and all property data is returned. Programming documentation on the API is included a comment in libzfs_core.c. Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Richard Yao <ryao@gentoo.org>
This was originally intended to be `lzc_destroy()`, but recent versions of the Linux kernel appear to have removed the information we need to unmount datasets from the kernel driver without resorting to symbol table hacks. Consequently, unmounting requires doing upcalls to userland and error handling becomes easier if we delegate unmounting to the userland caller. Signed-off-by: Richard Yao <ryao@gentoo.org>
dsl_pool_config_exit(dp, FTAG); | ||
if (error) | ||
return (error); | ||
dd_obj = ds->ds_dir->dd_object; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a race here between zfs list
and zfs destroy
that creates an edge case where zfs list
says there is something and then the pipe says otherwise. An attempt to take the lock here and transfer ownership of the lock to another thread was messy, although it would close this race. Thoughts on whether this race should be closed or documented would be appreciated.
I also have a general comment about this pull request. |
I should have this ported to Illumos soon. When I have that done and have addressed these comments, I will submit it to Illumos. The Illumos submission process requires that I email the list, so this would be done as part of it. That said, I had some feedback in IRC (people generally liked the API), but the review was fairly superficial. |
I think an additional document describing the usage and semantics of new interfaces (which eventually could become a man page) would be helpful for discussing their design. We don't have to wait for the code to be ported. |
I like the idea of having the document for the usage and semantics. |
Are there any style guides or existing examples of good API documentation that I could use as a template? |
Closed in favor of #3907. |
This is the foundation for a stable /dev/zfs API for management that moves the kernel-userland interface away from binary data structures and numerical values to XDR-encoded nvlists and string values to enable ease of programming and long term interface stability. Most of the existing libzfs_core API functions have been migrated to the proposed API and the following new ones have been implemented for use by flocker and others:
In most cases, the userland tools have been modified to use them. A few open questions that need to be answered are:
zfs list
command fails to list an individual bookmark. This is a pre-existing userland bug. Should we address it here?Lastly, this depends on openzfs/spl#449.