diff options
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zpool/zpool_main.c | 10 | ||||
-rw-r--r-- | cmd/zpool/zpool_vdev.c | 11 |
2 files changed, 9 insertions, 12 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index bd7be7246..b74dc219a 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -2080,6 +2080,9 @@ do_import(nvlist_t *config, const char *newname, const char *mntopts, * * -o Set property=value and/or temporary mount options (without '='). * + * -s Scan using the default search path, the libblkid cache will + * not be consulted. + * * The import command scans for pools to import, and import pools based on pool * name and GUID. The pool can also be renamed as part of the import process. */ @@ -2109,13 +2112,14 @@ zpool_do_import(int argc, char **argv) boolean_t dryrun = B_FALSE; boolean_t do_rewind = B_FALSE; boolean_t xtreme_rewind = B_FALSE; + boolean_t do_scan = B_FALSE; uint64_t pool_state, txg = -1ULL; char *cachefile = NULL; importargs_t idata = { 0 }; char *endptr; /* check options */ - while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:tT:VX")) != -1) { + while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:stT:VX")) != -1) { switch (c) { case 'a': do_all = B_TRUE; @@ -2173,6 +2177,9 @@ zpool_do_import(int argc, char **argv) ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE)) goto error; break; + case 's': + do_scan = B_TRUE; + break; case 't': flags |= ZFS_IMPORT_TEMP_NAME; if (add_prop_list_default(zpool_prop_to_name( @@ -2322,6 +2329,7 @@ zpool_do_import(int argc, char **argv) idata.poolname = searchname; idata.guid = searchguid; idata.cachefile = cachefile; + idata.scan = do_scan; pools = zpool_search_import(g_zfs, &idata); diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index cae20147b..54ca1b261 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -78,12 +78,7 @@ #include <sys/vtoc.h> #include <sys/mntent.h> #include <uuid/uuid.h> -#ifdef HAVE_LIBBLKID #include <blkid/blkid.h> -#else -#define blkid_cache void * -#endif /* HAVE_LIBBLKID */ - #include "zpool_util.h" #include <sys/zfs_context.h> @@ -374,7 +369,6 @@ static int check_slice(const char *path, blkid_cache cache, int force, boolean_t isspare) { int err; -#ifdef HAVE_LIBBLKID char *value; /* No valid type detected device is safe to use */ @@ -400,9 +394,6 @@ check_slice(const char *path, blkid_cache cache, int force, boolean_t isspare) } free(value); -#else - err = check_file(path, force, isspare); -#endif /* HAVE_LIBBLKID */ return (err); } @@ -500,7 +491,6 @@ check_device(const char *path, boolean_t force, { static blkid_cache cache = NULL; -#ifdef HAVE_LIBBLKID /* * There is no easy way to add a correct blkid_put_cache() call, * memory will be reclaimed when the command exits. @@ -519,7 +509,6 @@ check_device(const char *path, boolean_t force, return (-1); } } -#endif /* HAVE_LIBBLKID */ return (check_disk(path, cache, force, isspare, iswholedisk)); } |