Print this page
%B
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/fs/zfs/sys/zio_compress.h
+++ new/usr/src/uts/common/fs/zfs/sys/zio_compress.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 +/*
27 + * Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
28 + */
26 29
27 30 #ifndef _SYS_ZIO_COMPRESS_H
28 31 #define _SYS_ZIO_COMPRESS_H
29 32
30 33 #include <sys/zio.h>
31 34
32 35 #ifdef __cplusplus
33 36 extern "C" {
34 37 #endif
35 38
36 39 /*
37 40 * Common signature for all zio compress/decompress functions.
38 41 */
39 42 typedef size_t zio_compress_func_t(void *src, void *dst,
40 43 size_t s_len, size_t d_len, int);
41 44 typedef int zio_decompress_func_t(void *src, void *dst,
42 45 size_t s_len, size_t d_len, int);
43 46
44 47 /*
45 48 * Information about each compression function.
46 49 */
47 50 typedef struct zio_compress_info {
48 51 zio_compress_func_t *ci_compress; /* compression function */
49 52 zio_decompress_func_t *ci_decompress; /* decompression function */
50 53 int ci_level; /* level parameter */
51 54 char *ci_name; /* algorithm name */
52 55 } zio_compress_info_t;
53 56
54 57 extern zio_compress_info_t zio_compress_table[ZIO_COMPRESS_FUNCTIONS];
55 58
56 59 /*
57 60 * Compression routines.
58 61 */
59 62 extern size_t lzjb_compress(void *src, void *dst, size_t s_len, size_t d_len,
60 63 int level);
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
61 64 extern int lzjb_decompress(void *src, void *dst, size_t s_len, size_t d_len,
62 65 int level);
63 66 extern size_t gzip_compress(void *src, void *dst, size_t s_len, size_t d_len,
64 67 int level);
65 68 extern int gzip_decompress(void *src, void *dst, size_t s_len, size_t d_len,
66 69 int level);
67 70 extern size_t zle_compress(void *src, void *dst, size_t s_len, size_t d_len,
68 71 int level);
69 72 extern int zle_decompress(void *src, void *dst, size_t s_len, size_t d_len,
70 73 int level);
74 +extern size_t lz4_compress(void *src, void *dst, size_t s_len, size_t d_len,
75 + int level);
76 +extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len,
77 + int level);
71 78
72 79 /*
73 80 * Compress and decompress data if necessary.
74 81 */
75 82 extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst,
76 83 size_t s_len);
77 84 extern int zio_decompress_data(enum zio_compress c, void *src, void *dst,
78 85 size_t s_len, size_t d_len);
79 86
80 87 #ifdef __cplusplus
81 88 }
82 89 #endif
83 90
84 91 #endif /* _SYS_ZIO_COMPRESS_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX