/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_FS_UFS_PANIC_H
#define _SYS_FS_UFS_PANIC_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_KERNEL)
/*
* failures have an associated state
* making them bit values simplifies state transition validity checking
*/
typedef enum ufs_failure_states {
/* initial states, set mostly by thread encountering failure */
/* transitional states, set mostly by fix failure thread */
/* terminal states, once in this state, fix failure thread is done */
/* not strictly a terminal state, */
/* because we will do some actions */
/* if we find a failure in this state */
/* but those actions will be terminal */
/* handy, but used only as terminators and placeholders */
/*
* each manifestation of a fault (ie. "panic") is
* associated with a distinct ufs_failure event
*/
typedef struct ufs_failure
{
/* here's the original */
/* here's the master failure */
/* after ufsvfsp is free'd */
/* XXX could be smaller */
/*
* per-filesystem panic event state
*/
typedef struct vfs_ufsfx {
} vfs_ufsfx_t;
/*
* External entry points
*
* ufs_fault(vnode_t *, char *fmt, ...)
* replaces calls to cmn_err(CE_PANIC, char *fmt, ...)
* The vnode is any vnode in the filesystem.
* ufs_fault returns an errno to bubble up.
* ufsfx_init()
* is called at modload time to set global values etc.
* ufsfx_mount()
* is called at mount time to do per-fs initialization
* returns 0 (ok) or errno
* ufsfx_unmount()
* is called at unmount time to prevent spinning on work
* to fix an unmounted fs
* ufsfx_lockfs()
* ufsfx_unlockfs()
* are called at upon (un)locking of a fs for coordination
* ufsfx_get_failure_qlen()
* is called by the hlock thread to coordinate with the fix
* failure thread
*/
/*PRINTFLIKE2*/
void ufsfx_init(void);
int ufsfx_mount(struct ufsvfs *, int);
void ufsfx_unmount(struct ufsvfs *);
void ufsfx_lockfs(struct ufsvfs *);
void ufsfx_unlockfs(struct ufsvfs *);
int ufsfx_get_failure_qlen(void);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FS_UFS_PANIC_H */