lkml.org 
[lkml]   [2022]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] zram: add size class equals check into recompression
On (22/10/25 19:26), Alexey Romanov wrote:
> +/**
> + * zs_lookup_class_index() - Returns index of the zsmalloc &size_class
> + * that hold objects of the provided size.
> + * @pool: zsmalloc pool to use
> + * @size: object size
> + *
> + * Context: Any context.
> + *
> + * Return: the index of the zsmalloc &size_class that hold objects of the
> + * provided size.
> + */
> +unsigned int zs_lookup_class_index(struct zs_pool *pool, unsigned int size)
> +{
> + struct size_class *class;
> +
> + class = pool->size_class[get_size_class_index(pool, size)];
> +
> + return class->index;
> +}
> +EXPORT_SYMBOL_GPL(zs_lookup_class_index);

I cherry-picked it with one tiny tweak: I want this to be ahead of
my series (break dependency on my series). So I removed pool parameter
from `get_size_class_index(pool, size)` in this patch and add it back
in my series (when I change get_size_class_index() prototype).

\
 
 \ /
  Last update: 2022-10-26 04:15    [W:0.053 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site