From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932709AbcE0IBI (ORCPT ); Fri, 27 May 2016 04:01:08 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35506 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932599AbcE0H7p (ORCPT ); Fri, 27 May 2016 03:59:45 -0400 Date: Fri, 27 May 2016 16:59:34 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Sergey Senozhatsky , Andrew Morton , Joonsoo Kim , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 2/7] zram: switch to crypto compress API Message-ID: <20160527075934.GC504@swordfish> References: <20160525143006.1207-1-sergey.senozhatsky@gmail.com> <20160525143006.1207-3-sergey.senozhatsky@gmail.com> <20160527042207.GB2322@bbox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160527042207.GB2322@bbox> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (05/27/16 13:22), Minchan Kim wrote: [..] > > static void zcomp_strm_free(struct zcomp *comp, struct zcomp_strm *zstrm) > > { > > - if (zstrm->private) > > - comp->backend->destroy(zstrm->private); > > + if (!IS_ERR_OR_NULL(zstrm->private)) > > Let's change private with tfm. ok. > > > + crypto_free_comp(zstrm->private); > > free_pages((unsigned long)zstrm->buffer, 1); > > kfree(zstrm); > > } > > @@ -58,13 +55,13 @@ static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp, gfp_t flags) > > if (!zstrm) > > return NULL; > > > > - zstrm->private = comp->backend->create(flags); > > + zstrm->private = crypto_alloc_comp(comp->name, 0, 0); > > crypto_alloc_comp uses GPF_KERNEL for allocating tfm and zram uses > GFP_KERNEL for zcomp_strm_alloc now so there is no point to pass > gfp_t so let's clean it up. yes, I realized that after I sent out the patch. it's basically a revert of 75d8947a36d0c9 ("zram: pass gfp from zcomp frontend to backend"), can do this as a separate patch in the series, as it's more of a clenup. I also realized that passing a zcomp pointer to zcomp_strm_free() is useless; will clean that up. -ss