Skip to content

Commit 4a20865

Browse files
sjp38torvalds
authored andcommitted
mm/damon/dbgfs: use operations id for knowing if the target has pid
DAMON debugfs interface depends on monitoring operations for virtual address spaces because it knows if the target has pid or not by seeing if the context is configured to use one of the virtual address space monitoring operation functions. We can replace that check with 'enum damon_ops_id' now, to make it independent. This commit makes the change. Link: https://lkml.kernel.org/r/20220215184603.1479-7-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Xin Hao <xhao@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent da7aaca commit 4a20865

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

mm/damon/dbgfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ static ssize_t dbgfs_schemes_write(struct file *file, const char __user *buf,
277277

278278
static inline bool target_has_pid(const struct damon_ctx *ctx)
279279
{
280-
return ctx->ops.target_valid == damon_va_target_valid;
280+
return ctx->ops.id == DAMON_OPS_VADDR;
281281
}
282282

283283
static ssize_t sprint_target_ids(struct damon_ctx *ctx, char *buf, ssize_t len)
@@ -741,8 +741,8 @@ static struct damon_ctx *dbgfs_new_ctx(void)
741741
if (!ctx)
742742
return NULL;
743743

744-
if (damon_select_ops(ctx, DAMON_OPS_VADDR) && damon_select_ops(ctx,
745-
DAMON_OPS_PADDR)) {
744+
if (damon_select_ops(ctx, DAMON_OPS_VADDR) &&
745+
damon_select_ops(ctx, DAMON_OPS_PADDR)) {
746746
damon_destroy_ctx(ctx);
747747
return NULL;
748748
}

0 commit comments

Comments
 (0)