Commit d55bc7ba authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman

staging: erofs: staticize erofs_shrink_count, erofs_shrink_scan

Move erofs_shrinker_info to utils.c and therefore
no need to globalize erofs_shrink_count and erofs_shrink_scan.
Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4501ca36
...@@ -589,10 +589,7 @@ extern struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp); ...@@ -589,10 +589,7 @@ extern struct page *erofs_allocpage(struct list_head *pool, gfp_t gfp);
extern void erofs_register_super(struct super_block *sb); extern void erofs_register_super(struct super_block *sb);
extern void erofs_unregister_super(struct super_block *sb); extern void erofs_unregister_super(struct super_block *sb);
extern unsigned long erofs_shrink_count(struct shrinker *shrink, extern struct shrinker erofs_shrinker_info;
struct shrink_control *sc);
extern unsigned long erofs_shrink_scan(struct shrinker *shrink,
struct shrink_control *sc);
#ifndef lru_to_page #ifndef lru_to_page
#define lru_to_page(head) (list_entry((head)->prev, struct page, lru)) #define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
......
...@@ -539,12 +539,6 @@ static void erofs_kill_sb(struct super_block *sb) ...@@ -539,12 +539,6 @@ static void erofs_kill_sb(struct super_block *sb)
kill_block_super(sb); kill_block_super(sb);
} }
static struct shrinker erofs_shrinker_info = {
.scan_objects = erofs_shrink_scan,
.count_objects = erofs_shrink_count,
.seeks = DEFAULT_SEEKS,
};
static struct file_system_type erofs_fs_type = { static struct file_system_type erofs_fs_type = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "erofs", .name = "erofs",
......
...@@ -270,14 +270,14 @@ void erofs_unregister_super(struct super_block *sb) ...@@ -270,14 +270,14 @@ void erofs_unregister_super(struct super_block *sb)
spin_unlock(&erofs_sb_list_lock); spin_unlock(&erofs_sb_list_lock);
} }
unsigned long erofs_shrink_count(struct shrinker *shrink, static unsigned long erofs_shrink_count(struct shrinker *shrink,
struct shrink_control *sc) struct shrink_control *sc)
{ {
return atomic_long_read(&erofs_global_shrink_cnt); return atomic_long_read(&erofs_global_shrink_cnt);
} }
unsigned long erofs_shrink_scan(struct shrinker *shrink, static unsigned long erofs_shrink_scan(struct shrinker *shrink,
struct shrink_control *sc) struct shrink_control *sc)
{ {
struct erofs_sb_info *sbi; struct erofs_sb_info *sbi;
struct list_head *p; struct list_head *p;
...@@ -333,3 +333,9 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink, ...@@ -333,3 +333,9 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink,
return freed; return freed;
} }
struct shrinker erofs_shrinker_info = {
.scan_objects = erofs_shrink_scan,
.count_objects = erofs_shrink_count,
.seeks = DEFAULT_SEEKS,
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment