zap_impl.h revision 87e5029a3226958edab1512d6182bc74d8d80c9a
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ZAP_IMPL_H
#define _SYS_ZAP_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/zfs_context.h>
#ifdef __cplusplus
extern "C" {
#endif
#define ZAP_MAGIC 0x2F52AB2AB
#define ZAP_BLOCK_SHIFT 17
#define ZAP_HASHBITS 28
#define MZAP_ENT_LEN 64
#define MZAP_MAX_BLKSHIFT ZAP_BLOCK_SHIFT
typedef struct mzap_ent_phys {
char mze_name[MZAP_NAME_LEN];
typedef struct mzap_phys {
/* actually variable size depending on block size */
} mzap_phys_t;
typedef struct mzap_ent {
int mze_chunkid;
} mzap_ent_t;
/*
* The (fat) zap is stored in one object. It is an array of
* 1<<ZAP_BLOCK_SHIFT byte blocks. The layout looks like one of:
*
* ptrtbl fits in first block:
* [zap_phys_t zap_ptrtbl_shift < 6] [zap_leaf_t] ...
*
* ptrtbl too big for first block:
* [zap_phys_t zap_ptrtbl_shift >= 6] [zap_leaf_t] [ptrtbl] ...
*
*/
struct dmu_buf;
struct zap_leaf;
/* any other values are ptrtbl blocks */
/* 1/2 the block size */
/*
* TAKE NOTE:
* If zap_phys_t is modified, zap_byteswap() must be modified.
*/
typedef struct zap_phys {
struct zap_table_phys {
} zap_ptrtbl;
} zap_phys_t;
typedef struct zap_table_phys zap_table_phys_t;
typedef struct zap {
int zap_ismicro;
union {
struct {
/*
* zap_num_entries_mtx protects
* zap_num_entries
*/
} zap_fat;
struct {
} zap_micro;
} zap_u;
} zap_t;
void zap_put_leaf(struct zap_leaf *l);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ZAP_IMPL_H */