arc.h revision 244781f10dcd82684fd8163c016540667842f203
/*
* 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, 2014 by Delphix. All rights reserved.
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
*/
#ifndef _SYS_ARC_H
#define _SYS_ARC_H
#include <sys/zfs_context.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Used by arc_flush() to inform arc_evict_state() that it should evict
* all available buffers from the arc state being passed in.
*/
#define ARC_EVICT_ALL -1ULL
typedef struct arc_buf_hdr arc_buf_hdr_t;
typedef int arc_evict_func_t(void *private);
/* generic arc_done_func_t's which you can use */
typedef enum arc_flags
{
/*
* Public flags that can be passed into the ARC by external consumers.
*/
/*
* Private ARC flags. These flags are private ARC only flags that
* will show up in b_flags in the arc_hdr_buf_t. These flags should
* only be set by ARC code.
*/
/* indicates that the buffer contains metadata (otherwise, data) */
/* Flags specifying whether optional hdr struct fields are defined */
/*
* The arc buffer's compression mode is stored in the top 7 bits of the
* flags field, so these dummy flags are included so that MDB can
* interpret the enum properly.
*/
} arc_flags_t;
struct arc_buf {
void *b_data;
void *b_private;
};
typedef enum arc_buf_contents {
ARC_BUFC_DATA, /* buffer contains data */
ARC_BUFC_METADATA, /* buffer contains metadata */
/*
* The following breakdows of arc_size exist for kstat only.
*/
typedef enum arc_space_type {
#ifdef ZFS_DEBUG
#endif
void arc_init(void);
void arc_fini(void);
/*
* Level 2 ARC
*/
void l2arc_init(void);
void l2arc_fini(void);
void l2arc_start(void);
void l2arc_stop(void);
#ifndef _KERNEL
extern int arc_procfd;
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ARC_H */