Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1407899

Re: [PATCH 2/7] zram: switch to crypto compress API

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/7] zram: switch to crypto compress API
Date 2016-05-27 10:10 +0200
Message-ID <rDl0e-Ub-29@gated-at.bofh.it> (permalink)
References <rCHcu-1wD-15@gated-at.bofh.it> <rCHcu-1wD-19@gated-at.bofh.it> <rDhzj-7b0-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 2/7] zram: switch to crypto compress API Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-05-25 15:40 +0200
  Re: [PATCH 2/7] zram: switch to crypto compress API Minchan Kim <minchan@kernel.org> - 2016-05-27 06:30 +0200
    Re: [PATCH 2/7] zram: switch to crypto compress API Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-05-27 10:10 +0200

csiph-web