summaryrefslogtreecommitdiff
path: root/mm/damon
diff options
context:
space:
mode:
authorKaixu Xia <kaixuxia@tencent.com>2022-09-12 18:11:53 +0300
committerAndrew Morton <akpm@linux-foundation.org>2022-10-04 00:03:09 +0300
commite7fcac4cd2674fe6849c6ac8a51a7fc878a5e436 (patch)
tree2faf025926775afc00b4f4deae27a467efb26e40 /mm/damon
parenta17a8b3b3e6b08a9cd3b2134789843323d998bed (diff)
downloadlinux-e7fcac4cd2674fe6849c6ac8a51a7fc878a5e436.tar.xz
mm/damon/sysfs: use the wrapper directly to check if the kdamond is running
We can use the 'damon_sysfs_kdamond_running()' wrapper directly to check if the kdamond is running in 'damon_sysfs_turn_damon_on()'. Link: https://lkml.kernel.org/r/1662995513-24489-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Reviewed-by: SeongJae Park <sj@kernel.org> Reviewed-by: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon')
-rw-r--r--mm/damon/sysfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index d27dad5affec..da01befae8bd 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2465,8 +2465,7 @@ static int damon_sysfs_turn_damon_on(struct damon_sysfs_kdamond *kdamond)
struct damon_ctx *ctx;
int err;
- if (kdamond->damon_ctx &&
- damon_sysfs_ctx_running(kdamond->damon_ctx))
+ if (damon_sysfs_kdamond_running(kdamond))
return -EBUSY;
if (damon_sysfs_cmd_request.kdamond == kdamond)
return -EBUSY;