summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorMark J Musante <Mark.Musante@Sun.COM>2008-12-04 10:07:24 -0500
committerMark J Musante <Mark.Musante@Sun.COM>2008-12-04 10:07:24 -0500
commitdeb8317b8f5925e3f6dd7cb6ed0cdd035f546a5a (patch)
treef3a89e055bf54e9000a2dda0f69c7933b5a2f141 /usr/src
parent5f41bf46ca5230bc3ee6b7d6a714a3a16a390261 (diff)
downloadillumos-joyent-deb8317b8f5925e3f6dd7cb6ed0cdd035f546a5a.tar.gz
6674216 "zfs share" doesn't work, but "zfs set sharenfs=on" does
6621164 $SRC/cmd/zfs/zfs_main.c seems to have a syntax error in the translation note 6635482 i18n problems in libzfs_dataset.c and zfs_main.c 6595194 "zfs get" VALUE column is as wide as NAME 6722991 vdev_disk.c: error checking for ddi_pathname_to_dev_t() must test for NODEV 6396518 ASSERT strings shouldn't be pre-processed
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zfs/zfs_main.c32
-rw-r--r--usr/src/lib/libzfs/common/libzfs_dataset.c4
-rw-r--r--usr/src/lib/libzfs/common/libzfs_util.c12
-rw-r--r--usr/src/uts/common/fs/zfs/vdev_disk.c2
-rw-r--r--usr/src/uts/common/sys/debug.h19
5 files changed, 35 insertions, 34 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index f9480ceba8..161a15392c 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -370,18 +370,12 @@ usage(boolean_t requested)
zfs_deleg_permissions();
} else {
- /*
- * TRANSLATION NOTE:
- * "zfs set|get" must not be localised this is the
- * command name and arguments.
- */
-
(void) fprintf(fp,
- gettext("\nFor the property list, run: zfs set|get\n"));
-
+ gettext("\nFor the property list, run: %s\n"),
+ "zfs set|get");
(void) fprintf(fp,
- gettext("\nFor the delegated permission list, run:"
- " zfs allow|unallow\n"));
+ gettext("\nFor the delegated permission list, run: %s\n"),
+ "zfs allow|unallow");
}
/*
@@ -419,7 +413,6 @@ parseprop(nvlist_t *props)
return (-1);
}
return (0);
-
}
/*
@@ -2584,14 +2577,15 @@ zfs_print_allows(char *ds)
for (curperms = perms; curperms; curperms = curperms->z_next) {
(void) snprintf(banner, sizeof (banner),
- "Permission sets on (%s)", curperms->z_setpoint);
+ gettext("Permission sets on (%s)"), curperms->z_setpoint);
allowcb.a_treeoffset =
offsetof(zfs_allow_node_t, z_localdescend);
allowcb.a_permcnt = 0;
zfs_iter_perms(&curperms->z_sets, banner, &allowcb);
(void) snprintf(banner, sizeof (banner),
- "Create time permissions on (%s)", curperms->z_setpoint);
+ gettext("Create time permissions on (%s)"),
+ curperms->z_setpoint);
allowcb.a_treeoffset =
offsetof(zfs_allow_node_t, z_localdescend);
allowcb.a_permcnt = 0;
@@ -2599,7 +2593,7 @@ zfs_print_allows(char *ds)
(void) snprintf(banner, sizeof (banner),
- "Local permissions on (%s)", curperms->z_setpoint);
+ gettext("Local permissions on (%s)"), curperms->z_setpoint);
allowcb.a_treeoffset = offsetof(zfs_allow_node_t, z_local);
allowcb.a_permcnt = 0;
zfs_iter_perms(&curperms->z_user, banner, &allowcb);
@@ -2607,7 +2601,8 @@ zfs_print_allows(char *ds)
zfs_iter_perms(&curperms->z_everyone, banner, &allowcb);
(void) snprintf(banner, sizeof (banner),
- "Descendent permissions on (%s)", curperms->z_setpoint);
+ gettext("Descendent permissions on (%s)"),
+ curperms->z_setpoint);
allowcb.a_treeoffset = offsetof(zfs_allow_node_t, z_descend);
allowcb.a_permcnt = 0;
zfs_iter_perms(&curperms->z_user, banner, &allowcb);
@@ -2615,7 +2610,7 @@ zfs_print_allows(char *ds)
zfs_iter_perms(&curperms->z_everyone, banner, &allowcb);
(void) snprintf(banner, sizeof (banner),
- "Local+Descendent permissions on (%s)",
+ gettext("Local+Descendent permissions on (%s)"),
curperms->z_setpoint);
allowcb.a_treeoffset =
offsetof(zfs_allow_node_t, z_localdescend);
@@ -3071,7 +3066,6 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
sizeof (shareopts), NULL, NULL, 0, B_FALSE) == 0);
verify(zfs_prop_get(zhp, ZFS_PROP_SHARESMB, smbshareopts,
sizeof (smbshareopts), NULL, NULL, 0, B_FALSE) == 0);
- canmount = zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT);
if (op == OP_SHARE && strcmp(shareopts, "off") == 0 &&
strcmp(smbshareopts, "off") == 0) {
@@ -3081,7 +3075,8 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
(void) fprintf(stderr, gettext("cannot share '%s': "
"legacy share\n"), zfs_get_name(zhp));
(void) fprintf(stderr, gettext("use share(1M) to "
- "share this filesystem\n"));
+ "share this filesystem, or set "
+ "sharenfs property on\n"));
return (1);
}
@@ -3119,6 +3114,7 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
* noauto no return 0
* noauto yes pass through
*/
+ canmount = zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT);
if (canmount == ZFS_CANMOUNT_OFF) {
if (!explicit)
return (0);
diff --git a/usr/src/lib/libzfs/common/libzfs_dataset.c b/usr/src/lib/libzfs/common/libzfs_dataset.c
index c70cd0a493..a381a0e63a 100644
--- a/usr/src/lib/libzfs/common/libzfs_dataset.c
+++ b/usr/src/lib/libzfs/common/libzfs_dataset.c
@@ -2902,8 +2902,8 @@ check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned,
zfs_handle_t *zhp;
char errbuf[1024];
- (void) snprintf(errbuf, sizeof (errbuf), "cannot create '%s'",
- path);
+ (void) snprintf(errbuf, sizeof (errbuf),
+ dgettext(TEXT_DOMAIN, "cannot create '%s'"), path);
/* get parent, and check to see if this is just a pool */
if (parent_name(path, parent, sizeof (parent)) != 0) {
diff --git a/usr/src/lib/libzfs/common/libzfs_util.c b/usr/src/lib/libzfs/common/libzfs_util.c
index 54de0f4b50..4270ac5206 100644
--- a/usr/src/lib/libzfs/common/libzfs_util.c
+++ b/usr/src/lib/libzfs/common/libzfs_util.c
@@ -796,6 +796,10 @@ zprop_print_headers(zprop_get_cbdata_t *cbp, zfs_type_t type)
cbp->cb_colwidths[GET_COL_SOURCE] = strlen(dgettext(TEXT_DOMAIN,
"SOURCE"));
+ /* first property is always NAME */
+ assert(cbp->cb_proplist->pl_prop ==
+ ((type == ZFS_TYPE_POOL) ? ZPOOL_PROP_NAME : ZFS_PROP_NAME));
+
/*
* Go through and calculate the widths for each column. For the
* 'source' column, we kludge it up by taking the worst-case scenario of
@@ -823,9 +827,13 @@ zprop_print_headers(zprop_get_cbdata_t *cbp, zfs_type_t type)
}
/*
- * 'VALUE' column
+ * 'VALUE' column. The first property is always the 'name'
+ * property that was tacked on either by /sbin/zfs's
+ * zfs_do_get() or when calling zprop_expand_list(), so we
+ * ignore its width. If the user specified the name property
+ * to display, then it will be later in the list in any case.
*/
- if ((pl->pl_prop != ZFS_PROP_NAME || !pl->pl_all) &&
+ if (pl != cbp->cb_proplist &&
pl->pl_width > cbp->cb_colwidths[GET_COL_VALUE])
cbp->cb_colwidths[GET_COL_VALUE] = pl->pl_width;
diff --git a/usr/src/uts/common/fs/zfs/vdev_disk.c b/usr/src/uts/common/fs/zfs/vdev_disk.c
index 0530d87971..294f138d3f 100644
--- a/usr/src/uts/common/fs/zfs/vdev_disk.c
+++ b/usr/src/uts/common/fs/zfs/vdev_disk.c
@@ -158,7 +158,7 @@ vdev_disk_open(vdev_t *vd, uint64_t *psize, uint64_t *ashift)
*/
if (error) {
if (vd->vdev_physpath != NULL &&
- (dev = ddi_pathname_to_dev_t(vd->vdev_physpath)) != ENODEV)
+ (dev = ddi_pathname_to_dev_t(vd->vdev_physpath)) != NODEV)
error = ldi_open_by_dev(&dev, OTYP_BLK, spa_mode(spa),
kcred, &dvd->vd_lh, zfs_li);
diff --git a/usr/src/uts/common/sys/debug.h b/usr/src/uts/common/sys/debug.h
index c156e7c463..ce941e8dae 100644
--- a/usr/src/uts/common/sys/debug.h
+++ b/usr/src/uts/common/sys/debug.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -31,8 +30,6 @@
#ifndef _SYS_DEBUG_H
#define _SYS_DEBUG_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/isa_defs.h>
#include <sys/types.h>
@@ -51,7 +48,7 @@ extern "C" {
extern int assfail(const char *, const char *, int);
#define VERIFY(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
#if DEBUG
-#define ASSERT(EX) VERIFY(EX)
+#define ASSERT(EX) ((void)((EX) || assfail(#EX, __FILE__, __LINE__)))
#else
#define ASSERT(x) ((void)0)
#endif
@@ -59,7 +56,7 @@ extern int assfail(const char *, const char *, int);
extern int assfail();
#define VERIFY(EX) ((void)((EX) || assfail("EX", __FILE__, __LINE__)))
#if DEBUG
-#define ASSERT(EX) VERIFY(EX)
+#define ASSERT(EX) ((void)((EX) || assfail("EX", __FILE__, __LINE__)))
#else
#define ASSERT(x) ((void)0)
#endif
@@ -99,9 +96,9 @@ _NOTE(CONSTCOND) } while (0)
#define VERIFY3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
#define VERIFY3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
#if DEBUG
-#define ASSERT3S(x, y, z) VERIFY3S(x, y, z)
-#define ASSERT3U(x, y, z) VERIFY3U(x, y, z)
-#define ASSERT3P(x, y, z) VERIFY3P(x, y, z)
+#define ASSERT3S(x, y, z) VERIFY3_IMPL(x, y, z, int64_t)
+#define ASSERT3U(x, y, z) VERIFY3_IMPL(x, y, z, uint64_t)
+#define ASSERT3P(x, y, z) VERIFY3_IMPL(x, y, z, uintptr_t)
#else
#define ASSERT3S(x, y, z) ((void)0)
#define ASSERT3U(x, y, z) ((void)0)