From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org
Cc: Yifan Zhao <stopire@gmail.com>, Gao Xiang <xiang@kernel.org>
Subject: [PATCH 2/5] erofs-utils: lib: unexport "erofs/chunk.h"
Date: Wed, 2 Sep 2026 10:50:27 +0800 [thread overview]
Message-ID: <20260902025031.50499-2-xiang@kernel.org> (raw)
In-Reply-To: <20260902025031.50499-1-xiang@kernel.org>
Signed-off-by: Gao Xiang <xiang@kernel.org>
---
lib/Makefile.am | 2 +-
lib/blobchunk.c | 4 ++--
lib/inode.c | 2 +-
include/erofs/blobchunk.h => lib/liberofs_chunk.h | 4 ++--
lib/rebuild.c | 2 +-
lib/remotes/s3.c | 2 +-
lib/super.c | 2 ++
lib/tar.c | 2 +-
mkfs/main.c | 3 +--
9 files changed, 12 insertions(+), 11 deletions(-)
rename include/erofs/blobchunk.h => lib/liberofs_chunk.h (92%)
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 25d08f2..0a82915 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -2,7 +2,6 @@
noinst_LTLIBRARIES = liberofs.la
noinst_HEADERS = $(top_srcdir)/include/erofs_fs.h \
- $(top_srcdir)/include/erofs/blobchunk.h \
$(top_srcdir)/include/erofs/block_list.h \
$(top_srcdir)/include/erofs/config.h \
$(top_srcdir)/include/erofs/decompress.h \
@@ -23,6 +22,7 @@ noinst_HEADERS = $(top_srcdir)/include/erofs_fs.h \
$(top_srcdir)/include/erofs/importer.h \
$(top_srcdir)/lib/liberofs_base64.h \
$(top_srcdir)/lib/liberofs_cache.h \
+ $(top_srcdir)/lib/liberofs_chunk.h \
$(top_srcdir)/lib/liberofs_compress.h \
$(top_srcdir)/lib/liberofs_fragments.h \
$(top_srcdir)/lib/liberofs_private.h \
diff --git a/lib/blobchunk.c b/lib/blobchunk.c
index 480629f..d218b38 100644
--- a/lib/blobchunk.c
+++ b/lib/blobchunk.c
@@ -6,10 +6,10 @@
*/
#define _GNU_SOURCE
#include "erofs/print.h"
-#include "erofs/blobchunk.h"
#include "erofs/block_list.h"
#include "erofs/importer.h"
#include "liberofs_cache.h"
+#include "liberofs_chunk.h"
#include "liberofs_private.h"
#include "liberofs_sha256.h"
#include <unistd.h>
@@ -665,7 +665,7 @@ err_out:
return ret;
}
-int erofs_blob_exit(struct erofs_sb_info *sbi)
+int erofs_chunkmgr_exit(struct erofs_sb_info *sbi)
{
struct erofs_chunkmgr *cmgr = sbi->chunkmgr;
struct erofs_chunkitem *bc, *n;
diff --git a/lib/inode.c b/lib/inode.c
index a69439c..ea3277b 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -23,9 +23,9 @@
#include "erofs/exclude.h"
#include "erofs/block_list.h"
#include "erofs/compress_hints.h"
-#include "erofs/blobchunk.h"
#include "erofs/importer.h"
#include "liberofs_cache.h"
+#include "liberofs_chunk.h"
#include "liberofs_compress.h"
#include "liberofs_fragments.h"
#include "liberofs_metabox.h"
diff --git a/include/erofs/blobchunk.h b/lib/liberofs_chunk.h
similarity index 92%
rename from include/erofs/blobchunk.h
rename to lib/liberofs_chunk.h
index 1c8d77d..3af88df 100644
--- a/include/erofs/blobchunk.h
+++ b/lib/liberofs_chunk.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0+ OR MIT */
/*
- * erofs-utils/lib/blobchunk.h
+ * erofs-utils/lib/liberofs_chunk.h
*
* Copyright (C) 2021, Alibaba Cloud
*/
@@ -25,10 +25,10 @@ int erofs_blob_write_chunked_file(struct erofs_inode *inode, int fd,
int erofs_write_zero_inode(struct erofs_inode *inode);
int tarerofs_write_chunkes(struct erofs_inode *inode, erofs_off_t data_offset);
int erofs_mkfs_dump_blobs(struct erofs_sb_info *sbi);
-int erofs_blob_exit(struct erofs_sb_info *sbi);
int erofs_blob_init(struct erofs_sb_info *sbi, int blobdev_id,
unsigned int chunkbits_def);
int erofs_blob_init_device(struct erofs_sb_info *sbi, int device_id);
+int erofs_chunkmgr_exit(struct erofs_sb_info *sbi);
#ifdef __cplusplus
}
diff --git a/lib/rebuild.c b/lib/rebuild.c
index 55681f9..38ced3c 100644
--- a/lib/rebuild.c
+++ b/lib/rebuild.c
@@ -12,9 +12,9 @@
#include "erofs/inode.h"
#include "erofs/dir.h"
#include "erofs/xattr.h"
-#include "erofs/blobchunk.h"
#include "erofs/internal.h"
#include "erofs/io.h"
+#include "liberofs_chunk.h"
#include "liberofs_rebuild.h"
#include "liberofs_uuid.h"
diff --git a/lib/remotes/s3.c b/lib/remotes/s3.c
index 245efe5..b3352df 100644
--- a/lib/remotes/s3.c
+++ b/lib/remotes/s3.c
@@ -15,7 +15,7 @@
#include "erofs/internal.h"
#include "erofs/print.h"
#include "erofs/inode.h"
-#include "erofs/blobchunk.h"
+#include "../liberofs_chunk.h"
#include "erofs/diskbuf.h"
#include "erofs/importer.h"
#include "liberofs_rebuild.h"
diff --git a/lib/super.c b/lib/super.c
index 98e1711..9e52dd8 100644
--- a/lib/super.c
+++ b/lib/super.c
@@ -7,6 +7,7 @@
#include "erofs/print.h"
#include "erofs/xattr.h"
#include "liberofs_cache.h"
+#include "liberofs_chunk.h"
#include "liberofs_compress.h"
#include "liberofs_metabox.h"
@@ -185,6 +186,7 @@ int erofs_read_superblock(struct erofs_sb_info *sbi)
void erofs_put_super(struct erofs_sb_info *sbi)
{
+ erofs_chunkmgr_exit(sbi);
if (sbi->devs) {
int i;
diff --git a/lib/tar.c b/lib/tar.c
index cf60b02..cbe9f40 100644
--- a/lib/tar.c
+++ b/lib/tar.c
@@ -9,7 +9,6 @@
#include "erofs/list.h"
#include "erofs/tar.h"
#include "erofs/xattr.h"
-#include "erofs/blobchunk.h"
#include "erofs/importer.h"
#if defined(HAVE_SYS_SYSMACROS_H)
#include <sys/sysmacros.h>
@@ -19,6 +18,7 @@
#endif
#include "liberofs_base64.h"
#include "liberofs_cache.h"
+#include "liberofs_chunk.h"
#include "liberofs_gzran.h"
#include "liberofs_rebuild.h"
#include "liberofs_sha256.h"
diff --git a/mkfs/main.c b/mkfs/main.c
index b6d215b..8da3753 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -24,8 +24,8 @@
#include "erofs/exclude.h"
#include "erofs/block_list.h"
#include "erofs/compress_hints.h"
-#include "erofs/blobchunk.h"
#include "../lib/compressor.h"
+#include "../lib/liberofs_chunk.h"
#include "../lib/liberofs_gzran.h"
#include "../lib/liberofs_metabox.h"
#include "../lib/liberofs_oci.h"
@@ -2084,7 +2084,6 @@ exit:
fclose(blklst);
erofs_cleanup_compress_hints();
erofs_cleanup_exclude_rules();
- erofs_blob_exit(&g_sbi);
erofs_xattr_cleanup_name_prefixes();
erofs_rebuild_cleanup();
erofs_diskbuf_exit();
--
2.47.3
next prev parent reply other threads:[~2026-09-02 2:52 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 2:50 [PATCH 1/5] erofs-utils: add missing device_id derivation for flattened devices Gao Xiang
2026-09-02 2:50 ` Gao Xiang [this message]
2026-09-02 2:50 ` [PATCH 3/5] erofs-utils: lib: migrate `c_chunkbits` and `c_blobdev_path` Gao Xiang
2026-09-02 7:14 ` Zhan Xusheng
2026-09-02 2:50 ` [PATCH 4/5] erofs-utils: mkfs: introduce ddev_id_def Gao Xiang
2026-09-02 2:50 ` [PATCH 5/5] erofs-utils: mkfs: enable `--blobdev` for flat inode layouts Gao Xiang
2026-09-02 8:11 ` Zhan Xusheng
2026-09-02 15:58 ` Gao Xiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260902025031.50499-2-xiang@kernel.org \
--to=xiang@kernel.org \
--cc=linux-erofs@lists.ozlabs.org \
--cc=stopire@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.