~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/lib/zstd/zstd_decompress_module.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /lib/zstd/zstd_decompress_module.c (Architecture m68k) and /lib/zstd/zstd_decompress_module.c (Architecture alpha)


  1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-      1 // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
  2 /*                                                  2 /*
  3  * Copyright (c) Facebook, Inc.                     3  * Copyright (c) Facebook, Inc.
  4  * All rights reserved.                             4  * All rights reserved.
  5  *                                                  5  *
  6  * This source code is licensed under both the      6  * This source code is licensed under both the BSD-style license (found in the
  7  * LICENSE file in the root directory of this       7  * LICENSE file in the root directory of this source tree) and the GPLv2 (found
  8  * in the COPYING file in the root directory o      8  * in the COPYING file in the root directory of this source tree).
  9  * You may select, at your option, one of the       9  * You may select, at your option, one of the above-listed licenses.
 10  */                                                10  */
 11                                                    11 
 12 #include <linux/kernel.h>                          12 #include <linux/kernel.h>
 13 #include <linux/module.h>                          13 #include <linux/module.h>
 14 #include <linux/string.h>                          14 #include <linux/string.h>
 15 #include <linux/zstd.h>                            15 #include <linux/zstd.h>
 16                                                    16 
 17 #include "common/zstd_deps.h"                      17 #include "common/zstd_deps.h"
 18                                                    18 
 19 /* Common symbols. zstd_compress must depend o     19 /* Common symbols. zstd_compress must depend on zstd_decompress. */
 20                                                    20 
 21 unsigned int zstd_is_error(size_t code)            21 unsigned int zstd_is_error(size_t code)
 22 {                                                  22 {
 23         return ZSTD_isError(code);                 23         return ZSTD_isError(code);
 24 }                                                  24 }
 25 EXPORT_SYMBOL(zstd_is_error);                      25 EXPORT_SYMBOL(zstd_is_error);
 26                                                    26 
 27 zstd_error_code zstd_get_error_code(size_t cod     27 zstd_error_code zstd_get_error_code(size_t code)
 28 {                                                  28 {
 29         return ZSTD_getErrorCode(code);            29         return ZSTD_getErrorCode(code);
 30 }                                                  30 }
 31 EXPORT_SYMBOL(zstd_get_error_code);                31 EXPORT_SYMBOL(zstd_get_error_code);
 32                                                    32 
 33 const char *zstd_get_error_name(size_t code)       33 const char *zstd_get_error_name(size_t code)
 34 {                                                  34 {
 35         return ZSTD_getErrorName(code);            35         return ZSTD_getErrorName(code);
 36 }                                                  36 }
 37 EXPORT_SYMBOL(zstd_get_error_name);                37 EXPORT_SYMBOL(zstd_get_error_name);
 38                                                    38 
 39 /* Decompression symbols. */                       39 /* Decompression symbols. */
 40                                                    40 
 41 size_t zstd_dctx_workspace_bound(void)             41 size_t zstd_dctx_workspace_bound(void)
 42 {                                                  42 {
 43         return ZSTD_estimateDCtxSize();            43         return ZSTD_estimateDCtxSize();
 44 }                                                  44 }
 45 EXPORT_SYMBOL(zstd_dctx_workspace_bound);          45 EXPORT_SYMBOL(zstd_dctx_workspace_bound);
 46                                                    46 
 47 zstd_dctx *zstd_create_dctx_advanced(zstd_cust     47 zstd_dctx *zstd_create_dctx_advanced(zstd_custom_mem custom_mem)
 48 {                                                  48 {
 49         return ZSTD_createDCtx_advanced(custom     49         return ZSTD_createDCtx_advanced(custom_mem);
 50 }                                                  50 }
 51 EXPORT_SYMBOL(zstd_create_dctx_advanced);          51 EXPORT_SYMBOL(zstd_create_dctx_advanced);
 52                                                    52 
 53 size_t zstd_free_dctx(zstd_dctx *dctx)             53 size_t zstd_free_dctx(zstd_dctx *dctx)
 54 {                                                  54 {
 55         return ZSTD_freeDCtx(dctx);                55         return ZSTD_freeDCtx(dctx);
 56 }                                                  56 }
 57 EXPORT_SYMBOL(zstd_free_dctx);                     57 EXPORT_SYMBOL(zstd_free_dctx);
 58                                                    58 
 59 zstd_ddict *zstd_create_ddict_byreference(cons     59 zstd_ddict *zstd_create_ddict_byreference(const void *dict, size_t dict_size,
 60                                           zstd     60                                           zstd_custom_mem custom_mem)
 61 {                                                  61 {
 62         return ZSTD_createDDict_advanced(dict,     62         return ZSTD_createDDict_advanced(dict, dict_size, ZSTD_dlm_byRef,
 63                                          ZSTD_     63                                          ZSTD_dct_auto, custom_mem);
 64                                                    64 
 65 }                                                  65 }
 66 EXPORT_SYMBOL(zstd_create_ddict_byreference);      66 EXPORT_SYMBOL(zstd_create_ddict_byreference);
 67                                                    67 
 68 size_t zstd_free_ddict(zstd_ddict *ddict)          68 size_t zstd_free_ddict(zstd_ddict *ddict)
 69 {                                                  69 {
 70         return ZSTD_freeDDict(ddict);              70         return ZSTD_freeDDict(ddict);
 71 }                                                  71 }
 72 EXPORT_SYMBOL(zstd_free_ddict);                    72 EXPORT_SYMBOL(zstd_free_ddict);
 73                                                    73 
 74 zstd_dctx *zstd_init_dctx(void *workspace, siz     74 zstd_dctx *zstd_init_dctx(void *workspace, size_t workspace_size)
 75 {                                                  75 {
 76         if (workspace == NULL)                     76         if (workspace == NULL)
 77                 return NULL;                       77                 return NULL;
 78         return ZSTD_initStaticDCtx(workspace,      78         return ZSTD_initStaticDCtx(workspace, workspace_size);
 79 }                                                  79 }
 80 EXPORT_SYMBOL(zstd_init_dctx);                     80 EXPORT_SYMBOL(zstd_init_dctx);
 81                                                    81 
 82 size_t zstd_decompress_dctx(zstd_dctx *dctx, v     82 size_t zstd_decompress_dctx(zstd_dctx *dctx, void *dst, size_t dst_capacity,
 83         const void *src, size_t src_size)          83         const void *src, size_t src_size)
 84 {                                                  84 {
 85         return ZSTD_decompressDCtx(dctx, dst,      85         return ZSTD_decompressDCtx(dctx, dst, dst_capacity, src, src_size);
 86 }                                                  86 }
 87 EXPORT_SYMBOL(zstd_decompress_dctx);               87 EXPORT_SYMBOL(zstd_decompress_dctx);
 88                                                    88 
 89 size_t zstd_decompress_using_ddict(zstd_dctx *     89 size_t zstd_decompress_using_ddict(zstd_dctx *dctx,
 90         void *dst, size_t dst_capacity, const      90         void *dst, size_t dst_capacity, const void* src, size_t src_size,
 91         const zstd_ddict* ddict)                   91         const zstd_ddict* ddict)
 92 {                                                  92 {
 93         return ZSTD_decompress_usingDDict(dctx     93         return ZSTD_decompress_usingDDict(dctx, dst, dst_capacity, src,
 94                                           src_     94                                           src_size, ddict);
 95 }                                                  95 }
 96 EXPORT_SYMBOL(zstd_decompress_using_ddict);        96 EXPORT_SYMBOL(zstd_decompress_using_ddict);
 97                                                    97 
 98 size_t zstd_dstream_workspace_bound(size_t max     98 size_t zstd_dstream_workspace_bound(size_t max_window_size)
 99 {                                                  99 {
100         return ZSTD_estimateDStreamSize(max_wi    100         return ZSTD_estimateDStreamSize(max_window_size);
101 }                                                 101 }
102 EXPORT_SYMBOL(zstd_dstream_workspace_bound);      102 EXPORT_SYMBOL(zstd_dstream_workspace_bound);
103                                                   103 
104 zstd_dstream *zstd_init_dstream(size_t max_win    104 zstd_dstream *zstd_init_dstream(size_t max_window_size, void *workspace,
105         size_t workspace_size)                    105         size_t workspace_size)
106 {                                                 106 {
107         if (workspace == NULL)                    107         if (workspace == NULL)
108                 return NULL;                      108                 return NULL;
109         (void)max_window_size;                    109         (void)max_window_size;
110         return ZSTD_initStaticDStream(workspac    110         return ZSTD_initStaticDStream(workspace, workspace_size);
111 }                                                 111 }
112 EXPORT_SYMBOL(zstd_init_dstream);                 112 EXPORT_SYMBOL(zstd_init_dstream);
113                                                   113 
114 size_t zstd_reset_dstream(zstd_dstream *dstrea    114 size_t zstd_reset_dstream(zstd_dstream *dstream)
115 {                                                 115 {
116         return ZSTD_resetDStream(dstream);        116         return ZSTD_resetDStream(dstream);
117 }                                                 117 }
118 EXPORT_SYMBOL(zstd_reset_dstream);                118 EXPORT_SYMBOL(zstd_reset_dstream);
119                                                   119 
120 size_t zstd_decompress_stream(zstd_dstream *ds    120 size_t zstd_decompress_stream(zstd_dstream *dstream, zstd_out_buffer *output,
121         zstd_in_buffer *input)                    121         zstd_in_buffer *input)
122 {                                                 122 {
123         return ZSTD_decompressStream(dstream,     123         return ZSTD_decompressStream(dstream, output, input);
124 }                                                 124 }
125 EXPORT_SYMBOL(zstd_decompress_stream);            125 EXPORT_SYMBOL(zstd_decompress_stream);
126                                                   126 
127 size_t zstd_find_frame_compressed_size(const v    127 size_t zstd_find_frame_compressed_size(const void *src, size_t src_size)
128 {                                                 128 {
129         return ZSTD_findFrameCompressedSize(sr    129         return ZSTD_findFrameCompressedSize(src, src_size);
130 }                                                 130 }
131 EXPORT_SYMBOL(zstd_find_frame_compressed_size)    131 EXPORT_SYMBOL(zstd_find_frame_compressed_size);
132                                                   132 
133 size_t zstd_get_frame_header(zstd_frame_header    133 size_t zstd_get_frame_header(zstd_frame_header *header, const void *src,
134         size_t src_size)                          134         size_t src_size)
135 {                                                 135 {
136         return ZSTD_getFrameHeader(header, src    136         return ZSTD_getFrameHeader(header, src, src_size);
137 }                                                 137 }
138 EXPORT_SYMBOL(zstd_get_frame_header);             138 EXPORT_SYMBOL(zstd_get_frame_header);
139                                                   139 
140 MODULE_LICENSE("Dual BSD/GPL");                   140 MODULE_LICENSE("Dual BSD/GPL");
141 MODULE_DESCRIPTION("Zstd Decompressor");          141 MODULE_DESCRIPTION("Zstd Decompressor");
142                                                   142 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php