-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add erofs-util API support for overlaybd #332
Conversation
relates to containerd/accelerated-container-image#287 |
src/overlaybd/tar/erofs/liberofs.cpp
Outdated
|
||
erofs_inode_manager_init(); | ||
|
||
root = erofs_mkfs_alloc_root(sbi); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's rename this as erofs_rebuild_make_root(sbi);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/overlaybd/tar/erofs/liberofs.cpp
Outdated
|
||
#define EROFS_UNIMPLEMENTED 1 | ||
|
||
struct erofs_sector { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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];
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uint64_t blksize
should be moved to the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL thanks @BigVan
LGTM |
will build a new release after improving CI test |
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: