summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zfs/zfs_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/zfs/zfs_main.c')
-rw-r--r--usr/src/cmd/zfs/zfs_main.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index 5710b19472..fc55e465b1 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -1482,7 +1482,7 @@ get_callback(zfs_handle_t *zhp, void *data)
char buf[ZFS_MAXPROPLEN];
char rbuf[ZFS_MAXPROPLEN];
zprop_source_t sourcetype;
- char source[ZFS_MAXNAMELEN];
+ char source[ZFS_MAX_DATASET_NAME_LEN];
zprop_get_cbdata_t *cbp = data;
nvlist_t *user_props = zfs_get_user_props(zhp);
zprop_list_t *pl = cbp->cb_proplist;
@@ -1962,7 +1962,7 @@ typedef struct upgrade_cbdata {
uint64_t cb_version;
boolean_t cb_newer;
boolean_t cb_foundone;
- char cb_lastfs[ZFS_MAXNAMELEN];
+ char cb_lastfs[ZFS_MAX_DATASET_NAME_LEN];
} upgrade_cbdata_t;
static int
@@ -2408,7 +2408,7 @@ userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
if (domain != NULL && domain[0] != '\0') {
/* SMB */
- char sid[ZFS_MAXNAMELEN + 32];
+ char sid[MAXNAMELEN + 32];
uid_t id;
int err;
int flag = IDMAP_REQ_FLG_USE_CACHE;
@@ -2537,7 +2537,7 @@ print_us_node(boolean_t scripted, boolean_t parsable, int *fields, int types,
size_t *width, us_node_t *node)
{
nvlist_t *nvl = node->usn_nvl;
- char valstr[ZFS_MAXNAMELEN];
+ char valstr[MAXNAMELEN];
boolean_t first = B_TRUE;
int cfield = 0;
int field;
@@ -3405,7 +3405,7 @@ zfs_do_rollback(int argc, char **argv)
boolean_t force = B_FALSE;
rollback_cbdata_t cb = { 0 };
zfs_handle_t *zhp, *snap;
- char parentname[ZFS_MAXNAMELEN];
+ char parentname[ZFS_MAX_DATASET_NAME_LEN];
char *delim;
/* check options */
@@ -3805,7 +3805,7 @@ zfs_do_send(int argc, char **argv)
*/
if (strchr(argv[0], '@') == NULL ||
(fromname && strchr(fromname, '#') != NULL)) {
- char frombuf[ZFS_MAXNAMELEN];
+ char frombuf[ZFS_MAX_DATASET_NAME_LEN];
enum lzc_send_flags lzc_flags = 0;
if (flags.replicate || flags.doall || flags.props ||
@@ -3857,7 +3857,7 @@ zfs_do_send(int argc, char **argv)
* case if they specify the origin.
*/
if (fromname && (cp = strchr(fromname, '@')) != NULL) {
- char origin[ZFS_MAXNAMELEN];
+ char origin[ZFS_MAX_DATASET_NAME_LEN];
zprop_source_t src;
(void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
@@ -3991,7 +3991,7 @@ zfs_do_receive(int argc, char **argv)
usage(B_FALSE);
}
- char namebuf[ZFS_MAXNAMELEN];
+ char namebuf[ZFS_MAX_DATASET_NAME_LEN];
(void) snprintf(namebuf, sizeof (namebuf),
"%s/%%recv", argv[0]);
@@ -4849,7 +4849,7 @@ store_allow_perm(zfs_deleg_who_type_t type, boolean_t local, boolean_t descend,
{
int i;
char ld[2] = { '\0', '\0' };
- char who_buf[ZFS_MAXNAMELEN+32];
+ char who_buf[MAXNAMELEN + 32];
char base_type = '\0';
char set_type = '\0';
nvlist_t *base_nvl = NULL;
@@ -5217,7 +5217,7 @@ static void
print_fs_perms(fs_perm_set_t *fspset)
{
fs_perm_node_t *node = NULL;
- char buf[ZFS_MAXNAMELEN+32];
+ char buf[MAXNAMELEN + 32];
const char *dsname = buf;
for (node = uu_list_first(fspset->fsps_list); node != NULL;
@@ -5226,7 +5226,7 @@ print_fs_perms(fs_perm_set_t *fspset)
uu_avl_t *uge_avl = node->fspn_fsperm.fsp_uge_avl;
int left = 0;
- (void) snprintf(buf, ZFS_MAXNAMELEN+32,
+ (void) snprintf(buf, sizeof (buf),
gettext("---- Permissions on %s "),
node->fspn_fsperm.fsp_name);
(void) printf(dsname);
@@ -5423,7 +5423,7 @@ zfs_do_hold_rele_impl(int argc, char **argv, boolean_t holding)
for (i = 0; i < argc; ++i) {
zfs_handle_t *zhp;
- char parent[ZFS_MAXNAMELEN];
+ char parent[ZFS_MAX_DATASET_NAME_LEN];
const char *delim;
char *path = argv[i];
@@ -5551,7 +5551,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
nvlist_t *nvl = NULL;
nvpair_t *nvp = NULL;
const char *zname = zfs_get_name(zhp);
- size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN);
+ size_t znamelen = strlen(zname);
if (cbp->cb_recursive) {
const char *snapname;
@@ -5572,7 +5572,7 @@ holds_callback(zfs_handle_t *zhp, void *data)
while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
const char *tag = nvpair_name(nvp);
- size_t taglen = strnlen(tag, MAXNAMELEN);
+ size_t taglen = strlen(tag);
if (taglen > cbp->cb_max_taglen)
cbp->cb_max_taglen = taglen;
}
@@ -6822,7 +6822,7 @@ zfs_do_diff(int argc, char **argv)
static int
zfs_do_bookmark(int argc, char **argv)
{
- char snapname[ZFS_MAXNAMELEN];
+ char snapname[ZFS_MAX_DATASET_NAME_LEN];
zfs_handle_t *zhp;
nvlist_t *nvl;
int ret = 0;