/*
* 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_FSSNAP_H
#define _SYS_FSSNAP_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#ifdef __cplusplus
extern "C" {
#endif
/* snapshot backend interfaces, macros, and data structures */
#if defined(_KERNEL)
/*
* defines for the number of threads used to handle tasks, the maximum
* number of chunks in memory at a time, and the maximum number of tasks to
* allow before the taskqs start throttling. MAXTASKS should be greater than
* or equal to MAX_MEM_CHUNKS.
*/
/*
* It is assumed that a chunk is a multiple of a disk sector so that
* the chunk size can be reduced before using it as a conversion
* factor. Therefore the number of chunks on a file system will
* always be less than the number of blocks it occupies, and these
* conversions will not overflow. (do not convert to bytes first!)
*/
typedef unsigned long long chunknumber_t;
/* disk blocks to snapshot chunks */
/* snapshot chunks to disk blocks */
/*
* A snapshot_id is the shared structure between the snapshot driver
* and the file system.
*/
typedef struct snapshot_id {
/* snapshot_id flags */
/* true if snapshot device is open */
/* true if snapshot can not be used */
/* true if snapshot can be reused now */
/*
* The cow_map keeps track of all translations, and two bitmaps to
* determine whether the chunk is eligible for translation, and if so
* whether or not it already has a translation. The candidate bitmap
* is read-only and does not require a lock, the hastrans bitmap and
* the translation table are protected by the cmap_rwlock.
*/
typedef struct cow_map {
} cow_map_t;
/*
* The cow_map_node keeps track of chunks that are still in memory.
*/
typedef struct cow_map_node {
/* cmap_throttle_sem */
/*
* The cow_info structure holds basic snapshot state information. It is
* mostly read-only once the snapshot is created so no locking is required.
* The exception is cow_nextchunk, which is ever-increasing and updated with
* atomic_add(). This structure is allocated dynamically, and creation and
* deletion of the snapshot is protected by the snapshot_mutex variable.
*/
typedef struct cow_info {
} cow_info_t;
/* kstat information */
struct cow_kstat_num {
};
/* ckn_state values */
extern uint_t bypass_snapshot_throttle_key;
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_FSSNAP_H */