linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs: do not build pcpubuf.c for uncompressed data
@ 2023-04-27  3:03 Yue Hu
  2023-04-27  3:14 ` Gao Xiang
  0 siblings, 1 reply; 2+ messages in thread
From: Yue Hu @ 2023-04-27  3:03 UTC (permalink / raw)
  To: xiang, chao, linux-erofs; +Cc: huyue2, linux-kernel, zhangwen

From: Yue Hu <huyue2@coolpad.com>

The function of pcpubuf.c is just for low-latency decompression
algorithms (e.g. lz4).

Signed-off-by: Yue Hu <huyue2@coolpad.com>
---
 fs/erofs/Makefile   |  4 ++--
 fs/erofs/internal.h | 12 +++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/erofs/Makefile b/fs/erofs/Makefile
index 99bbc597a3e9..a3a98fc3e481 100644
--- a/fs/erofs/Makefile
+++ b/fs/erofs/Makefile
@@ -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 pcpubuf.o sysfs.o
+erofs-objs := super.o inode.o data.o namei.o dir.o utils.o sysfs.o
 erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
-erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o
+erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
 erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
 erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index af0431a40647..65dbfa76f854 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -472,11 +472,6 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
 	return NULL;
 }
 
-void *erofs_get_pcpubuf(unsigned int requiredpages);
-void erofs_put_pcpubuf(void *ptr);
-int erofs_pcpubuf_growsize(unsigned int nrpages);
-void __init erofs_pcpubuf_init(void);
-void erofs_pcpubuf_exit(void);
 
 int erofs_register_sysfs(struct super_block *sb);
 void erofs_unregister_sysfs(struct super_block *sb);
@@ -512,6 +507,11 @@ int z_erofs_load_lz4_config(struct super_block *sb,
 			    struct z_erofs_lz4_cfgs *lz4, int len);
 int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
 			    int flags);
+void *erofs_get_pcpubuf(unsigned int requiredpages);
+void erofs_put_pcpubuf(void *ptr);
+int erofs_pcpubuf_growsize(unsigned int nrpages);
+void __init erofs_pcpubuf_init(void);
+void erofs_pcpubuf_exit(void);
 #else
 static inline void erofs_shrinker_register(struct super_block *sb) {}
 static inline void erofs_shrinker_unregister(struct super_block *sb) {}
@@ -529,6 +529,8 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
 	}
 	return 0;
 }
+static inline void erofs_pcpubuf_init(void) {}
+static inline void erofs_pcpubuf_exit(void) {}
 #endif	/* !CONFIG_EROFS_FS_ZIP */
 
 #ifdef CONFIG_EROFS_FS_ZIP_LZMA
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] erofs: do not build pcpubuf.c for uncompressed data
  2023-04-27  3:03 [PATCH] erofs: do not build pcpubuf.c for uncompressed data Yue Hu
@ 2023-04-27  3:14 ` Gao Xiang
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Xiang @ 2023-04-27  3:14 UTC (permalink / raw)
  To: Yue Hu, xiang, chao, linux-erofs; +Cc: huyue2, linux-kernel, zhangwen



On 2023/4/27 11:03, Yue Hu wrote:
> From: Yue Hu <huyue2@coolpad.com>
> 
> The function of pcpubuf.c is just for low-latency decompression
> algorithms (e.g. lz4).
> 
> Signed-off-by: Yue Hu <huyue2@coolpad.com>


Subject: erofs: avoid pcpubuf.c inclusion if CONFIG_EROFS_FS_ZIP is off

Otherwise it looks good to me,
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Thanks,
Gao Xiang


> ---
>   fs/erofs/Makefile   |  4 ++--
>   fs/erofs/internal.h | 12 +++++++-----
>   2 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/erofs/Makefile b/fs/erofs/Makefile
> index 99bbc597a3e9..a3a98fc3e481 100644
> --- a/fs/erofs/Makefile
> +++ b/fs/erofs/Makefile
> @@ -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 pcpubuf.o sysfs.o
> +erofs-objs := super.o inode.o data.o namei.o dir.o utils.o sysfs.o
>   erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
> -erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o
> +erofs-$(CONFIG_EROFS_FS_ZIP) += decompressor.o zmap.o zdata.o pcpubuf.o
>   erofs-$(CONFIG_EROFS_FS_ZIP_LZMA) += decompressor_lzma.o
>   erofs-$(CONFIG_EROFS_FS_ONDEMAND) += fscache.o
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index af0431a40647..65dbfa76f854 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -472,11 +472,6 @@ static inline void *erofs_vm_map_ram(struct page **pages, unsigned int count)
>   	return NULL;
>   }
>   
> -void *erofs_get_pcpubuf(unsigned int requiredpages);
> -void erofs_put_pcpubuf(void *ptr);
> -int erofs_pcpubuf_growsize(unsigned int nrpages);
> -void __init erofs_pcpubuf_init(void);
> -void erofs_pcpubuf_exit(void);
>   
>   int erofs_register_sysfs(struct super_block *sb);
>   void erofs_unregister_sysfs(struct super_block *sb);
> @@ -512,6 +507,11 @@ int z_erofs_load_lz4_config(struct super_block *sb,
>   			    struct z_erofs_lz4_cfgs *lz4, int len);
>   int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
>   			    int flags);
> +void *erofs_get_pcpubuf(unsigned int requiredpages);
> +void erofs_put_pcpubuf(void *ptr);
> +int erofs_pcpubuf_growsize(unsigned int nrpages);
> +void __init erofs_pcpubuf_init(void);
> +void erofs_pcpubuf_exit(void);
>   #else
>   static inline void erofs_shrinker_register(struct super_block *sb) {}
>   static inline void erofs_shrinker_unregister(struct super_block *sb) {}
> @@ -529,6 +529,8 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
>   	}
>   	return 0;
>   }
> +static inline void erofs_pcpubuf_init(void) {}
> +static inline void erofs_pcpubuf_exit(void) {}
>   #endif	/* !CONFIG_EROFS_FS_ZIP */
>   
>   #ifdef CONFIG_EROFS_FS_ZIP_LZMA

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-27  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27  3:03 [PATCH] erofs: do not build pcpubuf.c for uncompressed data Yue Hu
2023-04-27  3:14 ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).