2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License, Version 1.0 only
2N/A * (the "License"). You may not use this file except in compliance
2N/A * with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A#ifndef _POOL_KERNEL_IMPL_H
2N/A#define _POOL_KERNEL_IMPL_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * This file contains the definitions of types and supporting
2N/A * functions to implement the libpool kernel specific data
2N/A * manipulation facility.
2N/A *
2N/A * For more information on the libpool generic data manipulation
2N/A * facility, look at pool_impl.h.
2N/A *
2N/A * The central types for the generic data representation/storage
2N/A * facility are here enhanced to provide additional kernel specific
2N/A * information.
2N/A */
2N/A
2N/A/*
2N/A * pool_knl_elem_t is the kernel specific representation of the
2N/A * pool_elem_t structure.
2N/A */
2N/Atypedef struct pool_knl_elem {
2N/A /*
2N/A * Common to pool_elem_t
2N/A */
2N/A pool_elem_t pke_elem;
2N/A void *pke_pad1;
2N/A void *pke_pad2;
2N/A /*
2N/A * Common to pool_knl_elem_t
2N/A */
2N/A nvlist_t *pke_properties; /* Properties nvlist */
2N/A struct pool_knl_elem *pke_parent; /* Element parent */
2N/A uint64_t pke_ltime; /* Library timestamp */
2N/A} pool_knl_elem_t;
2N/A
2N/Atypedef pool_knl_elem_t pool_knl_system_t;
2N/A
2N/Atypedef struct pool_knl_resource {
2N/A /*
2N/A * Common to pool_elem_t
2N/A */
2N/A pool_elem_t pke_elem;
2N/A /*
2N/A * Specific to pool_resource_t
2N/A */
2N/A int (*pr_is_system)(const pool_resource_t *);
2N/A int (*pr_can_associate)(const pool_resource_t *);
2N/A /*
2N/A * Common to pool_knl_elem_t
2N/A */
2N/A nvlist_t *pke_properties; /* Properties nvlist */
2N/A struct pool_knl_elem *pke_parent; /* Element parent */
2N/A uint64_t pke_ltime; /* Library timestamp */
2N/A} pool_knl_resource_t;
2N/A
2N/Atypedef pool_knl_elem_t pool_knl_component_t;
2N/A
2N/Atypedef struct pool_knl_pool {
2N/A /*
2N/A * Common to pool_elem_t
2N/A */
2N/A pool_elem_t pke_elem;
2N/A /*
2N/A * Specific to pool_t
2N/A */
2N/A int (*pp_associate)(pool_t *, const pool_resource_t *);
2N/A int (*pp_dissociate)(pool_t *, const pool_resource_t *);
2N/A /*
2N/A * Common to pool_knl_elem_t
2N/A */
2N/A nvlist_t *pke_properties; /* Properties nvlist */
2N/A struct pool_knl_elem *pke_parent; /* Element parent */
2N/A uint64_t pke_ltime; /* Library timestamp */
2N/A /*
2N/A * Specific to pool_knl_pool_t
2N/A */
2N/A pool_knl_resource_t *pkp_assoc[4]; /* Pool resources */
2N/A} pool_knl_pool_t;
2N/A
2N/A/*
2N/A * pool_knl_result_set_t is the kernel specific representation of the
2N/A * pool_result_set_t structure.
2N/A *
2N/A */
2N/Atypedef struct pool_knl_result_set {
2N/A const pool_conf_t *prs_conf; /* Configuration */
2N/A int prs_active; /* Query active? */
2N/A int prs_index; /* Result Index */
2N/A pool_elem_t *(*prs_next)(pool_result_set_t *);
2N/A pool_elem_t *(*prs_prev)(pool_result_set_t *);
2N/A pool_elem_t *(*prs_first)(pool_result_set_t *);
2N/A pool_elem_t *(*prs_last)(pool_result_set_t *);
2N/A int (*prs_set_index)(pool_result_set_t *, int);
2N/A int (*prs_get_index)(pool_result_set_t *);
2N/A int (*prs_close)(pool_result_set_t *);
2N/A int (*prs_count)(pool_result_set_t *);
2N/A /*
2N/A * End of common part
2N/A */
2N/A pool_knl_elem_t **pkr_list; /* Result members */
2N/A int pkr_count; /* Result set count */
2N/A int pkr_size; /* Result set size */
2N/A} pool_knl_result_set_t;
2N/A
2N/A/*
2N/A * pool_knl_connection_t is the kernel specific representation of the
2N/A * pool_connection_t structure.
2N/A *
2N/A */
2N/Atypedef struct pool_knl_connection {
2N/A const char *pc_name; /* Provider name */
2N/A int pc_store_type; /* Datastore type */
2N/A int pc_oflags; /* Open flags */
2N/A int (*pc_close)(pool_conf_t *);
2N/A int (*pc_validate)(const pool_conf_t *, pool_valid_level_t);
2N/A int (*pc_commit)(pool_conf_t *);
2N/A int (*pc_export)(const pool_conf_t *, const char *,
2N/A pool_export_format_t);
2N/A int (*pc_rollback)(pool_conf_t *);
2N/A pool_result_set_t *(*pc_exec_query)(const pool_conf_t *,
2N/A const pool_elem_t *, const char *,
2N/A pool_elem_class_t, pool_value_t **);
2N/A pool_elem_t *(*pc_elem_create)(pool_conf_t *, pool_elem_class_t,
2N/A pool_resource_elem_class_t, pool_component_elem_class_t);
2N/A int (*pc_remove)(pool_conf_t *);
2N/A int (*pc_res_xfer)(pool_resource_t *, pool_resource_t *, uint64_t);
2N/A int (*pc_res_xxfer)(pool_resource_t *, pool_resource_t *,
2N/A pool_component_t **);
2N/A char *(*pc_get_binding)(pool_conf_t *, pid_t);
2N/A int (*pc_set_binding)(pool_conf_t *, const char *, idtype_t, id_t);
2N/A char *(*pc_get_resource_binding)(pool_conf_t *,
2N/A pool_resource_elem_class_t, pid_t);
2N/A /*
2N/A * End of common part
2N/A */
2N/A int pkc_fd; /* Pool device */
2N/A dict_hdl_t *pkc_elements; /* Elements */
2N/A#if DEBUG
2N/A dict_hdl_t *pkc_leaks; /* Elements */
2N/A#endif /* DEBUG */
2N/A log_t *pkc_log; /* Transaction log */
2N/A hrtime_t pkc_ltime; /* Snap updated */
2N/A hrtime_t pkc_lotime; /* Snap last updated */
2N/A} pool_knl_connection_t;
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _POOL_KERNEL_IMPL_H */