Whamcloud - gitweb
EX-7601 obd: move type switching to alloc_compr callers
authorPatrick Farrell <pfarrell@whamcloud.com>
Sat, 11 Nov 2023 20:39:22 +0000 (15:39 -0500)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 27 Nov 2023 18:37:08 +0000 (18:37 +0000)
commit67794c3814408d497b4c3e12e2fdcc25a51b0595
tree0992e68e99c9bc54fb539f372cdc6f85558b2333
parent1bcad8078e8c72324674353725872b673b801019
EX-7601 obd: move type switching to alloc_compr callers

The code is much cleaner if we can eliminated applied type
and handle that issue once per compression or decompression
rather than for every chunk.  This requires moving the type
switching inside alloc_compr.  (Also improve some error
messages - alloc_compr can fail with ENOMEM as well.)

The compression code currently allocates a transform for
every chunk on the client.  This is relatively cheap, but
it also complicates the code by repeatedly checking if a
particular compression type is supported (this is the
"applied type" code).

Moving alloc_compr to compress/decompress request makes the
code much simpler.

Signed-off-by: Patrick Farrell <pfarrell@whamcloud.com>
Change-Id: I162e81577db721a9715d57b3f262fcabbcbf308a
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53103
Reviewed-by: Artem Blagodarenko <ablagodarenko@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
lustre/include/lustre_compr.h
lustre/obdclass/lustre_compr.c
lustre/osc/osc_compress.c