[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160527075934.GC504@swordfish>
Date: Fri, 27 May 2016 16:59:34 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Minchan Kim <minchan@...nel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Subject: Re: [PATCH 2/7] zram: switch to crypto compress API
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
Powered by blists - more mailing lists