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

TOMOYO Linux Cross Reference
Linux/include/crypto/internal/acompress.h

Version: ~ [ linux-5.8 ] ~ [ linux-5.7.12 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.55 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.136 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.191 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.232 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.232 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * Asynchronous Compression operations
  4  *
  5  * Copyright (c) 2016, Intel Corporation
  6  * Authors: Weigang Li <weigang.li@intel.com>
  7  *          Giovanni Cabiddu <giovanni.cabiddu@intel.com>
  8  */
  9 #ifndef _CRYPTO_ACOMP_INT_H
 10 #define _CRYPTO_ACOMP_INT_H
 11 #include <crypto/acompress.h>
 12 
 13 /*
 14  * Transform internal helpers.
 15  */
 16 static inline void *acomp_request_ctx(struct acomp_req *req)
 17 {
 18         return req->__ctx;
 19 }
 20 
 21 static inline void *acomp_tfm_ctx(struct crypto_acomp *tfm)
 22 {
 23         return tfm->base.__crt_ctx;
 24 }
 25 
 26 static inline void acomp_request_complete(struct acomp_req *req,
 27                                           int err)
 28 {
 29         req->base.complete(&req->base, err);
 30 }
 31 
 32 static inline const char *acomp_alg_name(struct crypto_acomp *tfm)
 33 {
 34         return crypto_acomp_tfm(tfm)->__crt_alg->cra_name;
 35 }
 36 
 37 static inline struct acomp_req *__acomp_request_alloc(struct crypto_acomp *tfm)
 38 {
 39         struct acomp_req *req;
 40 
 41         req = kzalloc(sizeof(*req) + crypto_acomp_reqsize(tfm), GFP_KERNEL);
 42         if (likely(req))
 43                 acomp_request_set_tfm(req, tfm);
 44         return req;
 45 }
 46 
 47 static inline void __acomp_request_free(struct acomp_req *req)
 48 {
 49         kzfree(req);
 50 }
 51 
 52 /**
 53  * crypto_register_acomp() -- Register asynchronous compression algorithm
 54  *
 55  * Function registers an implementation of an asynchronous
 56  * compression algorithm
 57  *
 58  * @alg:        algorithm definition
 59  *
 60  * Return:      zero on success; error code in case of error
 61  */
 62 int crypto_register_acomp(struct acomp_alg *alg);
 63 
 64 /**
 65  * crypto_unregister_acomp() -- Unregister asynchronous compression algorithm
 66  *
 67  * Function unregisters an implementation of an asynchronous
 68  * compression algorithm
 69  *
 70  * @alg:        algorithm definition
 71  */
 72 void crypto_unregister_acomp(struct acomp_alg *alg);
 73 
 74 int crypto_register_acomps(struct acomp_alg *algs, int count);
 75 void crypto_unregister_acomps(struct acomp_alg *algs, int count);
 76 
 77 #endif
 78 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp