aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/deflate.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-28 14:06:39 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-28 14:06:39 -0400
commitf28e71617ddaf2483e3e5c5237103484a303743f (patch)
tree67627d2d8ddbf6a4449371e9261d796c013b1fa1 /crypto/deflate.c
parentdc6a78f1af10d28fb8c395034ae1e099b85c05b0 (diff)
parenta39727f212426b9d5f9267b3318a2afaf9922d3b (diff)
Merge ../linux-2.6/
Conflicts: drivers/scsi/aacraid/comminit.c Fixed up by removing the now renamed CONFIG_IOMMU option from aacraid Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'crypto/deflate.c')
-rw-r--r--crypto/deflate.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/crypto/deflate.c b/crypto/deflate.c
index f209368d62ae..6588bbf82e9b 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -102,8 +102,9 @@ static void deflate_decomp_exit(struct deflate_ctx *ctx)
102 kfree(ctx->decomp_stream.workspace); 102 kfree(ctx->decomp_stream.workspace);
103} 103}
104 104
105static int deflate_init(void *ctx) 105static int deflate_init(struct crypto_tfm *tfm)
106{ 106{
107 struct deflate_ctx *ctx = crypto_tfm_ctx(tfm);
107 int ret; 108 int ret;
108 109
109 ret = deflate_comp_init(ctx); 110 ret = deflate_comp_init(ctx);
@@ -116,17 +117,19 @@ out:
116 return ret; 117 return ret;
117} 118}
118 119
119static void deflate_exit(void *ctx) 120static void deflate_exit(struct crypto_tfm *tfm)
120{ 121{
122 struct deflate_ctx *ctx = crypto_tfm_ctx(tfm);
123
121 deflate_comp_exit(ctx); 124 deflate_comp_exit(ctx);
122 deflate_decomp_exit(ctx); 125 deflate_decomp_exit(ctx);
123} 126}
124 127
125static int deflate_compress(void *ctx, const u8 *src, unsigned int slen, 128static int deflate_compress(struct crypto_tfm *tfm, const u8 *src,
126 u8 *dst, unsigned int *dlen) 129 unsigned int slen, u8 *dst, unsigned int *dlen)
127{ 130{
128 int ret = 0; 131 int ret = 0;
129 struct deflate_ctx *dctx = ctx; 132 struct deflate_ctx *dctx = crypto_tfm_ctx(tfm);
130 struct z_stream_s *stream = &dctx->comp_stream; 133 struct z_stream_s *stream = &dctx->comp_stream;
131 134
132 ret = zlib_deflateReset(stream); 135 ret = zlib_deflateReset(stream);
@@ -151,12 +154,12 @@ out:
151 return ret; 154 return ret;
152} 155}
153 156
154static int deflate_decompress(void *ctx, const u8 *src, unsigned int slen, 157static int deflate_decompress(struct crypto_tfm *tfm, const u8 *src,
155 u8 *dst, unsigned int *dlen) 158 unsigned int slen, u8 *dst, unsigned int *dlen)
156{ 159{
157 160
158 int ret = 0; 161 int ret = 0;
159 struct deflate_ctx *dctx = ctx; 162 struct deflate_ctx *dctx = crypto_tfm_ctx(tfm);
160 struct z_stream_s *stream = &dctx->decomp_stream; 163 struct z_stream_s *stream = &dctx->decomp_stream;
161 164
162 ret = zlib_inflateReset(stream); 165 ret = zlib_inflateReset(stream);
@@ -198,9 +201,9 @@ static struct crypto_alg alg = {
198 .cra_ctxsize = sizeof(struct deflate_ctx), 201 .cra_ctxsize = sizeof(struct deflate_ctx),
199 .cra_module = THIS_MODULE, 202 .cra_module = THIS_MODULE,
200 .cra_list = LIST_HEAD_INIT(alg.cra_list), 203 .cra_list = LIST_HEAD_INIT(alg.cra_list),
204 .cra_init = deflate_init,
205 .cra_exit = deflate_exit,
201 .cra_u = { .compress = { 206 .cra_u = { .compress = {
202 .coa_init = deflate_init,
203 .coa_exit = deflate_exit,
204 .coa_compress = deflate_compress, 207 .coa_compress = deflate_compress,
205 .coa_decompress = deflate_decompress } } 208 .coa_decompress = deflate_decompress } }
206}; 209};