7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 /*
21 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 */
24
25 /*
26 * Copyright (c) 2012 by Delphix. All rights reserved.
27 */
28
29 #ifndef _FSYS_ZFS_H
30 #define _FSYS_ZFS_H
31
32 #ifdef FSYS_ZFS
33
34 #ifndef FSIMAGE
35 typedef unsigned long long uint64_t;
36 typedef unsigned int uint32_t;
37 typedef unsigned short uint16_t;
38 typedef unsigned char uint8_t;
39 typedef unsigned char uchar_t;
40
41 #if defined(_LP64) || defined(_I32LPx)
42 typedef unsigned long size_t;
43 #else
44 typedef unsigned int size_t;
45 #endif
46 #else
196 */
197 #define ZAP_LEAF_NUMCHUNKS(bs) \
198 (((1<<bs) - 2*ZAP_LEAF_HASH_NUMENTRIES(bs)) / \
199 ZAP_LEAF_CHUNKSIZE - 2)
200
201 /*
202 * The chunks start immediately after the hash table. The end of the
203 * hash table is at l_hash + HASH_NUMENTRIES, which we simply cast to a
204 * chunk_t.
205 */
206 #define ZAP_LEAF_CHUNK(l, bs, idx) \
207 ((zap_leaf_chunk_t *)(l->l_hash + ZAP_LEAF_HASH_NUMENTRIES(bs)))[idx]
208 #define ZAP_LEAF_ENTRY(l, bs, idx) (&ZAP_LEAF_CHUNK(l, bs, idx).l_entry)
209
210 extern void fletcher_2_native(const void *, uint64_t, zio_cksum_t *);
211 extern void fletcher_2_byteswap(const void *, uint64_t, zio_cksum_t *);
212 extern void fletcher_4_native(const void *, uint64_t, zio_cksum_t *);
213 extern void fletcher_4_byteswap(const void *, uint64_t, zio_cksum_t *);
214 extern void zio_checksum_SHA256(const void *, uint64_t, zio_cksum_t *);
215 extern int lzjb_decompress(void *, void *, size_t, size_t);
216
217 #endif /* FSYS_ZFS */
218
219 #endif /* !_FSYS_ZFS_H */
|
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19
20 /*
21 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 */
24
25 /*
26 * Copyright (c) 2012 by Delphix. All rights reserved.
27 * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
28 */
29
30 #ifndef _FSYS_ZFS_H
31 #define _FSYS_ZFS_H
32
33 #ifdef FSYS_ZFS
34
35 #ifndef FSIMAGE
36 typedef unsigned long long uint64_t;
37 typedef unsigned int uint32_t;
38 typedef unsigned short uint16_t;
39 typedef unsigned char uint8_t;
40 typedef unsigned char uchar_t;
41
42 #if defined(_LP64) || defined(_I32LPx)
43 typedef unsigned long size_t;
44 #else
45 typedef unsigned int size_t;
46 #endif
47 #else
197 */
198 #define ZAP_LEAF_NUMCHUNKS(bs) \
199 (((1<<bs) - 2*ZAP_LEAF_HASH_NUMENTRIES(bs)) / \
200 ZAP_LEAF_CHUNKSIZE - 2)
201
202 /*
203 * The chunks start immediately after the hash table. The end of the
204 * hash table is at l_hash + HASH_NUMENTRIES, which we simply cast to a
205 * chunk_t.
206 */
207 #define ZAP_LEAF_CHUNK(l, bs, idx) \
208 ((zap_leaf_chunk_t *)(l->l_hash + ZAP_LEAF_HASH_NUMENTRIES(bs)))[idx]
209 #define ZAP_LEAF_ENTRY(l, bs, idx) (&ZAP_LEAF_CHUNK(l, bs, idx).l_entry)
210
211 extern void fletcher_2_native(const void *, uint64_t, zio_cksum_t *);
212 extern void fletcher_2_byteswap(const void *, uint64_t, zio_cksum_t *);
213 extern void fletcher_4_native(const void *, uint64_t, zio_cksum_t *);
214 extern void fletcher_4_byteswap(const void *, uint64_t, zio_cksum_t *);
215 extern void zio_checksum_SHA256(const void *, uint64_t, zio_cksum_t *);
216 extern int lzjb_decompress(void *, void *, size_t, size_t);
217 extern int lz4_decompress(void *, void *, size_t, size_t);
218
219 #endif /* FSYS_ZFS */
220
221 #endif /* !_FSYS_ZFS_H */
|