2017-10-04 19:33:43 +03:00
|
|
|
/*
|
2010-05-18 02:18:00 +04:00
|
|
|
* Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
|
|
|
|
* Copyright (C) 2007 The Regents of the University of California.
|
|
|
|
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
|
|
|
|
* Written by Brian Behlendorf <behlendorf1@llnl.gov>.
|
2008-05-26 08:38:26 +04:00
|
|
|
* UCRL-CODE-235197
|
|
|
|
*
|
2010-05-18 02:18:00 +04:00
|
|
|
* This file is part of the SPL, Solaris Porting Layer.
|
2013-03-05 05:26:55 +04:00
|
|
|
* For details, see <http://zfsonlinux.org/>.
|
2008-05-26 08:38:26 +04:00
|
|
|
*
|
2010-05-18 02:18:00 +04:00
|
|
|
* The SPL is free software; you can redistribute it and/or modify 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.
|
|
|
|
*
|
|
|
|
* The SPL is distributed in the hope that it will be useful, but WITHOUT
|
2008-05-26 08:38:26 +04:00
|
|
|
* 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
|
2010-05-18 02:18:00 +04:00
|
|
|
* with the SPL. If not, see <http://www.gnu.org/licenses/>.
|
2018-02-07 22:49:38 +03:00
|
|
|
*
|
|
|
|
*
|
2010-05-18 02:18:00 +04:00
|
|
|
* z_compress_level/z_uncompress are nearly identical copies of the
|
|
|
|
* compress2/uncompress functions provided by the official zlib package
|
|
|
|
* available at http://zlib.net/. The only changes made we to slightly
|
|
|
|
* adapt the functions called to match the linux kernel implementation
|
|
|
|
* of zlib. The full zlib license follows:
|
|
|
|
*
|
|
|
|
* zlib.h -- interface of the 'zlib' general purpose compression library
|
|
|
|
* version 1.2.5, April 19th, 2010
|
|
|
|
*
|
|
|
|
* Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler
|
|
|
|
*
|
|
|
|
* This software is provided 'as-is', without any express or implied
|
|
|
|
* warranty. In no event will the authors be held liable for any damages
|
|
|
|
* arising from the use of this software.
|
|
|
|
*
|
|
|
|
* Permission is granted to anyone to use this software for any purpose,
|
|
|
|
* including commercial applications, and to alter it and redistribute it
|
|
|
|
* freely, subject to the following restrictions:
|
|
|
|
*
|
|
|
|
* 1. The origin of this software must not be misrepresented; you must not
|
|
|
|
* claim that you wrote the original software. If you use this software
|
|
|
|
* in a product, an acknowledgment in the product documentation would be
|
|
|
|
* appreciated but is not required.
|
|
|
|
* 2. Altered source versions must be plainly marked as such, and must not be
|
|
|
|
* misrepresented as being the original software.
|
|
|
|
* 3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*
|
|
|
|
* Jean-loup Gailly
|
|
|
|
* Mark Adler
|
2017-10-04 19:33:43 +03:00
|
|
|
*/
|
2008-05-26 08:38:26 +04:00
|
|
|
|
2008-03-07 23:48:44 +03:00
|
|
|
#ifndef _SPL_ZMOD_H
|
2018-02-07 22:49:38 +03:00
|
|
|
#define _SPL_ZMOD_H
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2011-02-26 00:26:19 +03:00
|
|
|
#include <sys/types.h>
|
2008-03-07 23:48:44 +03:00
|
|
|
#include <linux/zlib.h>
|
|
|
|
|
2011-02-26 00:26:19 +03:00
|
|
|
extern int z_compress_level(void *dest, size_t *destLen, const void *source,
|
|
|
|
size_t sourceLen, int level);
|
|
|
|
extern int z_uncompress(void *dest, size_t *destLen, const void *source,
|
|
|
|
size_t sourceLen);
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2011-11-11 21:03:31 +04:00
|
|
|
int spl_zlib_init(void);
|
|
|
|
void spl_zlib_fini(void);
|
2008-03-07 23:48:44 +03:00
|
|
|
|
|
|
|
#endif /* SPL_ZMOD_H */
|