/*
* 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 _SD_CACHE_H
#define _SD_CACHE_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Compiler defines
*/
#if !defined(_SD_NO_GENERIC)
#endif /* (_SD_NO_GENERIC) */
#if defined(_SD_OPTIM_ALLOC)
#if (_SD_OPTIM_ALLOC+0 > 1)
#endif
#endif /* (_SD_OPTIM_ALLOC) */
#if defined(_SD_CHECKS) /* Enable checks, stats, and tracing */
#if (_SD_CHECKS+0 > 1)
#endif
#endif /* (_SD_CHECKS) */
#if defined(_SD_NOTRACE) && defined(_SD_STATS)
#endif
/*
* Other compiler defines currently not enabled.
* #define _SD_FBA_DATA_LOG Enable data logging per 512 bytes.
* Other compiler defines enabled in the Makefile.
* #define _SD_8K_BLKSIZE Allow 8K cache block size
*/
extern int _sd_cblock_shift;
#define BLK_TO_FBA_NUM(x) \
((x) << BLK_FBA_SHFT) /* block_num to fba_num */
/* a cache block */
#define FBA_TO_BLK_NUM(x) \
((x) >> BLK_FBA_SHFT) /* fba_num to a */
/* block_num */
/* fba_num to the next higher block_num */
/*
* This is the set of flags that are valid. Anything else set in the
* handle is invalid and the handle should be rejected during an allocation.
*/
| NSC_METADATA)
#ifdef m88k
#endif
/*
* Allow one entry for null terminator and another to handle
* requests that are not cache block aligned.
*/
#if defined(_SD_8K_BLKSIZE)
#else
#endif
/* cd to use for _sd_centry_alloc to avoid entering hash table */
struct _sd_buf_handle;
typedef struct _sd_buf_handle {
int bh_cd;
void *bh_param;
#endif /* _KERNEL || _KMEMUSER */
#ifdef __cplusplus
}
#endif
#endif /* _SD_CACHE_H */