libzfs_dataset.c (297521) | libzfs_dataset.c (298472) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 3212 unchanged lines hidden (view full) --- 3221zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, 3222 nvlist_t *props) 3223{ 3224 int ret; 3225 uint64_t size = 0; 3226 uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); 3227 char errbuf[1024]; 3228 uint64_t zoned; | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 3212 unchanged lines hidden (view full) --- 3221zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type, 3222 nvlist_t *props) 3223{ 3224 int ret; 3225 uint64_t size = 0; 3226 uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE); 3227 char errbuf[1024]; 3228 uint64_t zoned; |
3229 dmu_objset_type_t ost; | 3229 enum lzc_dataset_type ost; |
3230 3231 (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, 3232 "cannot create '%s'"), path); 3233 3234 /* validate the path, taking care to note the extended error message */ 3235 if (!zfs_validate_name(hdl, path, type, B_TRUE)) 3236 return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf)); 3237 --- 10 unchanged lines hidden (view full) --- 3248 */ 3249 if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) { 3250 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, 3251 "dataset already exists")); 3252 return (zfs_error(hdl, EZFS_EXISTS, errbuf)); 3253 } 3254 3255 if (type == ZFS_TYPE_VOLUME) | 3230 3231 (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, 3232 "cannot create '%s'"), path); 3233 3234 /* validate the path, taking care to note the extended error message */ 3235 if (!zfs_validate_name(hdl, path, type, B_TRUE)) 3236 return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf)); 3237 --- 10 unchanged lines hidden (view full) --- 3248 */ 3249 if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) { 3250 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, 3251 "dataset already exists")); 3252 return (zfs_error(hdl, EZFS_EXISTS, errbuf)); 3253 } 3254 3255 if (type == ZFS_TYPE_VOLUME) |
3256 ost = DMU_OST_ZVOL; | 3256 ost = LZC_DATSET_TYPE_ZVOL; |
3257 else | 3257 else |
3258 ost = DMU_OST_ZFS; | 3258 ost = LZC_DATSET_TYPE_ZFS; |
3259 3260 /* open zpool handle for prop validation */ 3261 char pool_path[MAXNAMELEN]; 3262 (void) strlcpy(pool_path, path, sizeof (pool_path)); 3263 3264 /* truncate pool_path at first slash */ 3265 char *p = strchr(pool_path, '/'); 3266 if (p != NULL) --- 1630 unchanged lines hidden --- | 3259 3260 /* open zpool handle for prop validation */ 3261 char pool_path[MAXNAMELEN]; 3262 (void) strlcpy(pool_path, path, sizeof (pool_path)); 3263 3264 /* truncate pool_path at first slash */ 3265 char *p = strchr(pool_path, '/'); 3266 if (p != NULL) --- 1630 unchanged lines hidden --- |