diff options
author | Brian Behlendorf <[email protected]> | 2011-04-20 14:22:35 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-04-20 14:39:15 -0700 |
commit | 3dfc591ac4003d1c92159b5dfe8970f24e008f81 (patch) | |
tree | 0a3014aeffafed2ac02e307eaf5fdb2be649c420 /config | |
parent | b1cbc4610c8b5a9b5de80cb850a6eb58bb811a1d (diff) |
Linux 2.6.39 compat, zlib_deflate_workspacesize()
The function zlib_deflate_workspacesize() now take 2 arguments.
This was done to avoid always having to allocate the maximum size
workspace (268K). The caller can now specific the windowBits and
memLevel compression parameters to get a smaller workspace.
For our purposes we introduce a spl_zlib_deflate_workspacesize()
wrapper which accepts both arguments. When the two argument
version of zlib_deflate_workspacesize() is available the arguments
are passed through. When it's not we assume the worst case and
a maximally sized workspace is used.
Diffstat (limited to 'config')
-rw-r--r-- | config/spl-build.m4 | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 13c68358b..97b38234b 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -80,6 +80,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [ SPL_AC_SHRINK_DCACHE_MEMORY SPL_AC_SHRINK_ICACHE_MEMORY SPL_AC_KERN_PATH_PARENT + SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE ]) AC_DEFUN([SPL_AC_MODULE_SYMVERS], [ @@ -1802,3 +1803,25 @@ AC_DEFUN([SPL_AC_KERN_PATH_PARENT], [ [kern_path_parent() is available])], []) ]) + +dnl # +dnl # 2.6.39 API compat, +dnl # The function zlib_deflate_workspacesize() now take 2 arguments. +dnl # This was done to avoid always having to allocate the maximum size +dnl # workspace (268K). The caller can now specific the windowBits and +dnl # memLevel compression parameters to get a smaller workspace. +dnl # +AC_DEFUN([SPL_AC_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE], + [AC_MSG_CHECKING([whether zlib_deflate_workspacesize() wants 2 args]) + SPL_LINUX_TRY_COMPILE([ + #include <linux/zlib.h> + ],[ + return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL); + ],[ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE, 1, + [zlib_deflate_workspacesize() wants 2 args]) + ],[ + AC_MSG_RESULT(no) + ]) +]) |