Print this page
2619 asynchronous destruction of ZFS file systems
2747 SPA versioning with zfs feature flags
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@delphix.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan Kruchinin <dan.kruchinin@gmail.com>
Approved by: Dan McDonald <danmcd@nexenta.com>
        
*** 16,28 ****
   * fields enclosed by brackets "[]" replaced with your own identifying
   * information: Portions Copyright [yyyy] [name of copyright owner]
   *
   * CDDL HEADER END
   */
  /*
   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
!  * Copyright (c) 2011 by Delphix. All rights reserved.
   */
  
  /*
   * Internal utility routines for the ZFS library.
   */
--- 16,29 ----
   * fields enclosed by brackets "[]" replaced with your own identifying
   * information: Portions Copyright [yyyy] [name of copyright owner]
   *
   * CDDL HEADER END
   */
+ 
  /*
   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
!  * Copyright (c) 2012 by Delphix. All rights reserved.
   */
  
  /*
   * Internal utility routines for the ZFS library.
   */
*** 43,52 ****
--- 44,54 ----
  
  #include <libzfs.h>
  
  #include "libzfs_impl.h"
  #include "zfs_prop.h"
+ #include "zfeature_common.h"
  
  int
  libzfs_errno(libzfs_handle_t *hdl)
  {
          return (hdl->libzfs_error);
*** 110,120 ****
          case EZFS_NOREPLICAS:
                  return (dgettext(TEXT_DOMAIN, "no valid replicas"));
          case EZFS_RESILVERING:
                  return (dgettext(TEXT_DOMAIN, "currently resilvering"));
          case EZFS_BADVERSION:
!                 return (dgettext(TEXT_DOMAIN, "unsupported version"));
          case EZFS_POOLUNAVAIL:
                  return (dgettext(TEXT_DOMAIN, "pool is unavailable"));
          case EZFS_DEVOVERFLOW:
                  return (dgettext(TEXT_DOMAIN, "too many devices in one vdev"));
          case EZFS_BADPATH:
--- 112,123 ----
          case EZFS_NOREPLICAS:
                  return (dgettext(TEXT_DOMAIN, "no valid replicas"));
          case EZFS_RESILVERING:
                  return (dgettext(TEXT_DOMAIN, "currently resilvering"));
          case EZFS_BADVERSION:
!                 return (dgettext(TEXT_DOMAIN, "unsupported version or "
!                     "feature"));
          case EZFS_POOLUNAVAIL:
                  return (dgettext(TEXT_DOMAIN, "pool is unavailable"));
          case EZFS_DEVOVERFLOW:
                  return (dgettext(TEXT_DOMAIN, "too many devices in one vdev"));
          case EZFS_BADPATH:
*** 627,636 ****
--- 630,640 ----
  
          hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r");
  
          zfs_prop_init();
          zpool_prop_init();
+         zpool_feature_init();
          libzfs_mnttab_init(hdl);
  
          return (hdl);
  }
  
*** 1280,1292 ****
          /*
           * When no property table entry can be found, return failure if
           * this is a pool property or if this isn't a user-defined
           * dataset property,
           */
!         if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL ||
!             (!zfs_prop_user(propname) && !zfs_prop_userquota(propname) &&
!             !zfs_prop_written(propname)))) {
                  zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
                      "invalid property '%s'"), propname);
                  return (zfs_error(hdl, EZFS_BADPROP,
                      dgettext(TEXT_DOMAIN, "bad property list")));
          }
--- 1284,1298 ----
          /*
           * When no property table entry can be found, return failure if
           * this is a pool property or if this isn't a user-defined
           * dataset property,
           */
!         if (prop == ZPROP_INVAL && ((type == ZFS_TYPE_POOL &&
!             !zpool_prop_feature(propname) &&
!             !zpool_prop_unsupported(propname)) ||
!             (type == ZFS_TYPE_DATASET && !zfs_prop_user(propname) &&
!             !zfs_prop_userquota(propname) && !zfs_prop_written(propname)))) {
                  zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
                      "invalid property '%s'"), propname);
                  return (zfs_error(hdl, EZFS_BADPROP,
                      dgettext(TEXT_DOMAIN, "bad property list")));
          }
*** 1294,1304 ****
          if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL)
                  return (-1);
  
          entry->pl_prop = prop;
          if (prop == ZPROP_INVAL) {
!                 if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == NULL) {
                          free(entry);
                          return (-1);
                  }
                  entry->pl_width = strlen(propname);
          } else {
--- 1300,1311 ----
          if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL)
                  return (-1);
  
          entry->pl_prop = prop;
          if (prop == ZPROP_INVAL) {
!                 if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) ==
!                     NULL) {
                          free(entry);
                          return (-1);
                  }
                  entry->pl_width = strlen(propname);
          } else {