usr/src/uts/common/fs/zfs/zfs_ioctl.c
changeset 6492 903545192033
parent 6423 437422a29d3a
child 6643 3a34b0dbb107
equal deleted inserted replaced
6491:448e02e63395 6492:903545192033
  1809  * properties for these, so remove them from the source nvlist after
  1809  * properties for these, so remove them from the source nvlist after
  1810  * processing.
  1810  * processing.
  1811  */
  1811  */
  1812 static int
  1812 static int
  1813 zfs_fill_zplprops(const char *dataset, nvlist_t *createprops,
  1813 zfs_fill_zplprops(const char *dataset, nvlist_t *createprops,
  1814     nvlist_t *zplprops, uint64_t zplver)
  1814     nvlist_t *zplprops, uint64_t zplver, boolean_t *is_ci)
  1815 {
  1815 {
  1816 	objset_t *os;
  1816 	objset_t *os;
  1817 	char parentname[MAXNAMELEN];
  1817 	char parentname[MAXNAMELEN];
  1818 	char *cp;
  1818 	char *cp;
  1819 	uint64_t sense = ZFS_PROP_UNDEFINED;
  1819 	uint64_t sense = ZFS_PROP_UNDEFINED;
  1889 	if (sense == ZFS_PROP_UNDEFINED)
  1889 	if (sense == ZFS_PROP_UNDEFINED)
  1890 		VERIFY(zfs_get_zplprop(os, ZFS_PROP_CASE, &sense) == 0);
  1890 		VERIFY(zfs_get_zplprop(os, ZFS_PROP_CASE, &sense) == 0);
  1891 	VERIFY(nvlist_add_uint64(zplprops,
  1891 	VERIFY(nvlist_add_uint64(zplprops,
  1892 	    zfs_prop_to_name(ZFS_PROP_CASE), sense) == 0);
  1892 	    zfs_prop_to_name(ZFS_PROP_CASE), sense) == 0);
  1893 
  1893 
       
  1894 	if (is_ci)
       
  1895 		*is_ci = (sense == ZFS_CASE_INSENSITIVE);
       
  1896 
  1894 	dmu_objset_close(os);
  1897 	dmu_objset_close(os);
  1895 	return (0);
  1898 	return (0);
  1896 }
  1899 }
  1897 
  1900 
  1898 /*
  1901 /*
  1954 		    DS_MODE_STANDARD | DS_MODE_READONLY, &clone);
  1957 		    DS_MODE_STANDARD | DS_MODE_READONLY, &clone);
  1955 		if (error) {
  1958 		if (error) {
  1956 			nvlist_free(nvprops);
  1959 			nvlist_free(nvprops);
  1957 			return (error);
  1960 			return (error);
  1958 		}
  1961 		}
  1959 		error = dmu_objset_create(zc->zc_name, type, clone, NULL, NULL);
  1962 
       
  1963 		error = dmu_objset_create(zc->zc_name, type, clone, 0,
       
  1964 		    NULL, NULL);
  1960 		if (error) {
  1965 		if (error) {
  1961 			dmu_objset_close(clone);
  1966 			dmu_objset_close(clone);
  1962 			nvlist_free(nvprops);
  1967 			nvlist_free(nvprops);
  1963 			return (error);
  1968 			return (error);
  1964 		}
  1969 		}
  1965 		dmu_objset_close(clone);
  1970 		dmu_objset_close(clone);
  1966 	} else {
  1971 	} else {
       
  1972 		boolean_t is_insensitive = B_FALSE;
       
  1973 
  1967 		if (cbfunc == NULL) {
  1974 		if (cbfunc == NULL) {
  1968 			nvlist_free(nvprops);
  1975 			nvlist_free(nvprops);
  1969 			return (EINVAL);
  1976 			return (EINVAL);
  1970 		}
  1977 		}
  1971 
  1978 
  2036 			 * now.
  2043 			 * now.
  2037 			 */
  2044 			 */
  2038 			VERIFY(nvlist_alloc(&zct.zct_zplprops,
  2045 			VERIFY(nvlist_alloc(&zct.zct_zplprops,
  2039 			    NV_UNIQUE_NAME, KM_SLEEP) == 0);
  2046 			    NV_UNIQUE_NAME, KM_SLEEP) == 0);
  2040 			error = zfs_fill_zplprops(zc->zc_name, nvprops,
  2047 			error = zfs_fill_zplprops(zc->zc_name, nvprops,
  2041 			    zct.zct_zplprops, version);
  2048 			    zct.zct_zplprops, version, &is_insensitive);
  2042 			if (error != 0) {
  2049 			if (error != 0) {
  2043 				nvlist_free(nvprops);
  2050 				nvlist_free(nvprops);
  2044 				nvlist_free(zct.zct_zplprops);
  2051 				nvlist_free(zct.zct_zplprops);
  2045 				return (error);
  2052 				return (error);
  2046 			}
  2053 			}
  2047 		}
  2054 		}
  2048 		error = dmu_objset_create(zc->zc_name, type, NULL, cbfunc,
  2055 		error = dmu_objset_create(zc->zc_name, type, NULL,
  2049 		    &zct);
  2056 		    is_insensitive ? DS_FLAG_CI_DATASET : 0, cbfunc, &zct);
  2050 		nvlist_free(zct.zct_zplprops);
  2057 		nvlist_free(zct.zct_zplprops);
  2051 
       
  2052 	}
  2058 	}
  2053 
  2059 
  2054 	/*
  2060 	/*
  2055 	 * It would be nice to do this atomically.
  2061 	 * It would be nice to do this atomically.
  2056 	 */
  2062 	 */