fsys_zfs.h revision 843e19887f64dde75055cf8842fc4db2171eff45
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _FSYS_ZFS_H
#define _FSYS_ZFS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef FSYS_ZFS
typedef unsigned long long uint64_t;
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef unsigned char uchar_t;
typedef unsigned long size_t;
#else
typedef unsigned int size_t;
#endif
#include <zfs-include/zfs.h>
#include <zfs-include/dmu.h>
#include <zfs-include/spa.h>
#include <zfs-include/zio.h>
#include <zfs-include/zio_checksum.h>
#include <zfs-include/vdev_impl.h>
#include <zfs-include/zap_impl.h>
#include <zfs-include/zap_leaf.h>
#include <zfs-include/uberblock_impl.h>
#include <zfs-include/dnode.h>
#include <zfs-include/dsl_dir.h>
#include <zfs-include/zfs_acl.h>
#include <zfs-include/zfs_znode.h>
#include <zfs-include/dsl_dataset.h>
#include <zfs-include/zil.h>
#include <zfs-include/dmu_objset.h>
/*
* Global Memory addresses to store MOS and DNODE data
*/
#define MOS ((dnode_phys_t *)\
/*
* Verify dnode type.
* Can only be used in functions returning non-0 for failure.
*/
return (ERR_FSYS_CORRUPT); \
}
/*
* Verify object set type.
* Can only be used in functions returning 0 for failure.
*/
errnum = ERR_FSYS_CORRUPT; \
return (0); \
}
#define ZPOOL_PROP_BOOTFS "bootfs"
/* General macros */
#define BSWAP_8(x) ((x) & 0xff)
/*
* XXX Match these macro up with real zfs once we have nvlist support so that we
* can support large sector disks.
*/
#define offsetof(t, m) ((int)&(((t *)0)->m))
#define VDEV_UBERBLOCK_SHIFT UBERBLOCK_SHIFT
#define VDEV_UBERBLOCK_OFFSET(n) \
typedef struct uberblock uberblock_t;
/* XXX Uberblock_phys_t is no longer in the kernel zfs */
typedef struct uberblock_phys {
sizeof (zio_block_tail_t)];
/*
* Macros to get fields in a bp or DVA.
*/
#define DVA_OFFSET_TO_PHYS_SECTOR(offset) \
/*
* For nvlist manipulation. (from nvpair.h)
*/
#define NV_ENCODE_NATIVE 0
#define NV_ENCODE_XDR 1
#define DATA_TYPE_UINT64 8
#define DATA_TYPE_STRING 9
/*
* Decompression Entry - lzjb
*/
#ifndef NBBY
#define NBBY 8
#endif
typedef struct decomp_entry {
char *name;
/*
* FAT ZAP data structures
*/
/*
* The amount of space within the chunk available for the array is:
* chunk size - space for type (1) - space for next pointer (2)
*/
/*
* The amount of space available for chunks is:
* block size shift - hash entry size (2) * number of hash
* entries - header space (2*chunksize)
*/
#define ZAP_LEAF_NUMCHUNKS(bs) \
ZAP_LEAF_CHUNKSIZE - 2)
/*
* The chunks start immediately after the hash table. The end of the
* hash table is at l_hash + HASH_NUMENTRIES, which we simply cast to a
* chunk_t.
*/
#endif /* FSYS_ZFS */
#endif /* !_FSYS_ZFS_H */