FreeBSD ZFS
The Zettabyte File System
Functions

zle.c File Reference

Zero-length encoding. More...

#include <sys/types.h>
#include <sys/sysmacros.h>
Include dependency graph for zle.c:

Go to the source code of this file.

Functions

size_t zle_compress (void *s_start, void *d_start, size_t s_len, size_t d_len, int n)
int zle_decompress (void *s_start, void *d_start, size_t s_len, size_t d_len, int n)

Detailed Description

Zero-length encoding.

This is a fast and simple algorithm to eliminate runs of zeroes. Each chunk of compressed data begins with a length byte, b. If b < n (where n is the compression parameter) then the next b + 1 bytes are literal values. If b >= n then the next (256 - b + 1) bytes are zero.

Definition in file zle.c.


Function Documentation

size_t zle_compress ( void *  s_start,
void *  d_start,
size_t  s_len,
size_t  d_len,
int  n 
)

Definition at line 38 of file zle.c.

int zle_decompress ( void *  s_start,
void *  d_start,
size_t  s_len,
size_t  d_len,
int  n 
)

Definition at line 68 of file zle.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines