summaryrefslogtreecommitdiff
path: root/mm/damon/dbgfs.c
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-09-13 17:44:33 +0000
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:03:10 -0700
commitbead3b00088eb8016b32cafa7e0701b3283e68a4 (patch)
treea98c78ba2cc69a61f03493b998216d0a7bc5fc32 /mm/damon/dbgfs.c
parentcbeaa77b044938cfe91818821ece6b0b1511e967 (diff)
mm/damon/core: reduce parameters for damon_set_attrs()
Number of parameters for 'damon_set_attrs()' is six. As it could be confusing and verbose, this commit reduces the number by receiving single pointer to a 'struct damon_attrs'. Link: https://lkml.kernel.org/r/20220913174449.50645-7-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon/dbgfs.c')
-rw-r--r--mm/damon/dbgfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index 74e7542af6d3..c00eba4448d8 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -67,7 +67,7 @@ static ssize_t dbgfs_attrs_write(struct file *file,
const char __user *buf, size_t count, loff_t *ppos)
{
struct damon_ctx *ctx = file->private_data;
- unsigned long s, a, r, minr, maxr;
+ struct damon_attrs attrs;
char *kbuf;
ssize_t ret;
@@ -76,7 +76,10 @@ static ssize_t dbgfs_attrs_write(struct file *file,
return PTR_ERR(kbuf);
if (sscanf(kbuf, "%lu %lu %lu %lu %lu",
- &s, &a, &r, &minr, &maxr) != 5) {
+ &attrs.sample_interval, &attrs.aggr_interval,
+ &attrs.ops_update_interval,
+ &attrs.min_nr_regions,
+ &attrs.max_nr_regions) != 5) {
ret = -EINVAL;
goto out;
}
@@ -87,7 +90,7 @@ static ssize_t dbgfs_attrs_write(struct file *file,
goto unlock_out;
}
- ret = damon_set_attrs(ctx, s, a, r, minr, maxr);
+ ret = damon_set_attrs(ctx, &attrs);
if (!ret)
ret = count;
unlock_out: