FreeBSD kernel kern code
subr_compressor.c File Reference
#include <sys/cdefs.h>
#include "opt_gzio.h"
#include "opt_zstdio.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/compressor.h>
#include <sys/endian.h>
#include <sys/kernel.h>
#include <sys/linker_set.h>
#include <sys/malloc.h>
Include dependency graph for subr_compressor.c:

Go to the source code of this file.

Data Structures

struct  compressor_methods
 
struct  compressor
 

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DEFINE (M_COMPRESS, "compressor", "kernel compression subroutines")
 
 SET_DECLARE (compressors, struct compressor_methods)
 
bool compressor_avail (int format)
 
struct compressorcompressor_init (compressor_cb_t cb, int format, size_t maxiosize, int level, void *arg)
 
void compressor_reset (struct compressor *stream)
 
int compressor_write (struct compressor *stream, void *data, size_t len)
 
int compressor_flush (struct compressor *stream)
 
void compressor_fini (struct compressor *stream)
 

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ compressor_avail()

bool compressor_avail ( int  format)

Definition at line 500 of file subr_compressor.c.

References compressor_methods::format.

Referenced by sysctl_compress_user_cores().

Here is the caller graph for this function:

◆ compressor_fini()

void compressor_fini ( struct compressor stream)

Definition at line 562 of file subr_compressor.c.

References compressor_methods::fini, compressor::methods, and compressor::priv.

Referenced by coredump(), and kerneldumpcomp_destroy().

Here is the caller graph for this function:

◆ compressor_flush()

int compressor_flush ( struct compressor stream)

Definition at line 554 of file subr_compressor.c.

References compressor::arg, compressor::cb, compressor::methods, compressor::priv, and compressor_methods::write.

Referenced by coredump(), and dump_finish().

Here is the caller graph for this function:

◆ compressor_init()

struct compressor * compressor_init ( compressor_cb_t  cb,
int  format,
size_t  maxiosize,
int  level,
void *  arg 
)

Definition at line 512 of file subr_compressor.c.

References compressor::arg, compressor::cb, level, malloc(), compressor::methods, and compressor::priv.

Referenced by coredump(), and kerneldumpcomp_create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compressor_reset()

void compressor_reset ( struct compressor stream)

Definition at line 539 of file subr_compressor.c.

References compressor::methods, compressor::priv, and compressor_methods::reset.

Referenced by dump_finish().

Here is the caller graph for this function:

◆ compressor_write()

int compressor_write ( struct compressor stream,
void *  data,
size_t  len 
)

Definition at line 546 of file subr_compressor.c.

References compressor::arg, compressor::cb, data, compressor::methods, compressor::priv, and compressor_methods::write.

Referenced by compress_chunk(), dump_append(), and sbuf_drain_core_output().

Here is the caller graph for this function:

◆ MALLOC_DEFINE()

MALLOC_DEFINE ( M_COMPRESS  ,
"compressor"  ,
"kernel compression subroutines"   
)

◆ SET_DECLARE()

SET_DECLARE ( compressors  ,
struct compressor_methods   
)