diff --git a/zipl/boot/eckd2dump.c b/zipl/boot/eckd2dump.c index 037ace16..67d9204a 100644 --- a/zipl/boot/eckd2dump.c +++ b/zipl/boot/eckd2dump.c @@ -451,7 +451,8 @@ void readblock(unsigned long blk, unsigned long addr, unsigned long blk_count) * given block and return the next free block number. The len value must be * a multiple of a block size (4096 bytes). */ -unsigned long write_addr_range(unsigned long blk, unsigned long start, unsigned long len) +unsigned long write_addr_range(unsigned long blk, unsigned long start, + unsigned long len, int print_progress) { unsigned long addr, start_blk, blk_count, zero_page; @@ -468,8 +469,9 @@ unsigned long write_addr_range(unsigned long blk, unsigned long start, unsigned zero_page = get_zeroed_page(); writeblock(blk, addr, blk_count, zero_page); free_page(zero_page); - progress_print(addr); blk += blk_count; + if (print_progress) + progress_print(addr); addr += b2m(blk_count); } return blk; @@ -491,7 +493,7 @@ unsigned long write_dump_segment(unsigned long blk, free_page(zero_page); blk += m2b(PAGE_SIZE); /* Write the dump segment */ - return write_addr_range(blk, segm->start, segm->len); + return write_addr_range(blk, segm->start, segm->len, PRINT_PROGRESS); } /* diff --git a/zipl/boot/eckd2dump.h b/zipl/boot/eckd2dump.h index 702e1f95..795ed6c4 100644 --- a/zipl/boot/eckd2dump.h +++ b/zipl/boot/eckd2dump.h @@ -51,6 +51,9 @@ void writeblock(unsigned long blk, unsigned long addr, unsigned long blk_count, void readblock(unsigned long blk, unsigned long addr, unsigned long blk_count); unsigned long write_dump_segment(unsigned long blk, struct df_s390_dump_segm_hdr *segm); -unsigned long write_addr_range(unsigned long blk, unsigned long addr, unsigned long len); +#define NO_PROGRESS 0 +#define PRINT_PROGRESS 1 +unsigned long write_addr_range(unsigned long blk, unsigned long addr, + unsigned long len, int print_progress); #endif /* ECKD2DUMP_H */ diff --git a/zipl/boot/eckd2dump_zlib.c b/zipl/boot/eckd2dump_zlib.c index 5601d011..bb96b774 100644 --- a/zipl/boot/eckd2dump_zlib.c +++ b/zipl/boot/eckd2dump_zlib.c @@ -79,7 +79,7 @@ static int compress_write_next_chunk(unsigned long addr, unsigned long len, * notify the caller. */ if (rc != Z_OK) { - *blk = write_addr_range(start_blk, addr, len); + *blk = write_addr_range(start_blk, addr, len, NO_PROGRESS); return COMPRESSION_ERROR; } if (strm->avail_out == 0) { @@ -90,11 +90,11 @@ static int compress_write_next_chunk(unsigned long addr, unsigned long len, */ if (strm->total_out >= strm->total_in && *blk == start_blk) { - *blk = write_addr_range(start_blk, addr, len); + *blk = write_addr_range(start_blk, addr, len, NO_PROGRESS); return UNCOMPRESSED; } *blk = write_addr_range(*blk, (unsigned long)zlib_out_buf, - zlib_buf_size); + zlib_buf_size, NO_PROGRESS); strm->next_out = (void *)zlib_out_buf; strm->avail_out = zlib_buf_size; } @@ -104,7 +104,7 @@ static int compress_write_next_chunk(unsigned long addr, unsigned long len, strm->avail_in = 0; rc = zlib_deflate(strm, Z_FINISH); len = ROUND_UP(zlib_buf_size - strm->avail_out, PAGE_SIZE); - *blk = write_addr_range(*blk, (unsigned long)zlib_out_buf, len); + *blk = write_addr_range(*blk, (unsigned long)zlib_out_buf, len, NO_PROGRESS); if (strm->avail_out == 0) { strm->next_out = zlib_out_buf; strm->avail_out = zlib_buf_size; @@ -165,6 +165,7 @@ unsigned long write_compressed_dump_segment(unsigned long blk, if (rc == UNCOMPRESSED || rc == COMPRESSION_ERROR) segm->entry_offset[i] |= DUMP_SEGM_ENTRY_UNCOMPRESSED; offset += blk - start_blk; + /* Print progress after each compressed chunk written */ progress_print(segm->start + i * chunk_size); } /* Compression successful, store compressed size in the segment header */