diff options
author | Matthew Macy <[email protected]> | 2019-10-23 17:29:43 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-10-23 17:29:43 -0700 |
commit | b834b58ae61063f526ce82df348440e31c58c232 (patch) | |
tree | 6a991335d346afd19bd66ebf1558e0fd66de46e3 /lib/libzfs/libzfs_dataset.c | |
parent | 05d07ba9a7f104e71c4052abe0be1cb96ba012d1 (diff) |
Use zfs_ioctl with zfs_cmd_t in libzfs
Consistently use the `zfs_ioctl()` wrapper since `ioctl()` cannot be
called directly due to differing semantics between platforms.
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #9492
Diffstat (limited to 'lib/libzfs/libzfs_dataset.c')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index e88ace53f..2604c6617 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -334,7 +334,7 @@ get_stats_ioctl(zfs_handle_t *zhp, zfs_cmd_t *zc) (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name)); - while (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, zc) != 0) { + while (zfs_ioctl(hdl, ZFS_IOC_OBJSET_STATS, zc) != 0) { if (errno == ENOMEM) { if (zcmd_expand_dst_nvlist(hdl, zc) != 0) { return (-1); @@ -362,7 +362,7 @@ get_recvd_props_ioctl(zfs_handle_t *zhp) (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - while (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_RECVD_PROPS, &zc) != 0) { + while (zfs_ioctl(hdl, ZFS_IOC_OBJSET_RECVD_PROPS, &zc) != 0) { if (errno == ENOMEM) { if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) { return (-1); @@ -3323,7 +3323,7 @@ zfs_prop_get_userquota_common(zfs_handle_t *zhp, const char *propname, if (err) return (err); - err = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_USERSPACE_ONE, &zc); + err = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_USERSPACE_ONE, &zc); if (err) return (err); @@ -3404,7 +3404,7 @@ zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname, (void) strlcat(zc.zc_value, snapname - 1, sizeof (zc.zc_value)); } - err = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_SPACE_WRITTEN, &zc); + err = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SPACE_WRITTEN, &zc); if (err) return (err); @@ -3541,7 +3541,7 @@ check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned, slash = parent + strlen(parent); (void) strncpy(zc.zc_name, parent, slash - parent); zc.zc_name[slash - parent] = '\0'; - if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0 && + if (zfs_ioctl(hdl, ZFS_IOC_OBJSET_STATS, &zc) != 0 && errno == ENOENT) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "no such pool '%s'"), zc.zc_name); @@ -5247,7 +5247,7 @@ tryagain: (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { + if (zfs_ioctl(hdl, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"), zc.zc_name); |