/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RDC_BITMAP_H
#define _RDC_BITMAP_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
extern int rdc_bitmap_mode; /* property from rdc.conf */
/*
* Possible values of rdc_bitmap_mode - integer flag.
*/
#endif /* _KERNEL */
/*
* Public bitmap interface
* The bitmaps are maintained on 32 Kbyte segments
*/
/*
* Private macros for bitmap manipulation
*/
#define BMAP_REF_PREF_SIZE (sizeof (unsigned int))
#ifndef _KERNEL
struct bm_ref_ops {
void (*bmap_ref_set)(void *, int);
void (*bmap_ref_clr)(void *, int);
unsigned int (*bmap_ref_isset)(void *, int);
void (*bmap_ref_force)(void *, int, unsigned int);
unsigned int (*bmap_ref_maxval)(void *);
};
#else
struct bm_ref_ops {
};
/* convert fba to block number */
/* force reference clear during sync */
/* check for overlap, taking account of blocking factor */
struct rdc_bitmap_ops {
uint_t *);
const uint_t, const int);
};
extern struct rdc_bitmap_ops *rdc_bitmap_ops;
/*
* Functions
*/
extern void rdc_bitmap_init(void);
extern int rdc_move_bitmap(rdc_k_info_t *, char *);
extern int rdc_enable_bitmap(rdc_k_info_t *, int);
extern int rdc_resume_bitmap(rdc_k_info_t *);
extern int rdc_reset_bitmap(rdc_k_info_t *);
extern void rdc_free_bitmap(rdc_k_info_t *, int);
extern void rdc_close_bitmap(rdc_k_info_t *);
extern int rdc_write_bitmap(rdc_k_info_t *);
extern int rdc_write_bitmap_fill(rdc_k_info_t *);
extern int rdc_read_state(rdc_k_info_t *, int *, int *);
extern int rdc_clear_state(rdc_k_info_t *);
extern void rdc_write_state(rdc_u_info_t *);
extern int rdc_read_refcount(rdc_k_info_t *);
extern int rdc_write_refcount(rdc_k_info_t *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _RDC_BITMAP_H */