diff options
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common')
8 files changed, 55 insertions, 55 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h index 8a707d1..fbfaab1 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h @@ -789,10 +789,10 @@ extern boolean_t libzfs_fru_compare(libzfs_handle_t *, const char *, extern boolean_t libzfs_fru_notself(libzfs_handle_t *, const char *); extern int zpool_fru_set(zpool_handle_t *, uint64_t, const char *); -#ifndef sun +#ifndef illumos extern int zmount(const char *, const char *, int, char *, char *, int, char *, int); -#endif /* !sun */ +#endif #ifdef __cplusplus } diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c index 8df7471..6d9b68f 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c @@ -1112,7 +1112,7 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl, } case ZFS_PROP_MLSLABEL: { -#ifdef sun +#ifdef illumos /* * Verify the mlslabel string and convert to * internal hex label string. @@ -1161,11 +1161,11 @@ badlabel: "invalid mlslabel '%s'"), strval); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); m_label_free(new_sl); /* OK if null */ -#else /* !sun */ +#else /* !illumos */ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "mlslabel is not supported on FreeBSD")); (void) zfs_error(hdl, EZFS_BADPROP, errbuf); -#endif /* !sun */ +#endif /* illumos */ goto error; } @@ -2423,7 +2423,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen, case ZFS_PROP_MLSLABEL: { -#ifdef sun +#ifdef illumos m_label_t *new_sl = NULL; char *ascii = NULL; /* human readable label */ @@ -2457,9 +2457,9 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen, (void) strlcpy(propbuf, ascii, proplen); free(ascii); -#else /* !sun */ +#else /* !illumos */ propbuf[0] = '\0'; -#endif /* !sun */ +#endif /* illumos */ } break; @@ -2569,7 +2569,7 @@ static int idmap_id_to_numeric_domain_rid(uid_t id, boolean_t isuser, char **domainp, idmap_rid_t *ridp) { -#ifdef sun +#ifdef illumos idmap_get_handle_t *get_hdl = NULL; idmap_stat status; int err = EINVAL; @@ -2594,10 +2594,10 @@ out: if (get_hdl) idmap_get_destroy(get_hdl); return (err); -#else /* !sun */ +#else /* !illumos */ assert(!"invalid code path"); return (EINVAL); // silence compiler warning -#endif /* !sun */ +#endif /* illumos */ } /* @@ -2632,7 +2632,7 @@ userquota_propname_decode(const char *propname, boolean_t zoned, cp = strchr(propname, '@') + 1; if (strchr(cp, '@')) { -#ifdef sun +#ifdef illumos /* * It's a SID name (eg "user@domain") that needs to be * turned into S-1-domainID-RID. @@ -2678,9 +2678,9 @@ userquota_propname_decode(const char *propname, boolean_t zoned, cp = numericsid; *ridp = rid; /* will be further decoded below */ -#else /* !sun */ +#else /* !illumos */ return (ENOENT); -#endif /* !sun */ +#endif /* illumos */ } if (strncmp(cp, "S-1-", 4) == 0) { @@ -4184,7 +4184,7 @@ zfs_prune_proplist(zfs_handle_t *zhp, uint8_t *props) } } -#ifdef sun +#ifdef illumos static int zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path, zfs_smb_acl_op_t cmd, char *resource1, char *resource2) @@ -4266,7 +4266,7 @@ zfs_smb_acl_rename(libzfs_handle_t *hdl, char *dataset, char *path, return (zfs_smb_acl_mgmt(hdl, dataset, path, ZFS_SMB_ACL_RENAME, oldname, newname)); } -#endif /* sun */ +#endif /* illumos */ int zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type, diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c index ab2007d..dde329a 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c @@ -494,7 +494,7 @@ find_shares_object(differ_info_t *di) (void) strlcat(fullpath, ZDIFF_SHARESDIR, MAXPATHLEN); if (stat64(fullpath, &sb) != 0) { -#ifdef sun +#ifdef illumos (void) snprintf(di->errbuf, sizeof (di->errbuf), dgettext(TEXT_DOMAIN, "Cannot stat %s"), fullpath); return (zfs_error(di->zhp->zfs_hdl, EZFS_DIFF, di->errbuf)); diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c index 49a4385..67eba1b 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c @@ -952,7 +952,7 @@ slice_cache_compare(const void *arg1, const void *arg2) return (rv > 0 ? 1 : -1); } -#ifdef sun +#ifdef illumos static void check_one_slice(avl_tree_t *r, char *diskname, uint_t partno, diskaddr_t size, uint_t blksz) @@ -975,12 +975,12 @@ check_one_slice(avl_tree_t *r, char *diskname, uint_t partno, (node = avl_find(r, &tmpnode, NULL))) node->rn_nozpool = B_TRUE; } -#endif /* sun */ +#endif /* illumos */ static void nozpool_all_slices(avl_tree_t *r, const char *sname) { -#ifdef sun +#ifdef illumos char diskname[MAXNAMELEN]; char *ptr; int i; @@ -996,10 +996,10 @@ nozpool_all_slices(avl_tree_t *r, const char *sname) ptr[0] = 'p'; for (i = 0; i <= FD_NUMPART; i++) check_one_slice(r, diskname, i, 0, 1); -#endif /* sun */ +#endif /* illumos */ } -#ifdef sun +#ifdef illumos static void check_slices(avl_tree_t *r, int fd, const char *sname) { @@ -1033,7 +1033,7 @@ check_slices(avl_tree_t *r, int fd, const char *sname) efi_free(gpt); } } -#endif /* sun */ +#endif /* illumos */ static void zpool_open_func(void *arg) @@ -1063,7 +1063,7 @@ zpool_open_func(void *arg) return; } /* this file is too small to hold a zpool */ -#ifdef sun +#ifdef illumos if (S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE) { (void) close(fd); @@ -1075,12 +1075,12 @@ zpool_open_func(void *arg) */ check_slices(rn->rn_avl, fd, rn->rn_name); } -#else /* !sun */ +#else /* !illumos */ if (statbuf.st_size < SPA_MINDEVSIZE) { (void) close(fd); return; } -#endif /* sun */ +#endif /* illumos */ if ((zpool_read_label(fd, &config)) != 0) { (void) close(fd); diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c index f8596ed..6c11515 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c @@ -139,7 +139,7 @@ is_shared(libzfs_handle_t *hdl, const char *mountpoint, zfs_share_proto_t proto) *tab = '\0'; if (strcmp(buf, mountpoint) == 0) { -#ifdef sun +#ifdef illumos /* * the protocol field is the third field * skip over second field @@ -172,7 +172,7 @@ is_shared(libzfs_handle_t *hdl, const char *mountpoint, zfs_share_proto_t proto) return (SHARED_NOT_SHARED); } -#ifdef sun +#ifdef illumos /* * Returns true if the specified directory is empty. If we can't open the * directory at all, return true so that the mount can fail with a more @@ -297,7 +297,7 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int flags) } } -#ifdef sun /* FreeBSD: overlay mounts are not checked. */ +#ifdef illumos /* FreeBSD: overlay mounts are not checked. */ /* * Determine if the mountpoint is empty. If so, refuse to perform the * mount. We don't perform this check if MS_OVERLAY is specified, which @@ -507,7 +507,7 @@ zfs_is_shared_smb(zfs_handle_t *zhp, char **where) * initialized in _zfs_init_libshare() are actually present. */ -#ifdef sun +#ifdef illumos static sa_handle_t (*_sa_init)(int); static void (*_sa_fini)(sa_handle_t); static sa_share_t (*_sa_find_share)(sa_handle_t, char *); @@ -534,7 +534,7 @@ static void (*_sa_update_sharetab_ts)(sa_handle_t); static void _zfs_init_libshare(void) { -#ifdef sun +#ifdef illumos void *libshare; char path[MAXPATHLEN]; char isa[MAXISALEN]; @@ -605,7 +605,7 @@ zfs_init_libshare(libzfs_handle_t *zhandle, int service) { int ret = SA_OK; -#ifdef sun +#ifdef illumos if (_sa_init == NULL) ret = SA_CONFIG_ERR; @@ -646,7 +646,7 @@ void zfs_uninit_libshare(libzfs_handle_t *zhandle) { if (zhandle != NULL && zhandle->libzfs_sharehdl != NULL) { -#ifdef sun +#ifdef illumos if (_sa_fini != NULL) _sa_fini(zhandle->libzfs_sharehdl); #endif @@ -663,7 +663,7 @@ zfs_uninit_libshare(libzfs_handle_t *zhandle) int zfs_parse_options(char *options, zfs_share_proto_t proto) { -#ifdef sun +#ifdef illumos if (_sa_parse_legacy_options != NULL) { return (_sa_parse_legacy_options(NULL, options, proto_table[proto].p_name)); @@ -674,7 +674,7 @@ zfs_parse_options(char *options, zfs_share_proto_t proto) #endif } -#ifdef sun +#ifdef illumos /* * zfs_sa_find_share(handle, path) * @@ -716,7 +716,7 @@ zfs_sa_disable_share(sa_share_t share, char *proto) return (_sa_disable_share(share, proto)); return (SA_CONFIG_ERR); } -#endif /* sun */ +#endif /* illumos */ /* * Share the given filesystem according to the options in the specified @@ -767,7 +767,7 @@ zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto) if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED)) continue; -#ifdef sun +#ifdef illumos share = zfs_sa_find_share(hdl->libzfs_sharehdl, mountpoint); if (share == NULL) { /* @@ -856,7 +856,7 @@ static int unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint, zfs_share_proto_t proto) { -#ifdef sun +#ifdef illumos sa_share_t share; int err; char *mntpt; diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c index b8f126c..78a34f9 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c @@ -409,7 +409,7 @@ bootfs_name_valid(const char *pool, char *bootfs) static boolean_t pool_uses_efi(nvlist_t *config) { -#ifdef sun +#ifdef illumos nvlist_t **child; uint_t c, children; @@ -421,7 +421,7 @@ pool_uses_efi(nvlist_t *config) if (pool_uses_efi(child[c])) return (B_TRUE); } -#endif /* sun */ +#endif /* illumos */ return (B_FALSE); } @@ -575,7 +575,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL), ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0); -#ifdef sun +#ifdef illumos /* * bootfs property cannot be set on a disk which has * been EFI labeled. @@ -588,7 +588,7 @@ zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname, zpool_close(zhp); goto error; } -#endif /* sun */ +#endif /* illumos */ zpool_close(zhp); break; @@ -2384,7 +2384,7 @@ zpool_get_physpath(zpool_handle_t *zhp, char *physpath, size_t phypath_size) static int zpool_relabel_disk(libzfs_handle_t *hdl, const char *name) { -#ifdef sun +#ifdef illumos char path[MAXPATHLEN]; char errbuf[1024]; int fd, error; @@ -2414,7 +2414,7 @@ zpool_relabel_disk(libzfs_handle_t *hdl, const char *name) "relabel '%s': unable to read disk capacity"), name); return (zfs_error(hdl, EZFS_NOCAP, errbuf)); } -#endif /* sun */ +#endif /* illumos */ return (0); } @@ -3470,7 +3470,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv, devid_str_free(newdevid); } -#ifdef sun +#ifdef illumos if (strncmp(path, "/dev/dsk/", 9) == 0) path += 9; @@ -3495,10 +3495,10 @@ zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv, } return (tmp); } -#else /* !sun */ +#else /* !illumos */ if (strncmp(path, _PATH_DEV, sizeof(_PATH_DEV) - 1) == 0) path += sizeof(_PATH_DEV) - 1; -#endif /* !sun */ +#endif /* illumos */ } else { verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &path) == 0); @@ -3888,7 +3888,7 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj, free(mntpnt); } -#ifdef sun +#ifdef illumos /* * Read the EFI label from the config, if a label does not exist then * pass back the error to the caller. If the caller has passed a non-NULL @@ -3953,7 +3953,7 @@ find_start_block(nvlist_t *config) } return (MAXOFFSET_T); } -#endif /* sun */ +#endif /* illumos */ /* * Label an individual disk. The name provided is the short name, @@ -3962,7 +3962,7 @@ find_start_block(nvlist_t *config) int zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) { -#ifdef sun +#ifdef illumos char path[MAXPATHLEN]; struct dk_gpt *vtoc; int fd; @@ -4067,7 +4067,7 @@ zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) (void) close(fd); efi_free(vtoc); -#endif /* sun */ +#endif /* illumos */ return (0); } diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c index 91857b6..954adac 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c @@ -949,7 +949,7 @@ dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj, case EIO: case ENOLINK: case ENOSPC: -#ifdef sun +#ifdef illumos case ENOSTR: #endif case ENXIO: diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c index 3b59914..427b2fd 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c @@ -687,7 +687,7 @@ libzfs_fini(libzfs_handle_t *hdl) (void) fclose(hdl->libzfs_sharetab); zfs_uninit_libshare(hdl); zpool_free_handles(hdl); -#ifdef sun +#ifdef illumos libzfs_fru_clear(hdl, B_TRUE); #endif namespace_clear(hdl); @@ -739,7 +739,7 @@ zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype) return (NULL); } -#ifdef sun +#ifdef illumos rewind(hdl->libzfs_mnttab); while ((ret = getextmntent(hdl->libzfs_mnttab, &entry, 0)) == 0) { if (makedevice(entry.mnt_major, entry.mnt_minor) == @@ -759,7 +759,7 @@ zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype) strerror(errno)); } } -#endif /* sun */ +#endif /* illumos */ if (ret != 0) { return (NULL); } |