]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/os/linux/spl/sys/zmod.h
Update OpenZFS to 2.0.0-rc3-gbd565f
[FreeBSD/FreeBSD.git] / include / os / linux / spl / sys / zmod.h
1 /*
2  *  Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
3  *  Copyright (C) 2007 The Regents of the University of California.
4  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
5  *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
6  *  UCRL-CODE-235197
7  *
8  *  This file is part of the SPL, Solaris Porting Layer.
9  *
10  *  The SPL is free software; you can redistribute it and/or modify it
11  *  under the terms of the GNU General Public License as published by the
12  *  Free Software Foundation; either version 2 of the License, or (at your
13  *  option) any later version.
14  *
15  *  The SPL is distributed in the hope that it will be useful, but WITHOUT
16  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
18  *  for more details.
19  *
20  *  You should have received a copy of the GNU General Public License along
21  *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
22  *
23  *
24  *  z_compress_level/z_uncompress are nearly identical copies of the
25  *  compress2/uncompress functions provided by the official zlib package
26  *  available at http://zlib.net/.  The only changes made we to slightly
27  *  adapt the functions called to match the linux kernel implementation
28  *  of zlib.  The full zlib license follows:
29  *
30  *  zlib.h -- interface of the 'zlib' general purpose compression library
31  *  version 1.2.5, April 19th, 2010
32  *
33  *  Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
34  *
35  *  This software is provided 'as-is', without any express or implied
36  *  warranty.  In no event will the authors be held liable for any damages
37  *  arising from the use of this software.
38  *
39  *  Permission is granted to anyone to use this software for any purpose,
40  *  including commercial applications, and to alter it and redistribute it
41  *  freely, subject to the following restrictions:
42  *
43  *  1. The origin of this software must not be misrepresented; you must not
44  *     claim that you wrote the original software. If you use this software
45  *     in a product, an acknowledgment in the product documentation would be
46  *     appreciated but is not required.
47  *  2. Altered source versions must be plainly marked as such, and must not be
48  *     misrepresented as being the original software.
49  *  3. This notice may not be removed or altered from any source distribution.
50  *
51  *  Jean-loup Gailly
52  *  Mark Adler
53  */
54
55 #ifndef _SPL_ZMOD_H
56 #define _SPL_ZMOD_H
57
58 #include <sys/types.h>
59 #include <linux/zlib.h>
60
61 extern int z_compress_level(void *dest, size_t *destLen, const void *source,
62     size_t sourceLen, int level);
63 extern int z_uncompress(void *dest, size_t *destLen, const void *source,
64     size_t sourceLen);
65
66 int spl_zlib_init(void);
67 void spl_zlib_fini(void);
68
69 #endif /* SPL_ZMOD_H */