mm/damon/sysfs-schemes: rename *_set_{schemes,scheme_filters,quota_score,schemes}()

The functions were for updating DAMON structs that may or may not be
partially populated.  Hence it was not for only adding items, but also
removing unnecessary items and updating items in-place.  A previous commit
has changed the functions to assume the structs are not partially
populated, and do only adding items.  Make the names better explain the
behavior.

Link: https://lkml.kernel.org/r/20240618181809.82078-9-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SeongJae Park 2024-06-18 11:18:05 -07:00 committed by Andrew Morton
parent 0fddd60476
commit a83364a216
3 changed files with 8 additions and 8 deletions

View File

@ -38,7 +38,7 @@ void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes);
extern const struct kobj_type damon_sysfs_schemes_ktype; extern const struct kobj_type damon_sysfs_schemes_ktype;
int damon_sysfs_set_schemes(struct damon_ctx *ctx, int damon_sysfs_add_schemes(struct damon_ctx *ctx,
struct damon_sysfs_schemes *sysfs_schemes); struct damon_sysfs_schemes *sysfs_schemes);
void damon_sysfs_schemes_update_stats( void damon_sysfs_schemes_update_stats(

View File

@ -1908,7 +1908,7 @@ static int damon_sysfs_memcg_path_to_id(char *memcg_path, unsigned short *id)
return found ? 0 : -EINVAL; return found ? 0 : -EINVAL;
} }
static int damon_sysfs_set_scheme_filters(struct damos *scheme, static int damon_sysfs_add_scheme_filters(struct damos *scheme,
struct damon_sysfs_scheme_filters *sysfs_filters) struct damon_sysfs_scheme_filters *sysfs_filters)
{ {
int i; int i;
@ -1947,7 +1947,7 @@ static int damon_sysfs_set_scheme_filters(struct damos *scheme,
return 0; return 0;
} }
static int damos_sysfs_set_quota_score( static int damos_sysfs_add_quota_score(
struct damos_sysfs_quota_goals *sysfs_goals, struct damos_sysfs_quota_goals *sysfs_goals,
struct damos_quota *quota) struct damos_quota *quota)
{ {
@ -1990,7 +1990,7 @@ int damos_sysfs_set_quota_scores(struct damon_sysfs_schemes *sysfs_schemes,
break; break;
sysfs_scheme = sysfs_schemes->schemes_arr[i]; sysfs_scheme = sysfs_schemes->schemes_arr[i];
err = damos_sysfs_set_quota_score(sysfs_scheme->quotas->goals, err = damos_sysfs_add_quota_score(sysfs_scheme->quotas->goals,
&quota); &quota);
if (err) { if (err) {
damos_for_each_quota_goal_safe(g, g_next, &quota) damos_for_each_quota_goal_safe(g, g_next, &quota)
@ -2070,13 +2070,13 @@ static struct damos *damon_sysfs_mk_scheme(
if (!scheme) if (!scheme)
return NULL; return NULL;
err = damos_sysfs_set_quota_score(sysfs_quotas->goals, &scheme->quota); err = damos_sysfs_add_quota_score(sysfs_quotas->goals, &scheme->quota);
if (err) { if (err) {
damon_destroy_scheme(scheme); damon_destroy_scheme(scheme);
return NULL; return NULL;
} }
err = damon_sysfs_set_scheme_filters(scheme, sysfs_filters); err = damon_sysfs_add_scheme_filters(scheme, sysfs_filters);
if (err) { if (err) {
damon_destroy_scheme(scheme); damon_destroy_scheme(scheme);
return NULL; return NULL;
@ -2084,7 +2084,7 @@ static struct damos *damon_sysfs_mk_scheme(
return scheme; return scheme;
} }
int damon_sysfs_set_schemes(struct damon_ctx *ctx, int damon_sysfs_add_schemes(struct damon_ctx *ctx,
struct damon_sysfs_schemes *sysfs_schemes) struct damon_sysfs_schemes *sysfs_schemes)
{ {
int i; int i;

View File

@ -1286,7 +1286,7 @@ static int damon_sysfs_apply_inputs(struct damon_ctx *ctx,
err = damon_sysfs_add_targets(ctx, sys_ctx->targets); err = damon_sysfs_add_targets(ctx, sys_ctx->targets);
if (err) if (err)
return err; return err;
return damon_sysfs_set_schemes(ctx, sys_ctx->schemes); return damon_sysfs_add_schemes(ctx, sys_ctx->schemes);
} }
static struct damon_ctx *damon_sysfs_build_ctx( static struct damon_ctx *damon_sysfs_build_ctx(