Skip to content

Commit

Permalink
Add fakey 'deflateBound()' function to the in-kernel zlib routines
Browse files Browse the repository at this point in the history
It's not the real deflateBound() in newer zlib libraries, partly because
the upcoming usage of it won't have the "stream" available, so we can't
have the same interfaces anyway.
  • Loading branch information
Linus Torvalds committed Aug 6, 2005
1 parent 021a52a commit 243393c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/linux/zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ extern int zlib_deflateReset (z_streamp strm);
stream state was inconsistent (such as zalloc or state being NULL).
*/

static inline unsigned long deflateBound(unsigned long s)
{
return s + ((s + 7) >> 3) + ((s + 63) >> 6) + 11;
}

extern int zlib_deflateParams (z_streamp strm, int level, int strategy);
/*
Dynamically update the compression level and compression strategy. The
Expand Down

0 comments on commit 243393c

Please sign in to comment.