spa_impl.h revision 283b84606b6fc326692c03273de1774e8c122f9a
/*
* 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) 2012 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
#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;
enum zio_taskq_type {
ZIO_TASKQ_ISSUE = 0,
};
/*
* State machine for the zpool-pooname process. The states transitions
* are done as follows:
*
* From To Routine
* PROC_NONE -> PROC_CREATED spa_activate()
* PROC_CREATED -> PROC_ACTIVE spa_thread()
* PROC_ACTIVE -> PROC_DEACTIVATE spa_deactivate()
* PROC_DEACTIVATE -> PROC_GONE spa_thread()
* PROC_GONE -> PROC_NONE spa_deactivate()
*/
typedef enum spa_proc_state {
SPA_PROC_NONE, /* spa_proc = &p0, no process created */
SPA_PROC_CREATED, /* spa_activate() has proc, is waiting */
SPA_PROC_ACTIVE, /* taskqs created, spa_proc set */
SPA_PROC_DEACTIVATE, /* spa_deactivate() requests process exit */
SPA_PROC_GONE /* spa_thread() is exiting, spa_proc = &p0 */
struct spa {
/*
* Fields protected by spa_namespace_lock.
*/
char *spa_comment; /* comment */
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_last_open_failed; /* error if last open failed */
int spa_minref; /* num refs when first opened */
int spa_mode; /* FREAD | FWRITE */
int spa_vdev_locks; /* locks grabbed */
/*
* 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;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SPA_IMPL_H */