lkml.org 
[lkml]   [2022]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv4 4/9] zram: Introduce recompress sysfs knob
On (22/11/04 16:53), Sergey Senozhatsky wrote:
[..]
> +static inline void zram_set_priority(struct zram *zram, u32 index, u32 prio)
> +{
> + prio &= ZRAM_COMP_PRIORITY_MASK;
> + zram->table[index].flags &= (prio << ZRAM_COMP_PRIORITY_1);
> +}

Uh... Something like this, sorry.

+static inline void zram_set_priority(struct zram *zram, u32 index, u32 prio)
+{
+ prio &= ZRAM_RECOMP_PRIO_MASK;
+ zram->table[index].flags &= ~(ZRAM_RECOMP_PRIO_MASK <<
+ ZRAM_RECOMP_PRIORITY_1);
+ zram->table[index].flags |= (prio << ZRAM_RECOMP_PRIORITY_1);
+}

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