xref: /onnv-gate/usr/src/lib/libzfs_jni/common/libzfs_jni_pool.h (revision 5582:c4c30e76a747)
1789Sahrens /*
2789Sahrens  * CDDL HEADER START
3789Sahrens  *
4789Sahrens  * The contents of this file are subject to the terms of the
51499Stalley  * Common Development and Distribution License (the "License").
61499Stalley  * You may not use this file except in compliance with the License.
7789Sahrens  *
8789Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9789Sahrens  * or http://www.opensolaris.org/os/licensing.
10789Sahrens  * See the License for the specific language governing permissions
11789Sahrens  * and limitations under the License.
12789Sahrens  *
13789Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14789Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15789Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16789Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17789Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18789Sahrens  *
19789Sahrens  * CDDL HEADER END
20789Sahrens  */
211499Stalley 
22789Sahrens /*
23*5582Scristian  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24789Sahrens  * Use is subject to license terms.
25789Sahrens  */
26789Sahrens 
27789Sahrens #ifndef _LIBZFS_JNI_POOL_H
28789Sahrens #define	_LIBZFS_JNI_POOL_H
29789Sahrens 
30789Sahrens #pragma ident	"%Z%%M%	%I%	%E% SMI"
31789Sahrens 
32789Sahrens #include <jni.h>
33789Sahrens #include <libnvpair.h>
34789Sahrens #include <libzfs.h>
35895Stalley #include <libzfs_jni_ipool.h>
361206Stalley #include <libzfs_jni_util.h>
371206Stalley 
381499Stalley #ifdef __cplusplus
391499Stalley extern "C" {
401499Stalley #endif
411499Stalley 
421206Stalley /*
431206Stalley  * Types
441206Stalley  */
451206Stalley 
461206Stalley typedef struct DeviceStatsBean {
471206Stalley 	jmethodID method_setSize;
481328Stalley 	jmethodID method_setReplacementSize;
491206Stalley 	jmethodID method_setUsed;
501206Stalley 	jmethodID method_setReadBytes;
511206Stalley 	jmethodID method_setWriteBytes;
521206Stalley 	jmethodID method_setReadOperations;
531206Stalley 	jmethodID method_setWriteOperations;
541206Stalley 	jmethodID method_setReadErrors;
551206Stalley 	jmethodID method_setWriteErrors;
561206Stalley 	jmethodID method_setChecksumErrors;
571206Stalley 	jmethodID method_setDeviceState;
581206Stalley 	jmethodID method_setDeviceStatus;
591206Stalley } DeviceStatsBean_t;
601206Stalley 
611206Stalley typedef struct PoolStatsBean {
621206Stalley 	DeviceStatsBean_t super;
631206Stalley 	jmethodID method_setPoolState;
641206Stalley 	jmethodID method_setPoolStatus;
65*5582Scristian 	jmethodID method_setPoolVersion;
661206Stalley } PoolStatsBean_t;
67789Sahrens 
68789Sahrens /*
69789Sahrens  * Function prototypes
70789Sahrens  */
71789Sahrens 
721206Stalley void new_DeviceStats(JNIEnv *, DeviceStatsBean_t *, zjni_Object_t *);
731206Stalley void new_PoolStats(JNIEnv *, PoolStatsBean_t *, zjni_Object_t *);
74789Sahrens nvlist_t *zjni_get_root_vdev(zpool_handle_t *);
751499Stalley nvlist_t *zjni_get_vdev(zpool_handle_t *, nvlist_t *, uint64_t, uint64_t *);
76789Sahrens jobject zjni_get_VirtualDevice_from_vdev(
771499Stalley     JNIEnv *, zpool_handle_t *, nvlist_t *, uint64_t *p_vdev_id);
78789Sahrens jobject zjni_get_VirtualDevices_from_vdev(
791499Stalley     JNIEnv *, zpool_handle_t *, nvlist_t *, uint64_t *p_vdev_id);
801206Stalley int zjni_create_add_ImportablePool(nvlist_t *, void *);
811206Stalley int populate_DeviceStatsBean(
821206Stalley     JNIEnv *, nvlist_t *, DeviceStatsBean_t *, zjni_Object_t *);
831206Stalley jobject zjni_pool_state_to_obj(JNIEnv *, pool_state_t);
841206Stalley jobject zjni_pool_status_to_obj(JNIEnv *, zpool_status_t);
85789Sahrens 
86789Sahrens #ifdef __cplusplus
87789Sahrens }
88789Sahrens #endif
89789Sahrens 
90789Sahrens #endif /* _LIBZFS_JNI_POOL_H */
91