Add erofs-util API support for overlaybd #332
Merged
BigVan merged 1 commit intocontainerd:mainfrom Jun 27, 2024
Merged
Conversation
Member
|
relates to containerd/accelerated-container-image#287 |
hsiangkao
reviewed
Jun 25, 2024
src/overlaybd/tar/erofs/liberofs.cpp
Outdated
|
|
||
| erofs_inode_manager_init(); | ||
|
|
||
| root = erofs_mkfs_alloc_root(sbi); |
Member
There was a problem hiding this comment.
let's rename this as erofs_rebuild_make_root(sbi);
src/overlaybd/tar/erofs/liberofs.cpp
Outdated
|
|
||
| #define EROFS_UNIMPLEMENTED 1 | ||
|
|
||
| struct erofs_sector { |
Member
There was a problem hiding this comment.
I think we could just use a std::map<addr, struct liberofs_inmem_sector> and stl::set for dirty bitmap?
struct liberofs_inmem_sector {
char data[SECTOR_SIZE];
};
hsiangkao
reviewed
Jun 25, 2024
src/overlaybd/tar/erofs/liberofs.h
Outdated
| public: | ||
| LibErofs(photon::fs::IFile *target); | ||
| ~LibErofs(); | ||
| int extract_tar(photon::fs::IFile *source, uint64_t blksize, bool meta_only, bool first_layer); |
Member
There was a problem hiding this comment.
uint64_t blksize should be moved to the constructor.
afeb875 to
528d634
Compare
Previously, erofs-utils was integrated into overlaybd by using the `mkfs.erofs` executable file. It's not optimial since raw data needs to be dumped first and output data needs to be write into overlaybd then. This commit introduces the I/O API in tarerofs, that the data stream of the: - output image - input tar file can be controlled by the I/O manager. This also adds block read/write cache support for IFile to improve the efficiency of making file system images. Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
528d634 to
652bc76
Compare
hsiangkao
approved these changes
Jun 27, 2024
Member
|
LGTM |
Member
|
will build a new release after improving CI test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
Previously, erofs-utils was integrated into overlaybd by using the mkfs.erofs executable file. It's not optimial since raw data needs to be dumped first and output data needs to be write into overlaybd then.
This adds EROFS API support for overlaybd.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Please check the following list: