Skip to content

Commit

Permalink
lib: zstd: Revise the warning fix at zstd_reset_cstream()
Browse files Browse the repository at this point in the history
Subsequent to commit 15f1b5e137 {"lib: zstd: Fix a warning in zstd_reset_cstream()"}

- As referenced by Nick Terrelln ~ the ZSTD maintainer in the
  linux kernel [1], making zstd_reset_cstream() functionally
  identical to ZSTD_resetCStream() would be the perfect way to
  fix the warning without touching any core functions or breaking
  other parts of the code.

[1]: facebook/zstd#3088 (comment)

Suggested-by: Nick Terrell <[email protected]>
Signed-off-by: Cyber Knight <[email protected]>
Change-Id: I05e3139a386011afa44688407777f402ae2c913b
Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
Signed-off-by: TogoFire <[email protected]>
  • Loading branch information
cyberknight777 authored and TogoFire committed Jan 12, 2025
1 parent d8401bd commit c0acf7f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/zstd/zstd_compress_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,11 @@ EXPORT_SYMBOL(zstd_init_cstream);
size_t zstd_reset_cstream(zstd_cstream *cstream,
unsigned long long pledged_src_size)
{
return ZSTD_CCtx_reset(cstream, pledged_src_size);
if (pledged_src_size == 0)
pledged_src_size = ZSTD_CONTENTSIZE_UNKNOWN;
ZSTD_FORWARD_IF_ERR( ZSTD_CCtx_reset(cstream, ZSTD_reset_session_only) );
ZSTD_FORWARD_IF_ERR( ZSTD_CCtx_setPledgedSrcSize(cstream, pledged_src_size) );
return 0;
}
EXPORT_SYMBOL(zstd_reset_cstream);

Expand Down

0 comments on commit c0acf7f

Please sign in to comment.