Commit e7fcac4c authored by Kaixu Xia's avatar Kaixu Xia Committed by Andrew Morton
Browse files

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: default avatarKaixu Xia <kaixuxia@tencent.com>
Reviewed-by: default avatarSeongJae Park <sj@kernel.org>
Reviewed-by: default avatarMuchun Song <songmuchun@bytedance.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent a17a8b3b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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;