Lines Matching full:contexts
810 * contexts directory
824 static void damon_sysfs_contexts_rm_dirs(struct damon_sysfs_contexts *contexts) in damon_sysfs_contexts_rm_dirs() argument
826 struct damon_sysfs_context **contexts_arr = contexts->contexts_arr; in damon_sysfs_contexts_rm_dirs()
829 for (i = 0; i < contexts->nr; i++) { in damon_sysfs_contexts_rm_dirs()
833 contexts->nr = 0; in damon_sysfs_contexts_rm_dirs()
835 contexts->contexts_arr = NULL; in damon_sysfs_contexts_rm_dirs()
838 static int damon_sysfs_contexts_add_dirs(struct damon_sysfs_contexts *contexts, in damon_sysfs_contexts_add_dirs() argument
844 damon_sysfs_contexts_rm_dirs(contexts); in damon_sysfs_contexts_add_dirs()
852 contexts->contexts_arr = contexts_arr; in damon_sysfs_contexts_add_dirs()
857 damon_sysfs_contexts_rm_dirs(contexts); in damon_sysfs_contexts_add_dirs()
862 &damon_sysfs_context_ktype, &contexts->kobj, in damon_sysfs_contexts_add_dirs()
872 contexts->nr++; in damon_sysfs_contexts_add_dirs()
877 damon_sysfs_contexts_rm_dirs(contexts); in damon_sysfs_contexts_add_dirs()
885 struct damon_sysfs_contexts *contexts = container_of(kobj, in nr_contexts_show() local
888 return sysfs_emit(buf, "%d\n", contexts->nr); in nr_contexts_show()
894 struct damon_sysfs_contexts *contexts; in nr_contexts_store() local
900 /* TODO: support multiple contexts per kdamond */ in nr_contexts_store()
904 contexts = container_of(kobj, struct damon_sysfs_contexts, kobj); in nr_contexts_store()
907 err = damon_sysfs_contexts_add_dirs(contexts, nr); in nr_contexts_store()
941 struct damon_sysfs_contexts *contexts; member
952 struct damon_sysfs_contexts *contexts; in damon_sysfs_kdamond_add_dirs() local
955 contexts = damon_sysfs_contexts_alloc(); in damon_sysfs_kdamond_add_dirs()
956 if (!contexts) in damon_sysfs_kdamond_add_dirs()
959 err = kobject_init_and_add(&contexts->kobj, in damon_sysfs_kdamond_add_dirs()
961 "contexts"); in damon_sysfs_kdamond_add_dirs()
963 kobject_put(&contexts->kobj); in damon_sysfs_kdamond_add_dirs()
966 kdamond->contexts = contexts; in damon_sysfs_kdamond_add_dirs()
973 damon_sysfs_contexts_rm_dirs(kdamond->contexts); in damon_sysfs_kdamond_rm_dirs()
974 kobject_put(&kdamond->contexts->kobj); in damon_sysfs_kdamond_rm_dirs()
1222 * contexts-internal data and DAMON sysfs variables.
1231 kdamond->contexts->contexts_arr[0]->schemes, ctx); in damon_sysfs_upd_schemes_stats()
1243 kdamond->contexts->contexts_arr[0]->schemes, ctx, in damon_sysfs_upd_schemes_regions_start()
1265 kdamond->contexts->contexts_arr[0]->schemes, ctx); in damon_sysfs_clear_schemes_regions()
1308 /* TODO: Support multiple contexts per kdamond */ in damon_sysfs_commit_input()
1309 if (kdamond->contexts->nr != 1) in damon_sysfs_commit_input()
1312 param_ctx = damon_sysfs_build_ctx(kdamond->contexts->contexts_arr[0]); in damon_sysfs_commit_input()
1329 /* TODO: Support multiple contexts per kdamond */ in damon_sysfs_commit_schemes_quota_goals()
1330 if (sysfs_kdamond->contexts->nr != 1) in damon_sysfs_commit_schemes_quota_goals()
1334 sysfs_ctx = sysfs_kdamond->contexts->contexts_arr[0]; in damon_sysfs_commit_schemes_quota_goals()
1346 * DAMON contexts-internal data and DAMON sysfs variables.
1356 kdamond->contexts->contexts_arr[0]->schemes, ctx); in damon_sysfs_upd_schemes_effective_quotas()
1496 /* TODO: support multiple contexts per kdamond */ in damon_sysfs_turn_damon_on()
1497 if (kdamond->contexts->nr != 1) in damon_sysfs_turn_damon_on()
1504 ctx = damon_sysfs_build_ctx(kdamond->contexts->contexts_arr[0]); in damon_sysfs_turn_damon_on()