spa_impl.h revision 54d692b75b7a6f90ce7787309da5451f7458e66a
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SPA_IMPL_H
#define _SYS_SPA_IMPL_H
#include <sys/metaslab.h>
#include <sys/dsl_pool.h>
#include <sys/uberblock_impl.h>
#include <sys/zfs_context.h>
#include <sys/refcount.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct spa_error_entry {
char *se_name;
typedef struct spa_history_phys {
struct spa_aux_vdev {
int sav_count; /* number devices */
};
typedef struct spa_config_lock {
int scl_write_wanted;
typedef struct spa_config_dirent {
char *scd_path;
typedef enum spa_log_state {
SPA_LOG_UNKNOWN = 0, /* unknown log state */
SPA_LOG_MISSING, /* missing log(s) */
SPA_LOG_CLEAR, /* clear the log(s) */
SPA_LOG_GOOD, /* log(s) are good */
enum zio_taskq_type {
ZIO_TASKQ_ISSUE = 0,
};
struct spa {
/*
* Fields protected by spa_namespace_lock.
*/
int spa_sync_pass; /* iterate-to-convergence */
int spa_inject_ref; /* injection references */
int spa_async_suspended; /* async tasks suspended */
char *spa_root; /* alternate root directory */
int spa_minref; /* num refs when first opened */
int spa_mode; /* FREAD | FWRITE */
/*
* spa_refcnt & spa_config_lock must be the last elements
* because refcount_t changes size based on compilation options.
* In order for the MDB module to function correctly, the other
* fields must remain in the same location.
*/
};
extern const char *spa_config_path;
#define BOOTFS_COMPRESS_VALID(compress) \
((compress) == ZIO_COMPRESS_LZJB || \
((compress) == ZIO_COMPRESS_ON && \
ZIO_COMPRESS_ON_VALUE == ZIO_COMPRESS_LZJB) || \
(compress) == ZIO_COMPRESS_OFF)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SPA_IMPL_H */