From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756177AbbIUHzR (ORCPT ); Mon, 21 Sep 2015 03:55:17 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:36640 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755986AbbIUHzP (ORCPT ); Mon, 21 Sep 2015 03:55:15 -0400 Date: Mon, 21 Sep 2015 16:56:00 +0900 From: Sergey Senozhatsky To: Joonsoo Kim Cc: Andrew Morton , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Herbert Xu , "David S. Miller" , Stephan Mueller , Joonsoo Kim Subject: Re: [PATCH v3 9/9] zram: use crypto decompress_noctx API Message-ID: <20150921075600.GA511@swordfish> References: <1442553564-3476-1-git-send-email-iamjoonsoo.kim@lge.com> <1442553564-3476-10-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442553564-3476-10-git-send-email-iamjoonsoo.kim@lge.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (09/18/15 14:19), Joonsoo Kim wrote: [..] > + /* > + * Prepare to use crypto decompress_noctx API. One tfm is required > + * to initialize crypto algorithm properly and fetch corresponding > + * function pointer. But, it is sharable for multiple concurrent > + * decompress users. > + */ if comp algorithm require zstrm for both compression and decompression, then there seems to be no need in allocating sharable ->tfm_noctx, we will never use it. -ss > + tfm = crypto_alloc_comp_noctx(compress, 0, 0); > + if (!IS_ERR(tfm)) > + comp->tfm_noctx = tfm; > + > return comp; > } > diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h > index 4f9df8e..c76d8e4 100644 > --- a/drivers/block/zram/zcomp.h > +++ b/drivers/block/zram/zcomp.h > @@ -26,6 +26,7 @@ struct zcomp_strm { > /* dynamic per-device compression frontend */ > struct zcomp { > void *stream; > + struct crypto_comp *tfm_noctx; > const char *backend; > > struct zcomp_strm *(*strm_find)(struct zcomp *comp);