/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 2015 by Delphix. All rights reserved.
*/
#include "libzfs_jni_property.h"
#include "libzfs_jni_util.h"
#include <strings.h>
/*
* Types
*/
/* Signature for function to convert string to a specific Java object */
/* Signature for function to convert uint64_t to a specific Java object */
/*
* Describes a property and the parameters needed to create a Java
* Property object for it
*/
typedef struct custom_prop_desct {
char *propClass;
char *valueClass;
/*
* Function prototypes
*/
str_to_obj_f, uint64_to_obj_f, char *, char *);
static jobject create_default_ObjectProperty(
/*
* Static data
*/
};
};
/* ZFS_PROP_TYPE, */
};
ZFSJNI_PACKAGE_DATA "AclInheritProperty",
ZFSJNI_PACKAGE_DATA "AclInheritProperty$AclInherit" },
ZFSJNI_PACKAGE_DATA "AclModeProperty",
ZFSJNI_PACKAGE_DATA "AclModeProperty$AclMode" },
ZFSJNI_PACKAGE_DATA "ChecksumProperty",
ZFSJNI_PACKAGE_DATA "ChecksumProperty$Checksum" },
ZFSJNI_PACKAGE_DATA "CompressionProperty",
ZFSJNI_PACKAGE_DATA "CompressionProperty$Compression" },
ZFSJNI_PACKAGE_DATA "CompressRatioProperty",
ZFSJNI_PACKAGE_DATA "CreationProperty",
ZFSJNI_PACKAGE_DATA "MountPointProperty",
ZFSJNI_PACKAGE_DATA "RecordSizeProperty",
ZFSJNI_PACKAGE_DATA "ShareNFSProperty",
ZFSJNI_PACKAGE_DATA "SnapDirProperty",
ZFSJNI_PACKAGE_DATA "SnapDirProperty$SnapDir" },
ZFSJNI_PACKAGE_DATA "VolBlockSizeProperty",
};
/*
* Static functions
*/
static jobject
char *propClass, char *valueClass)
{
if (convert_str != NULL) {
if (result == 0)
} else {
if (result == 0)
}
if (srctype == ZPROP_SRC_INHERITED) {
} else {
ZFSJNI_PACKAGE_DATA "Property$Lineage;)V",
}
}
return (propertyObject);
}
static jobject
{
}
static jobject
{
}
static jobject
{
}
static jobject
char *propClass, char *valueClass)
{
if (convert_str != NULL) {
if (result == 0)
} else {
if (result == 0)
}
if (srctype == ZPROP_SRC_INHERITED) {
"(L%s;Ljava/lang/String;)V", valueClass);
} else {
}
}
return (propertyObject);
}
static jobject
char *propClass, char *valueClass)
{
if (!zfs_prop_readonly(prop)) {
if (convert_str != NULL) {
} else {
}
"(Ljava/lang/String;L%s;ZL" ZFSJNI_PACKAGE_DATA
"Property$Lineage;)V", valueClass);
}
}
return (propertyObject);
}
static jobject
{
}
static jobject
{
}
static jobject
{
}
static jobject
char *propClass, char *valueClass)
{
if (!zfs_prop_readonly(prop)) {
if (convert_str != NULL) {
} else {
}
}
}
return (propertyObject);
}
static jobject
{
"(Ljava/lang/String;)L%s;", valueClass);
}
static jobject
{
ZFSJNI_PACKAGE_DATA "AclInheritProperty$AclInherit"));
}
static jobject
{
ZFSJNI_PACKAGE_DATA "AclModeProperty$AclMode"));
}
static jobject
{
ZFSJNI_PACKAGE_DATA "ChecksumProperty$Checksum"));
}
static jobject
{
ZFSJNI_PACKAGE_DATA "CompressionProperty$Compression"));
}
static jobject
{
ZFSJNI_PACKAGE_DATA "SnapDirProperty$SnapDir"));
}
static jobject
{
}
/*
* Package-private functions
*/
{
int i;
for (i = 0; props_boolean[i] != ZPROP_INVAL; i++) {
if (prop == props_boolean[i]) {
}
}
for (i = 0; props_long[i] != ZPROP_INVAL; i++) {
if (prop == props_long[i]) {
}
}
for (i = 0; props_string[i] != ZPROP_INVAL; i++) {
if (prop == props_string[i]) {
}
}
return create_default_ObjectProperty(env,
props_custom[i].prop,
props_custom[i].valueClass);
}
}
return (NULL);
}
static int
{
return (prop);
return (ZPROP_CONT);
}
{
}
{
/* zprop_source_t to Property$Lineage map */
{ ZPROP_SRC_NONE, "ZFS_PROP_LINEAGE_NOTINHERITABLE" },
{ ZPROP_SRC_DEFAULT, "ZFS_PROP_LINEAGE_DEFAULT" },
{ ZPROP_SRC_LOCAL, "ZFS_PROP_LINEAGE_LOCAL" },
{ ZPROP_SRC_TEMPORARY, "ZFS_PROP_LINEAGE_TEMPORARY" },
{ ZPROP_SRC_INHERITED, "ZFS_PROP_LINEAGE_INHERITED" }
};
ZFSJNI_PACKAGE_DATA "Property$Lineage",
"ZFS_PROP_LINEAGE_INHERITED", lineage_map));
}
{
int i;
/* Create an array list for the properties */
for (i = 0; props_boolean[i] != ZPROP_INVAL; i++) {
/* Create property and add to list */
/* Does this property apply to this object? */
(*env)->CallBooleanMethod(
} else {
return (NULL);
}
#ifdef DEBUG
zfs_get_name(zhp));
#endif
}
}
for (i = 0; props_long[i] != ZPROP_INVAL; i++) {
/* Create property and add to list */
/* Does this property apply to this object? */
(*env)->CallBooleanMethod(
} else {
return (NULL);
}
#ifdef DEBUG
zfs_get_name(zhp));
#endif
}
}
for (i = 0; props_string[i] != ZPROP_INVAL; i++) {
/* Create property and add to list */
/* Does this property apply to this object? */
(*env)->CallBooleanMethod(
} else {
return (NULL);
}
#ifdef DEBUG
zfs_get_name(zhp));
#endif
}
}
/* Create property and add to list */
/* Does this property apply to this object? */
(*env)->CallBooleanMethod(
} else {
return (NULL);
}
#ifdef DEBUG
zfs_get_name(zhp));
#endif
}
}
return (zjni_Collection_to_array(env,
}