[PATCH v3 5/5] erofs-utils: mkfs: support chunk-based uncompressed files

Gao Xiang hsiangkao at linux.alibaba.com
Thu Sep 23 05:07:29 AEST 2021


On Thu, Sep 23, 2021 at 02:56:07AM +0800, Gao Xiang wrote:
> mkfs support for the new chunk-based uncompressed files,
> including:
>  * chunk-based files with 4-byte block address array;
>  * chunk-based files with 8-byte inode chunk indexes.
> 
> Signed-off-by: Gao Xiang <hsiangkao at linux.alibaba.com>
> ---
>  include/erofs/blobchunk.h |  18 ++++
>  include/erofs/config.h    |   1 +
>  include/erofs/defs.h      |  77 ++++++++++++++
>  include/erofs/hashtable.h |  77 --------------
>  include/erofs/internal.h  |   1 +
>  include/erofs/io.h        |   2 +
>  lib/Makefile.am           |   2 +-
>  lib/blobchunk.c           | 217 ++++++++++++++++++++++++++++++++++++++
>  lib/inode.c               |  36 +++++--
>  lib/io.c                  |   2 +-
>  man/mkfs.erofs.1          |   3 +
>  mkfs/main.c               |  38 +++++++
>  12 files changed, 389 insertions(+), 85 deletions(-)
>  create mode 100644 include/erofs/blobchunk.h
>  create mode 100644 lib/blobchunk.c
>

Applying following diff to fix up the MacOS build:

diff --git a/configure.ac b/configure.ac
index 9d7d5c2..03387f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,7 +170,8 @@ AC_CHECK_FUNCS(m4_flatten([
 	strdup
 	strerror
 	strrchr
-	strtoull]))
+	strtoull
+	tmpfile64]))
 
 # Configure debug mode
 AS_IF([test "x$enable_debug" != "xno"], [], [
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index e05d0cb..725b517 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -208,7 +208,11 @@ void erofs_blob_exit(void)
 
 int erofs_blob_init(void)
 {
+#ifdef HAVE_TMPFILE64
 	blobfile = tmpfile64();
+#else
+	blobfile = tmpfile();
+#endif
 	if (!blobfile)
 		return -ENOMEM;
 


More information about the Linux-erofs mailing list