+ * Remove a property from zfs property dataset
+ */
+static int zfs_remove_prop(zfs_handle_t *zhp, nvlist_t *nvl, char *propname)
+{
+ nvlist_remove_all(nvl, propname);
+ /* XXX: please replace zfs_prop_inherit() if there is a better function
+ * to call zfs_ioctl() to update data on-disk.
+ */
+ return zfs_prop_inherit(zhp, propname, false);
+}
+
+static int zfs_erase_prop(zfs_handle_t *zhp, char *param)
+{
+ nvlist_t *nvl;
+ char propname[ZFS_MAXPROPLEN];
+ int len = strlen(param) + strlen(LDD_PREFIX);
+
+ if (len > ZFS_MAXPROPLEN) {
+ fprintf(stderr, "%s: zfs prop to erase is too long-\n%s\n",
+ progname, param);
+ return EINVAL;
+ }
+
+ nvl = zfs_get_user_props(zhp);
+ if (!nvl)
+ return ENOENT;
+
+ snprintf(propname, len + 1, "%s%s", LDD_PREFIX, param);
+ return zfs_remove_prop(zhp, nvl, propname);
+}
+
+static int zfs_erase_allprops(zfs_handle_t *zhp)
+{
+ nvlist_t *nvl;
+ nvpair_t *curr = NULL;
+
+ nvl = zfs_get_user_props(zhp);
+ if (!nvl)
+ return ENOENT;
+
+ curr = nvlist_next_nvpair(nvl, curr);
+ while (curr) {
+ nvpair_t *next = nvlist_next_nvpair(nvl, curr);
+
+ zfs_remove_prop(zhp, nvl, nvpair_name(curr));
+ curr = next;
+ }
+
+ return 0;
+}
+
+/*