Files
s390-tools/zipl/boot/eckd2dump_zlib.h
Mikhail Zaslonko d53bfb9201 zipl/boot: Integrate zlib compression to single volume DASD dumper
Integrate zlib DFLTCC deflate compression to single volume dasd dumper
using the existing s390 extended dump format. Compression takes place
only if DFLTCC facility is available, otherwise dump is written
uncompressed as before.

First megabyte of memory is always written uncompressed and afterwards
this area is used for zlib workspace and for the compression output buffer.
The compression takes place in chunks of data of equal size (currently 1MB)
and the offset of each compressed chunk is stored in the dump segment
header. Since existing dump segment headers of 1 page size are used, we
need to limit the maximum size of compressed dump segments.
Chunk is written uncompressed in case of compression error or if
deflate compression only makes it bigger.

Thus every chunk of data is compressed separately and can be decompressed
independently. The main reason for that is to enable zgetdump to make fast
read seeks. Otherwise, zgetdump would need to decompress a big dump segment
in the worst case to extract a single piece of data.

Put compression related functions and structures to eckd2dump_zlib.c
and eckd2dump_zlib.h

Update zipl man page with the general information of zlib compression
support.

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
2023-09-27 18:29:06 +02:00

26 lines
700 B
C

/*
* zipl - zSeries Initial Program Loader tool
*
* Common ECKD dump I/O functions for zlib compression support
*
* Copyright IBM Corp. 2013, 2023
*
* s390-tools is free software; you can redistribute it and/or modify
* it under the terms of the MIT license. See LICENSE for details.
*/
#ifndef ECKD2DUMP_ZLIB_H
#define ECKD2DUMP_ZLIB_H
#include "zlib/zlib.h"
#include "dump/s390_dump.h"
#define ZLIB_WORKSPACE_LIMIT (1 * MIB)
/* Compression related functions */
int zlib_workarea_init(unsigned long addr, z_stream *strm);
unsigned long write_compressed_dump_segment(unsigned long blk,
struct df_s390_dump_segm_hdr *segm,
z_stream *strm);
#endif /* ECKD2DUMP_ZLIB_H */