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>
This commit is contained in:
parent
4acd715ff5
commit
c8e7b4d0ba
@ -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…
Reference in New Issue
Block a user