Lines Matching refs:schemes
963 static void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes) in damon_sysfs_schemes_rm_dirs() argument
965 struct damon_sysfs_scheme **schemes_arr = schemes->schemes_arr; in damon_sysfs_schemes_rm_dirs()
968 for (i = 0; i < schemes->nr; i++) { in damon_sysfs_schemes_rm_dirs()
972 schemes->nr = 0; in damon_sysfs_schemes_rm_dirs()
974 schemes->schemes_arr = NULL; in damon_sysfs_schemes_rm_dirs()
977 static int damon_sysfs_schemes_add_dirs(struct damon_sysfs_schemes *schemes, in damon_sysfs_schemes_add_dirs() argument
983 damon_sysfs_schemes_rm_dirs(schemes); in damon_sysfs_schemes_add_dirs()
991 schemes->schemes_arr = schemes_arr; in damon_sysfs_schemes_add_dirs()
996 damon_sysfs_schemes_rm_dirs(schemes); in damon_sysfs_schemes_add_dirs()
1001 &damon_sysfs_scheme_ktype, &schemes->kobj, in damon_sysfs_schemes_add_dirs()
1010 schemes->nr++; in damon_sysfs_schemes_add_dirs()
1015 damon_sysfs_schemes_rm_dirs(schemes); in damon_sysfs_schemes_add_dirs()
1023 struct damon_sysfs_schemes *schemes = container_of(kobj, in nr_schemes_show() local
1026 return sysfs_emit(buf, "%d\n", schemes->nr); in nr_schemes_show()
1032 struct damon_sysfs_schemes *schemes = container_of(kobj, in nr_schemes_store() local
1043 err = damon_sysfs_schemes_add_dirs(schemes, nr); in nr_schemes_store()
1706 struct damon_sysfs_schemes *schemes; member
1763 struct damon_sysfs_schemes *schemes = damon_sysfs_schemes_alloc(); in damon_sysfs_context_set_schemes() local
1766 if (!schemes) in damon_sysfs_context_set_schemes()
1768 err = kobject_init_and_add(&schemes->kobj, &damon_sysfs_schemes_ktype, in damon_sysfs_context_set_schemes()
1771 kobject_put(&schemes->kobj); in damon_sysfs_context_set_schemes()
1774 context->schemes = schemes; in damon_sysfs_context_set_schemes()
1810 damon_sysfs_schemes_rm_dirs(context->schemes); in damon_sysfs_context_rm_dirs()
1811 kobject_put(&context->schemes->kobj); in damon_sysfs_context_rm_dirs()
2341 sysfs_schemes = kdamond->contexts->contexts_arr[0]->schemes; in damon_sysfs_upd_schemes_stats()
2391 err = damon_sysfs_set_schemes(ctx, sys_ctx->schemes); in damon_sysfs_commit_input()
2450 err = damon_sysfs_set_schemes(ctx, sys_ctx->schemes); in damon_sysfs_build_ctx()