Skip to content

Commit 285d0f8

Browse files
taigerhuhsiangkao
authored andcommitted
erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off
The function of pcpubuf.c is just for low-latency decompression algorithms (e.g. lz4). Signed-off-by: Yue Hu <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent 0a17567 commit 285d0f8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

fs/erofs/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22

33
obj-$(CONFIG_EROFS_FS) += erofs.o
4-
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o pcpubuf.o sysfs.o
4+
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o sysfs.o
55
erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
6-
erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o
6+
erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
77
erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
88
erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o

fs/erofs/internal.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,6 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
472472
return NULL;
473473
}
474474

475-
void *erofs_get_pcpubuf(unsigned int requiredpages);
476-
void erofs_put_pcpubuf(void *ptr);
477-
int erofs_pcpubuf_growsize(unsigned int nrpages);
478-
void __init erofs_pcpubuf_init(void);
479-
void erofs_pcpubuf_exit(void);
480-
481475
int erofs_register_sysfs(struct super_block *sb);
482476
void erofs_unregister_sysfs(struct super_block *sb);
483477
int __init erofs_init_sysfs(void);
@@ -512,6 +506,11 @@ int z_erofs_load_lz4_config(struct super_block *sb,
512506
struct z_erofs_lz4_cfgs *lz4, int len);
513507
int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
514508
int flags);
509+
void *erofs_get_pcpubuf(unsigned int requiredpages);
510+
void erofs_put_pcpubuf(void *ptr);
511+
int erofs_pcpubuf_growsize(unsigned int nrpages);
512+
void __init erofs_pcpubuf_init(void);
513+
void erofs_pcpubuf_exit(void);
515514
#else
516515
static inline void erofs_shrinker_register(struct super_block *sb) {}
517516
static inline void erofs_shrinker_unregister(struct super_block *sb) {}
@@ -529,6 +528,8 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
529528
}
530529
return 0;
531530
}
531+
static inline void erofs_pcpubuf_init(void) {}
532+
static inline void erofs_pcpubuf_exit(void) {}
532533
#endif /* !CONFIG_EROFS_FS_ZIP */
533534

534535
#ifdef CONFIG_EROFS_FS_ZIP_LZMA

0 commit comments

Comments
 (0)