UPSTREAM: 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> (cherry picked from commit c8e7b4d0ba348a8ef14956a80c780f152f433764) Bug: 300502883 Change-Id: I3a8f63dc4f6de6f4662b6f1a7d12afe1e25b36d2 Signed-off-by: cui yangpei <cuiyangpei@xiaomi.com>
This commit is contained in:
parent
0b17df8a4f
commit
67ef7b0f42
4 changed files with 1091 additions and 1065 deletions
|
|
@ -3,7 +3,7 @@
|
|||
obj-y := core.o
|
||||
obj-$(CONFIG_DAMON_VADDR) += ops-common.o vaddr.o
|
||||
obj-$(CONFIG_DAMON_PADDR) += ops-common.o paddr.o
|
||||
obj-$(CONFIG_DAMON_SYSFS) += sysfs-common.o sysfs.o
|
||||
obj-$(CONFIG_DAMON_SYSFS) += sysfs-common.o sysfs-schemes.o sysfs.o
|
||||
obj-$(CONFIG_DAMON_DBGFS) += dbgfs.o
|
||||
obj-$(CONFIG_DAMON_RECLAIM) += reclaim.o
|
||||
obj-$(CONFIG_DAMON_LRU_SORT) += lru_sort.o
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
1068
mm/damon/sysfs-schemes.c
Normal file
1068
mm/damon/sysfs-schemes.c
Normal file
File diff suppressed because it is too large
Load diff
1064
mm/damon/sysfs.c
1064
mm/damon/sysfs.c
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue