Re: [PATCH 3/7] zram: drop zcomp param from compress/decompress

From: Minchan Kim
Date: Fri May 27 2016 - 00:22:31 EST


On Wed, May 25, 2016 at 11:30:02PM +0900, Sergey Senozhatsky wrote:
> We don't need to supply a zcomp pointer to compress/decompress
> functions, drop it.
>
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
> Cc: Minchan Kim <minchan@xxxxxxxxxx>
> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx>

Could you fold this patch into previous one?

> ---
> drivers/block/zram/zcomp.c | 5 ++---
> drivers/block/zram/zcomp.h | 4 ++--
> drivers/block/zram/zram_drv.c | 4 ++--
> 3 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
> index 82b568e..6e16fa2 100644
> --- a/drivers/block/zram/zcomp.c
> +++ b/drivers/block/zram/zcomp.c
> @@ -102,7 +102,7 @@ void zcomp_stream_put(struct zcomp *comp)
> put_cpu_ptr(comp->stream);
> }
>
> -int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
> +int zcomp_compress(struct zcomp_strm *zstrm,
> const unsigned char *src, unsigned int *dst_len)
> {
> /*
> @@ -126,8 +126,7 @@ int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
> zstrm->buffer, dst_len);
> }
>
> -int zcomp_decompress(struct zcomp *comp,
> - struct zcomp_strm *zstrm,
> +int zcomp_decompress(struct zcomp_strm *zstrm,
> const unsigned char *src,
> size_t src_len, unsigned char *dst)
> {
> diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h
> index ba36bde..3fb9dc4 100644
> --- a/drivers/block/zram/zcomp.h
> +++ b/drivers/block/zram/zcomp.h
> @@ -53,10 +53,10 @@ void zcomp_destroy(struct zcomp *comp);
> struct zcomp_strm *zcomp_stream_get(struct zcomp *comp);
> void zcomp_stream_put(struct zcomp *comp);
>
> -int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
> +int zcomp_compress(struct zcomp_strm *zstrm,
> const unsigned char *src, unsigned int *dst_len);
>
> -int zcomp_decompress(struct zcomp *comp, struct zcomp_strm *zstrm,
> +int zcomp_decompress(struct zcomp_strm *zstrm,
> const unsigned char *src,
> size_t src_len, unsigned char *dst);
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index fa22a32..99c8be7 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -581,7 +581,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)
> } else {
> struct zcomp_strm *zstrm = zcomp_stream_get(zram->comp);
>
> - ret = zcomp_decompress(zram->comp, zstrm, cmem, size, mem);
> + ret = zcomp_decompress(zstrm, cmem, size, mem);
> zcomp_stream_put(zram->comp);
> }
> zs_unmap_object(meta->mem_pool, handle);
> @@ -700,7 +700,7 @@ compress_again:
> }
>
> zstrm = zcomp_stream_get(zram->comp);
> - ret = zcomp_compress(zram->comp, zstrm, uncmem, &clen);
> + ret = zcomp_compress(zstrm, uncmem, &clen);
> if (!is_partial_io(bvec)) {
> kunmap_atomic(user_mem);
> user_mem = NULL;
> --
> 2.8.3.394.g3916adf
>