From: Bimba Shrestha Date: Mon, 9 Mar 2020 20:40:18 +0000 (-0500) Subject: Setting ZSTD_c_contentSizeFlag instead of UNKNOWN filesize X-Git-Tag: v1.4.5^2~79^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9388dac2c0fee6a88b4e7d0d6bd10ad883aef47a;p=thirdparty%2Fzstd.git Setting ZSTD_c_contentSizeFlag instead of UNKNOWN filesize --- diff --git a/programs/fileio.c b/programs/fileio.c index 1a0bb97c0..c833336dc 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -823,6 +823,7 @@ static cRess_t FIO_createCResources(FIO_prefs_t* const prefs, CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_contentSizeFlag, 1) ); /* always enable content size when available (note: supposed to be default) */ CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_dictIDFlag, prefs->dictIDFlag) ); CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_checksumFlag, prefs->checksumFlag) ); + CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_contentSizeFlag, prefs->contentSize) ); /* compression level */ CHECK( ZSTD_CCtx_setParameter(ress.cctx, ZSTD_c_compressionLevel, cLevel) ); /* max compressed block size */ @@ -1342,7 +1343,7 @@ FIO_compressFilename_internal(FIO_prefs_t* const prefs, clock_t const cpuStart = clock(); U64 readsize = 0; U64 compressedfilesize = 0; - U64 const fileSize = prefs->contentSize ? UTIL_getFileSize(srcFileName) : UTIL_FILESIZE_UNKNOWN; + U64 const fileSize = UTIL_getFileSize(srcFileName); DISPLAYLEVEL(5, "%s: %u bytes \n", srcFileName, (unsigned)fileSize); /* compression format selection */