Skip to contentSkip to conversation

erofs: move erofs_{allocpage,release_pages}() under CONFIG_EROFS_FS_ZIP

PATCH In review Yue Hu 2 participants 2 messages May 19, 2023 EROFS file system

lore
Share & tools
lore

Yue Hu

author reviewer
#0 lore raw

PATCH 1/1 erofs: move erofs_{allocpage,release_pages}() under CONFIG_EROFS_FS_ZIP

From: Yue Hu <[email protected]>

These two functions are only used for compression side now. Also, eliminate unused pagevec.h inclusion.

---
 fs/erofs/Makefile | 4 ++--
 fs/erofs/utils.c  | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)
fs/erofs/Makefile +2 -2
index a3a98fc3e481..1b1c3e3127cd 100644
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
 obj-$(CONFIG_EROFS_FS) += erofs.o
-erofs-objs := super.o inode.o data.o namei.o dir.o utils.o sysfs.o
+erofs-objs := super.o inode.o data.o namei.o dir.o sysfs.o
 erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
-erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
+erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o utils.o pcpubuf.o
 erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
 erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o
fs/erofs/utils.c +0 -3
index 46627cb69abe..72ba7daba33c 100644
@@ -4,7 +4,6 @@
  *             https://www.huawei.com/
  */
 #include "internal.h"
-#include <linux/pagevec.h>
 
 struct page *erofs_allocpage(struct page **pagepool, gfp_t gfp)
 {
@@ -29,7 +28,6 @@ void erofs_release_pages(struct page **pagepool)
 	}
 }
 
-#ifdef CONFIG_EROFS_FS_ZIP
 /* global shrink count (for all mounted EROFS instances) */
 static atomic_long_t erofs_global_shrink_cnt;
 
@@ -289,4 +287,3 @@ void erofs_exit_shrinker(void)
 {
 	unregister_shrinker(&erofs_shrinker_info);
 }
-#endif	/* !CONFIG_EROFS_FS_ZIP */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Yue Hu

From: Yue Hu <[email protected]>

These two functions are only used for compression side now. Also, eliminate unused pagevec.h inclusion.

That seems unnecessary since utils.c shouldn't be included with some inner Kconfig.

BTW, I'm now cleanup such stuffs for folios as well.

Thanks,
Gao Xiang