[PATCH v4 01/48] mm: move some shrinker-related function declarations to mm/internal.h
Muchun Song
muchun.song at linux.dev
Tue Aug 15 01:36:31 PDT 2023
> On Aug 7, 2023, at 19:08, Qi Zheng <zhengqi.arch at bytedance.com> wrote:
>
> The following functions are only used inside the mm subsystem, so it's
> better to move their declarations to the mm/internal.h file.
>
> 1. shrinker_debugfs_add()
> 2. shrinker_debugfs_detach()
> 3. shrinker_debugfs_remove()
>
> Signed-off-by: Qi Zheng <zhengqi.arch at bytedance.com>
Reviewed-by: Muchun Song <songmuchun at bytedance.com>
One nit bellow.
[...]
> +
> +/*
> + * shrinker related functions
> + */
This is a multi-comment format. "/* shrinker related functions. */" is
the right one-line format of comment.
> +
> +#ifdef CONFIG_SHRINKER_DEBUG
> +extern int shrinker_debugfs_add(struct shrinker *shrinker);
> +extern struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
> + int *debugfs_id);
> +extern void shrinker_debugfs_remove(struct dentry *debugfs_entry,
> + int debugfs_id);
> +#else /* CONFIG_SHRINKER_DEBUG */
> +static inline int shrinker_debugfs_add(struct shrinker *shrinker)
> +{
> + return 0;
> +}
> +static inline struct dentry *shrinker_debugfs_detach(struct shrinker *shrinker,
> + int *debugfs_id)
> +{
> + *debugfs_id = -1;
> + return NULL;
> +}
> +static inline void shrinker_debugfs_remove(struct dentry *debugfs_entry,
> + int debugfs_id)
> +{
> +}
> +#endif /* CONFIG_SHRINKER_DEBUG */
> +
> #endif /* __MM_INTERNAL_H */
> --
> 2.30.2
>
More information about the linux-mtd
mailing list