summaryrefslogtreecommitdiff
path: root/mm/damon/sysfs-common.h
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-10-26 22:59:41 +0000
committerAndrew Morton <akpm@linux-foundation.org>2022-11-30 15:01:26 -0800
commitc8e7b4d0ba348a8ef14956a80c780f152f433764 (patch)
tree5fe07e05f53425f85e6ef02d0cfb9a0cc53918c4 /mm/damon/sysfs-common.h
parent4acd715ff57fd05a481c64d074db68f2cf5711aa (diff)
mm/damon/sysfs: split out schemes directory implementation to separate file
DAMON sysfs interface for 'schemes' directory is implemented using about one thousand lines of code. It has no strong dependency with other parts of its file, so split it out to another file for better code management. Link: https://lkml.kernel.org/r/20221026225943.100429-11-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon/sysfs-common.h')
-rw-r--r--mm/damon/sysfs-common.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/mm/damon/sysfs-common.h b/mm/damon/sysfs-common.h
index 56e6a99e353b..4626b2784404 100644
--- a/mm/damon/sysfs-common.h
+++ b/mm/damon/sysfs-common.h
@@ -22,3 +22,25 @@ struct damon_sysfs_ul_range *damon_sysfs_ul_range_alloc(
void damon_sysfs_ul_range_release(struct kobject *kobj);
extern struct kobj_type damon_sysfs_ul_range_ktype;
+
+/*
+ * schemes directory
+ */
+
+struct damon_sysfs_schemes {
+ struct kobject kobj;
+ struct damon_sysfs_scheme **schemes_arr;
+ int nr;
+};
+
+struct damon_sysfs_schemes *damon_sysfs_schemes_alloc(void);
+void damon_sysfs_schemes_rm_dirs(struct damon_sysfs_schemes *schemes);
+
+extern struct kobj_type damon_sysfs_schemes_ktype;
+
+int damon_sysfs_set_schemes(struct damon_ctx *ctx,
+ struct damon_sysfs_schemes *sysfs_schemes);
+
+void damon_sysfs_schemes_update_stats(
+ struct damon_sysfs_schemes *sysfs_schemes,
+ struct damon_ctx *ctx);