@@ -33,8 +33,6 @@ static unsigned int nr_cpus_per_node;
3333/* Number of physical cpus sharing each iaa instance */
3434static unsigned int cpus_per_iaa ;
3535
36- static struct crypto_comp * deflate_generic_tfm ;
37-
3836/* Per-cpu lookup table for balanced wqs */
3937static struct wq_table_entry __percpu * wq_table ;
4038
@@ -1001,17 +999,14 @@ static inline int check_completion(struct device *dev,
1001999
10021000static int deflate_generic_decompress (struct acomp_req * req )
10031001{
1004- void * src , * dst ;
1002+ ACOMP_REQUEST_ON_STACK ( fbreq , crypto_acomp_reqtfm ( req )) ;
10051003 int ret ;
10061004
1007- src = kmap_local_page (sg_page (req -> src )) + req -> src -> offset ;
1008- dst = kmap_local_page (sg_page (req -> dst )) + req -> dst -> offset ;
1009-
1010- ret = crypto_comp_decompress (deflate_generic_tfm ,
1011- src , req -> slen , dst , & req -> dlen );
1012-
1013- kunmap_local (src );
1014- kunmap_local (dst );
1005+ acomp_request_set_callback (fbreq , 0 , NULL , NULL );
1006+ acomp_request_set_params (fbreq , req -> src , req -> dst , req -> slen ,
1007+ req -> dlen );
1008+ ret = crypto_acomp_decompress (fbreq );
1009+ req -> dlen = fbreq -> dlen ;
10151010
10161011 update_total_sw_decomp_calls ();
10171012
@@ -1898,15 +1893,6 @@ static int __init iaa_crypto_init_module(void)
18981893 }
18991894 nr_cpus_per_node = nr_cpus / nr_nodes ;
19001895
1901- if (crypto_has_comp ("deflate-generic" , 0 , 0 ))
1902- deflate_generic_tfm = crypto_alloc_comp ("deflate-generic" , 0 , 0 );
1903-
1904- if (IS_ERR_OR_NULL (deflate_generic_tfm )) {
1905- pr_err ("IAA could not alloc %s tfm: errcode = %ld\n" ,
1906- "deflate-generic" , PTR_ERR (deflate_generic_tfm ));
1907- return - ENOMEM ;
1908- }
1909-
19101896 ret = iaa_aecs_init_fixed ();
19111897 if (ret < 0 ) {
19121898 pr_debug ("IAA fixed compression mode init failed\n" );
@@ -1948,7 +1934,6 @@ static int __init iaa_crypto_init_module(void)
19481934err_driver_reg :
19491935 iaa_aecs_cleanup_fixed ();
19501936err_aecs_init :
1951- crypto_free_comp (deflate_generic_tfm );
19521937
19531938 goto out ;
19541939}
@@ -1965,7 +1950,6 @@ static void __exit iaa_crypto_cleanup_module(void)
19651950 & driver_attr_verify_compress );
19661951 idxd_driver_unregister (& iaa_crypto_driver );
19671952 iaa_aecs_cleanup_fixed ();
1968- crypto_free_comp (deflate_generic_tfm );
19691953
19701954 pr_debug ("cleaned up\n" );
19711955}
0 commit comments