]> git.baikalelectronics.ru Git - kernel.git/commit
mm/damon/sysfs: simplify the judgement whether kdamonds are busy
authorKaixu Xia <kaixuxia@tencent.com>
Sun, 4 Sep 2022 14:36:06 +0000 (22:36 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:02:55 +0000 (14:02 -0700)
commitfbf6f1b2a7e90e09168ffd3c0b753e0093a804e2
tree298c62113b0ebd584df8ac9d1b6d3e2dc31cb524
parentc60a9895c0d907882651aca686fe4c695393944c
mm/damon/sysfs: simplify the judgement whether kdamonds are busy

It is unnecessary to get the number of the running kdamond to judge
whether kdamonds are busy.  Here we can use the
damon_sysfs_kdamond_running() helper and return -EBUSY directly when
finding a running kdamond.  Meanwhile, merging with the judgement that a
kdamond has current sysfs command callback request to make the code more
clear.

Link: https://lkml.kernel.org/r/1662302166-13216-1-git-send-email-kaixuxia@tencent.com
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs.c