mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
mm/damon/sysfs: do not directly access damon_ctx->ops
damon_ctx->ops field is intended to be used by only the DAMON core layer. DAMON_SYSFS is directly reading the field to find if it is for physical address monitoring, though. Use the API function for the purpose, damon_target_has_pid(), instead. Link: https://lore.kernel.org/20260714143544.101305-10-sj@kernel.org Signed-off-by: SJ Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
6a0c38aba6
commit
131c20823e
|
|
@ -2051,7 +2051,7 @@ static int damon_sysfs_add_targets(struct damon_ctx *ctx,
|
|||
int i, err;
|
||||
|
||||
/* Multiple physical address space monitoring targets makes no sense */
|
||||
if (ctx->ops.id == DAMON_OPS_PADDR && sysfs_targets->nr > 1)
|
||||
if (!damon_target_has_pid(ctx) && sysfs_targets->nr > 1)
|
||||
return -EINVAL;
|
||||
|
||||
for (i = 0; i < sysfs_targets->nr; i++) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user