summaryrefslogtreecommitdiffstats
path: root/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-04-22 13:00:27 +0000
committeravg <avg@FreeBSD.org>2016-04-22 13:00:27 +0000
commit2a471649019b98c148ff2ee6e1ab87cc96a3a845 (patch)
treef4347ef540d8c19c2261ad1fe498b5813025285a /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
parent1f176af7b394740bac04dec96b22481c88bd00ed (diff)
downloadFreeBSD-src-2a471649019b98c148ff2ee6e1ab87cc96a3a845.zip
FreeBSD-src-2a471649019b98c148ff2ee6e1ab87cc96a3a845.tar.gz
MFV r298471: 6052 decouple lzc_create() from the implementation details
illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9 https://www.illumos.org/issues/6052 At the moment type parameter of lzc_create() is of dmu_objset_type_t type. That exposes an implementation detail and requires sys/fs/zfs.h to be included in libzfs_core.h creating unnecessary coupling between libzfs_core interface and ZFS internals. I think that dmu_objset_type_t should be replaced with a libzfs_core enumeration of supported dataset types. For ABI reasons the new enumeration could be bit-compatible with dmu_objset_type_t. For example: typedef enum { LZC_DST_ZFS = 2, LZC_DST_ZVOL } lzc_dataset_type_t; Reviewed by: Matthew Ahrens <mahrens@delphix.com> Approved by: Richard Lowe <richlowe@richlowe.net> Author: Andriy Gapon <andriy.gapon@clusterhq.com> MFC after: 2 weeks Sponsored by: ClusterHQ
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
index 4ed7c2b..dbafaa9 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
@@ -3226,7 +3226,7 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE);
char errbuf[1024];
uint64_t zoned;
- dmu_objset_type_t ost;
+ enum lzc_dataset_type ost;
(void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
"cannot create '%s'"), path);
@@ -3253,9 +3253,9 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
}
if (type == ZFS_TYPE_VOLUME)
- ost = DMU_OST_ZVOL;
+ ost = LZC_DATSET_TYPE_ZVOL;
else
- ost = DMU_OST_ZFS;
+ ost = LZC_DATSET_TYPE_ZFS;
/* open zpool handle for prop validation */
char pool_path[MAXNAMELEN];
OpenPOWER on IntegriCloud