mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
My legal and preferred first names are SeongJae and SJ, respectively. I was using the legal name for commits and tags, while using the preferred name for conversations. It sometimes confuses people including myself. Consistently use the preferred name. Together remove copyright notes on files. Those are only confusing for people who are not familiar with the law. Meanwhile, we can infer the information in a better way from git logs and public information. Link: https://lore.kernel.org/[email protected] Signed-off-by: SJ Park <[email protected]> Acked-by: Lorenzo Stoakes <[email protected]> Acked-by: David Hildenbrand (Arm) <[email protected]> Cc: Liam R. Howlett <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Suren Baghdasaryan <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
41 lines
824 B
C
41 lines
824 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
/*
|
|
* Common Code for DAMON Modules
|
|
*/
|
|
|
|
#include <linux/damon.h>
|
|
|
|
#include "modules-common.h"
|
|
|
|
/*
|
|
* Allocate, set, and return a DAMON context for the physical address space.
|
|
* @ctxp: Pointer to save the point to the newly created context
|
|
* @targetp: Pointer to save the point to the newly created target
|
|
*/
|
|
int damon_modules_new_paddr_ctx_target(struct damon_ctx **ctxp,
|
|
struct damon_target **targetp)
|
|
{
|
|
struct damon_ctx *ctx;
|
|
struct damon_target *target;
|
|
|
|
ctx = damon_new_ctx();
|
|
if (!ctx)
|
|
return -ENOMEM;
|
|
|
|
if (damon_select_ops(ctx, DAMON_OPS_PADDR)) {
|
|
damon_destroy_ctx(ctx);
|
|
return -EINVAL;
|
|
}
|
|
|
|
target = damon_new_target();
|
|
if (!target) {
|
|
damon_destroy_ctx(ctx);
|
|
return -ENOMEM;
|
|
}
|
|
damon_add_target(ctx, target);
|
|
|
|
*ctxp = ctx;
|
|
*targetp = target;
|
|
return 0;
|
|
}
|