]> granicus.if.org Git - zfs/commitdiff
Merge commit 'refs/top-bases/fix-deadcode' into fix-deadcode
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Jul 2009 20:14:18 +0000 (13:14 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 6 Jul 2009 20:14:18 +0000 (13:14 -0700)
1  2 
cmd/zpool/zpool_main.c
lib/libzfs/libzfs_dataset.c

Simple merge
index 405a21cd8481fda92baeb1b52b8d1ae9dda24409,ac912260551dd03ac459e3aea6493b66f5ab0199..fd8de124e095277f23feb53385168234a9d762d4
@@@ -76,10 -80,53 +80,10 @@@ zfs_type_to_name(zfs_type_t type
        return (NULL);
  }
  
 -/*
 - * Given a path and mask of ZFS types, return a string describing this dataset.
 - * This is used when we fail to open a dataset and we cannot get an exact type.
 - * We guess what the type would have been based on the path and the mask of
 - * acceptable types.
 - */
 -static const char *
 -path_to_str(const char *path, int types)
 -{
 -      /*
 -       * When given a single type, always report the exact type.
 -       */
 -      if (types == ZFS_TYPE_SNAPSHOT)
 -              return (dgettext(TEXT_DOMAIN, "snapshot"));
 -      if (types == ZFS_TYPE_FILESYSTEM)
 -              return (dgettext(TEXT_DOMAIN, "filesystem"));
 -      if (types == ZFS_TYPE_VOLUME)
 -              return (dgettext(TEXT_DOMAIN, "volume"));
 -
 -      /*
 -       * The user is requesting more than one type of dataset.  If this is the
 -       * case, consult the path itself.  If we're looking for a snapshot, and
 -       * a '@' is found, then report it as "snapshot".  Otherwise, remove the
 -       * snapshot attribute and try again.
 -       */
 -      if (types & ZFS_TYPE_SNAPSHOT) {
 -              if (strchr(path, '@') != NULL)
 -                      return (dgettext(TEXT_DOMAIN, "snapshot"));
 -              return (path_to_str(path, types & ~ZFS_TYPE_SNAPSHOT));
 -      }
 -
 -      /*
 -       * The user has requested either filesystems or volumes.
 -       * We have no way of knowing a priori what type this would be, so always
 -       * report it as "filesystem" or "volume", our two primitive types.
 -       */
 -      if (types & ZFS_TYPE_FILESYSTEM)
 -              return (dgettext(TEXT_DOMAIN, "filesystem"));
 -
 -      assert(types & ZFS_TYPE_VOLUME);
 -      return (dgettext(TEXT_DOMAIN, "volume"));
 -}
 -
  /*
   * Validate a ZFS path.  This is used even before trying to open the dataset, to
-  * provide a more meaningful error message.  We place a more useful message in
-  * 'buf' detailing exactly why the name was not valid.
+  * provide a more meaningful error message.  We call zfs_error_aux() to
+  * explain exactly why the name was not valid.
   */
  static int
  zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,