diff options
author | Xin LI <delphij@FreeBSD.org> | 2013-12-31 19:39:15 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2013-12-31 19:39:15 +0000 |
commit | db2aff5f8b6178488c90f2d398f7373cf285ee9c (patch) | |
tree | 25259cca882bd57d5a1fa10b9f0e1d6a98b3554e /cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | |
parent | 000fb817d8a243b32f4b28e14c926eff19e2e695 (diff) | |
parent | fb6c5b06d9e366431dde1fb50a926a9fde91c4ca (diff) | |
download | src-db2aff5f8b6178488c90f2d398f7373cf285ee9c.tar.gz src-db2aff5f8b6178488c90f2d398f7373cf285ee9c.zip |
MFV r242733:
3306 zdb should be able to issue reads in parallel
3321 'zpool reopen' command should be documented in the man page
and help message
illumos/illumos-gate@31d7e8fa33fae995f558673adb22641b5aa8b6e1
FreeBSD porting notes: the kernel part of this changeset depends
on Solaris buf(9S) interfaces and are not really applicable for
our use. vdev_disk.c is patched as-is to reduce diverge from
upstream, but vdev_file.c is left intact.
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=260138
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zpool/zpool_main.c')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 09ab280d6386..dd3b2eb05a2d 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -248,7 +248,7 @@ get_usage(zpool_help_t idx) { case HELP_REMOVE: return (gettext("\tremove <pool> <device> ...\n")); case HELP_REOPEN: - return (""); /* Undocumented command */ + return (gettext("\treopen <pool>\n")); case HELP_SCRUB: return (gettext("\tscrub [-s] <pool> ...\n")); case HELP_STATUS: @@ -3720,22 +3720,37 @@ zpool_do_reguid(int argc, char **argv) * zpool reopen <pool> * * Reopen the pool so that the kernel can update the sizes of all vdevs. - * - * NOTE: This command is currently undocumented. If the command is ever - * exposed then the appropriate usage() messages will need to be made. */ int zpool_do_reopen(int argc, char **argv) { + int c; int ret = 0; zpool_handle_t *zhp; char *pool; + /* check options */ + while ((c = getopt(argc, argv, "")) != -1) { + switch (c) { + case '?': + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + argc--; argv++; - if (argc != 1) - return (2); + if (argc < 1) { + (void) fprintf(stderr, gettext("missing pool name\n")); + usage(B_FALSE); + } + + if (argc > 1) { + (void) fprintf(stderr, gettext("too many arguments\n")); + usage(B_FALSE); + } pool = argv[0]; if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) |