Lines Matching refs:targets
287 * targets directory
301 static void damon_sysfs_targets_rm_dirs(struct damon_sysfs_targets *targets)
303 struct damon_sysfs_target **targets_arr = targets->targets_arr;
306 for (i = 0; i < targets->nr; i++) {
310 targets->nr = 0;
312 targets->targets_arr = NULL;
315 static int damon_sysfs_targets_add_dirs(struct damon_sysfs_targets *targets,
321 damon_sysfs_targets_rm_dirs(targets);
329 targets->targets_arr = targets_arr;
334 damon_sysfs_targets_rm_dirs(targets);
339 &damon_sysfs_target_ktype, &targets->kobj,
349 targets->nr++;
354 damon_sysfs_targets_rm_dirs(targets);
362 struct damon_sysfs_targets *targets = container_of(kobj,
365 return sysfs_emit(buf, "%d\n", targets->nr);
371 struct damon_sysfs_targets *targets;
379 targets = container_of(kobj, struct damon_sysfs_targets, kobj);
383 err = damon_sysfs_targets_add_dirs(targets, nr);
636 struct damon_sysfs_targets *targets;
677 struct damon_sysfs_targets *targets = damon_sysfs_targets_alloc();
680 if (!targets)
682 err = kobject_init_and_add(&targets->kobj, &damon_sysfs_targets_ktype,
683 &context->kobj, "targets");
685 kobject_put(&targets->kobj);
688 context->targets = targets;
727 kobject_put(&context->targets->kobj);
728 context->targets = NULL;
739 damon_sysfs_targets_rm_dirs(context->targets);
740 kobject_put(&context->targets->kobj);
1212 /* Multiple physical address space monitoring targets makes no sense */
1342 err = damon_sysfs_set_targets(ctx, sys_ctx->targets);