Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Gao Xiang and committed by
Greg Kroah-Hartman
d55bc7ba 4501ca36

+11 -14
+1 -4
drivers/staging/erofs/internal.h
··· 589 589 extern void erofs_register_super(struct super_block *sb); 590 590 extern void erofs_unregister_super(struct super_block *sb); 591 591 592 - extern unsigned long erofs_shrink_count(struct shrinker *shrink, 593 - struct shrink_control *sc); 594 - extern unsigned long erofs_shrink_scan(struct shrinker *shrink, 595 - struct shrink_control *sc); 592 + extern struct shrinker erofs_shrinker_info; 596 593 597 594 #ifndef lru_to_page 598 595 #define lru_to_page(head) (list_entry((head)->prev, struct page, lru))
-6
drivers/staging/erofs/super.c
··· 539 539 kill_block_super(sb); 540 540 } 541 541 542 - static struct shrinker erofs_shrinker_info = { 543 - .scan_objects = erofs_shrink_scan, 544 - .count_objects = erofs_shrink_count, 545 - .seeks = DEFAULT_SEEKS, 546 - }; 547 - 548 542 static struct file_system_type erofs_fs_type = { 549 543 .owner = THIS_MODULE, 550 544 .name = "erofs",
+10 -4
drivers/staging/erofs/utils.c
··· 270 270 spin_unlock(&erofs_sb_list_lock); 271 271 } 272 272 273 - unsigned long erofs_shrink_count(struct shrinker *shrink, 274 - struct shrink_control *sc) 273 + static unsigned long erofs_shrink_count(struct shrinker *shrink, 274 + struct shrink_control *sc) 275 275 { 276 276 return atomic_long_read(&erofs_global_shrink_cnt); 277 277 } 278 278 279 - unsigned long erofs_shrink_scan(struct shrinker *shrink, 280 - struct shrink_control *sc) 279 + static unsigned long erofs_shrink_scan(struct shrinker *shrink, 280 + struct shrink_control *sc) 281 281 { 282 282 struct erofs_sb_info *sbi; 283 283 struct list_head *p; ··· 332 332 spin_unlock(&erofs_sb_list_lock); 333 333 return freed; 334 334 } 335 + 336 + struct shrinker erofs_shrinker_info = { 337 + .scan_objects = erofs_shrink_scan, 338 + .count_objects = erofs_shrink_count, 339 + .seeks = DEFAULT_SEEKS, 340 + }; 335 341