Lines Matching refs:prio

159 static inline void zram_set_priority(struct zram *zram, u32 index, u32 prio)  in zram_set_priority()  argument
161 prio &= ZRAM_COMP_PRIORITY_MASK; in zram_set_priority()
168 zram->table[index].flags |= (prio << ZRAM_COMP_PRIORITY_BIT1); in zram_set_priority()
173 u32 prio = zram->table[index].flags >> ZRAM_COMP_PRIORITY_BIT1; in zram_get_priority() local
175 return prio & ZRAM_COMP_PRIORITY_MASK; in zram_get_priority()
947 static void comp_algorithm_set(struct zram *zram, u32 prio, const char *alg) in comp_algorithm_set() argument
950 if (zram->comp_algs[prio] != default_compressor) in comp_algorithm_set()
951 kfree(zram->comp_algs[prio]); in comp_algorithm_set()
953 zram->comp_algs[prio] = alg; in comp_algorithm_set()
956 static ssize_t __comp_algorithm_show(struct zram *zram, u32 prio, char *buf) in __comp_algorithm_show() argument
961 sz = zcomp_available_show(zram->comp_algs[prio], buf); in __comp_algorithm_show()
967 static int __comp_algorithm_store(struct zram *zram, u32 prio, const char *buf) in __comp_algorithm_store() argument
997 comp_algorithm_set(zram, prio, compressor); in __comp_algorithm_store()
1002 static void comp_params_reset(struct zram *zram, u32 prio) in comp_params_reset() argument
1004 struct zcomp_params *params = &zram->params[prio]; in comp_params_reset()
1012 static int comp_params_store(struct zram *zram, u32 prio, s32 level, in comp_params_store() argument
1017 comp_params_reset(zram, prio); in comp_params_store()
1021 &zram->params[prio].dict, in comp_params_store()
1029 zram->params[prio].dict_sz = sz; in comp_params_store()
1030 zram->params[prio].level = level; in comp_params_store()
1039 s32 prio = ZRAM_PRIMARY_COMP, level = ZCOMP_PARAM_NO_LEVEL; in algorithm_params_store() local
1052 ret = kstrtoint(val, 10, &prio); in algorithm_params_store()
1080 prio = -EINVAL; in algorithm_params_store()
1086 prio = p; in algorithm_params_store()
1092 if (prio < ZRAM_PRIMARY_COMP || prio >= ZRAM_MAX_COMPS) in algorithm_params_store()
1095 ret = comp_params_store(zram, prio, level, dict_path); in algorithm_params_store()
1127 u32 prio; in recomp_algorithm_show() local
1129 for (prio = ZRAM_SECONDARY_COMP; prio < ZRAM_MAX_COMPS; prio++) { in recomp_algorithm_show()
1130 if (!zram->comp_algs[prio]) in recomp_algorithm_show()
1133 sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2, "#%d: ", prio); in recomp_algorithm_show()
1134 sz += __comp_algorithm_show(zram, prio, buf + sz); in recomp_algorithm_show()
1146 int prio = ZRAM_SECONDARY_COMP; in recomp_algorithm_store() local
1164 ret = kstrtoint(val, 10, &prio); in recomp_algorithm_store()
1174 if (prio < ZRAM_SECONDARY_COMP || prio >= ZRAM_MAX_COMPS) in recomp_algorithm_store()
1177 ret = __comp_algorithm_store(zram, prio, alg); in recomp_algorithm_store()
1401 u32 prio; in zram_read_from_zspool() local
1419 prio = zram_get_priority(zram, index); in zram_read_from_zspool()
1420 zstrm = zcomp_stream_get(zram->comps[prio]); in zram_read_from_zspool()
1431 ret = zcomp_decompress(zram->comps[prio], zstrm, in zram_read_from_zspool()
1434 zcomp_stream_put(zram->comps[prio]); in zram_read_from_zspool()
1659 u64 *num_recomp_pages, u32 threshold, u32 prio, in zram_recompress() argument
1693 for (; prio < prio_max; prio++) { in zram_recompress()
1694 if (!zram->comps[prio]) in zram_recompress()
1701 if (prio <= zram_get_priority(zram, index)) in zram_recompress()
1705 zstrm = zcomp_stream_get(zram->comps[prio]); in zram_recompress()
1707 ret = zcomp_compress(zram->comps[prio], zstrm, in zram_recompress()
1712 zcomp_stream_put(zram->comps[prio]); in zram_recompress()
1722 zcomp_stream_put(zram->comps[prio]); in zram_recompress()
1780 zcomp_stream_put(zram->comps[prio]); in zram_recompress()
1786 zcomp_stream_put(zram->comps[prio]); in zram_recompress()
1793 zram_set_priority(zram, index, prio); in zram_recompress()
1808 u32 prio = ZRAM_SECONDARY_COMP, prio_max = ZRAM_MAX_COMPS; in recompress_store() local
1863 ret = kstrtouint(val, 10, &prio); in recompress_store()
1867 if (prio == ZRAM_PRIMARY_COMP) in recompress_store()
1868 prio = ZRAM_SECONDARY_COMP; in recompress_store()
1870 prio_max = min(prio + 1, ZRAM_MAX_COMPS); in recompress_store()
1887 for (; prio < ZRAM_MAX_COMPS; prio++) { in recompress_store()
1888 if (!zram->comp_algs[prio]) in recompress_store()
1891 if (!strcmp(zram->comp_algs[prio], algo)) { in recompress_store()
1892 prio_max = min(prio + 1, ZRAM_MAX_COMPS); in recompress_store()
1937 threshold, prio, prio_max); in recompress_store()
2097 u32 prio; in zram_comp_params_reset() local
2099 for (prio = ZRAM_PRIMARY_COMP; prio < ZRAM_MAX_COMPS; prio++) { in zram_comp_params_reset()
2100 comp_params_reset(zram, prio); in zram_comp_params_reset()
2106 u32 prio; in zram_destroy_comps() local
2108 for (prio = 0; prio < ZRAM_MAX_COMPS; prio++) { in zram_destroy_comps()
2109 struct zcomp *comp = zram->comps[prio]; in zram_destroy_comps()
2111 zram->comps[prio] = NULL; in zram_destroy_comps()
2118 for (prio = ZRAM_PRIMARY_COMP; prio < ZRAM_MAX_COMPS; prio++) { in zram_destroy_comps()
2120 if (zram->comp_algs[prio] != default_compressor) in zram_destroy_comps()
2121 kfree(zram->comp_algs[prio]); in zram_destroy_comps()
2122 zram->comp_algs[prio] = NULL; in zram_destroy_comps()
2160 u32 prio; in disksize_store() local
2179 for (prio = 0; prio < ZRAM_MAX_COMPS; prio++) { in disksize_store()
2180 if (!zram->comp_algs[prio]) in disksize_store()
2183 comp = zcomp_create(zram->comp_algs[prio], in disksize_store()
2184 &zram->params[prio]); in disksize_store()
2187 zram->comp_algs[prio]); in disksize_store()
2192 zram->comps[prio] = comp; in disksize_store()