a45dff567c
The implementation of unsigned long type range directories can be reused by multiple DAMON sysfs directories including those for DAMON-based Operation Schemes and the range of number of monitoring regions. Move the code into the files for DAMON sysfs common logics. Link: https://lkml.kernel.org/r/20221026225943.100429-9-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit d332fe11debe69fee3de4c2d84fa0b6649678ad2) Bug: 300502883 Change-Id: I35f23cb5070fb3fb62a52fd2652e7f054d019201 Signed-off-by: cui yangpei <cuiyangpei@xiaomi.com>
25 lines
536 B
C
25 lines
536 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Common Primitives for DAMON Sysfs Interface
|
|
*
|
|
* Author: SeongJae Park <sj@kernel.org>
|
|
*/
|
|
|
|
#include <linux/damon.h>
|
|
#include <linux/kobject.h>
|
|
|
|
extern struct mutex damon_sysfs_lock;
|
|
|
|
struct damon_sysfs_ul_range {
|
|
struct kobject kobj;
|
|
unsigned long min;
|
|
unsigned long max;
|
|
};
|
|
|
|
struct damon_sysfs_ul_range *damon_sysfs_ul_range_alloc(
|
|
unsigned long min,
|
|
unsigned long max);
|
|
void damon_sysfs_ul_range_release(struct kobject *kobj);
|
|
|
|
extern struct kobj_type damon_sysfs_ul_range_ktype;
|