summaryrefslogtreecommitdiffstats
path: root/drivers/staging/erofs/utils.c
diff options
context:
space:
mode:
authorGao Xiang2019-01-16 09:59:55 +0100
committerGreg Kroah-Hartman2019-01-18 10:37:16 +0100
commitd55bc7ba6bee8950d036089a0d6cb8cb71ff2913 (patch)
treef3e8c293df8bcc23bda584983d10f5bf08fa2cc8 /drivers/staging/erofs/utils.c
parentstaging: erofs: move shrink accounting inside the function (diff)
downloadkernel-qcow2-linux-d55bc7ba6bee8950d036089a0d6cb8cb71ff2913.tar.gz
kernel-qcow2-linux-d55bc7ba6bee8950d036089a0d6cb8cb71ff2913.tar.xz
kernel-qcow2-linux-d55bc7ba6bee8950d036089a0d6cb8cb71ff2913.zip
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: Gao Xiang <gaoxiang25@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/erofs/utils.c')
-rw-r--r--drivers/staging/erofs/utils.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index 5695efaeb43a..5f61f99f4c10 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -270,14 +270,14 @@ void erofs_unregister_super(struct super_block *sb)
spin_unlock(&erofs_sb_list_lock);
}
-unsigned long erofs_shrink_count(struct shrinker *shrink,
- struct shrink_control *sc)
+static unsigned long erofs_shrink_count(struct shrinker *shrink,
+ struct shrink_control *sc)
{
return atomic_long_read(&erofs_global_shrink_cnt);
}
-unsigned long erofs_shrink_scan(struct shrinker *shrink,
- struct shrink_control *sc)
+static unsigned long erofs_shrink_scan(struct shrinker *shrink,
+ struct shrink_control *sc)
{
struct erofs_sb_info *sbi;
struct list_head *p;
@@ -333,3 +333,9 @@ unsigned long erofs_shrink_scan(struct shrinker *shrink,
return freed;
}
+struct shrinker erofs_shrinker_info = {
+ .scan_objects = erofs_shrink_scan,
+ .count_objects = erofs_shrink_count,
+ .seeks = DEFAULT_SEEKS,
+};
+