-
Notifications
You must be signed in to change notification settings - Fork 58
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
[EROFS]: cleanup and introduce prefetch feature #344
Conversation
Remove the global variables `_target` and `_source`, and introduce `struct liberofs_file` to wrap the source and target files. Signed-off-by: Hongzhen Luo <[email protected]>
e33fb96
to
102aba0
Compare
@@ -493,7 +499,11 @@ class DynamicPrefetcher : public PrefetcherImpl { | |||
} | |||
|
|||
virtual int replay(const IFile *imagefile) override { | |||
|
|||
if (is_erofs_fs(imagefile)) |
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.
unnecessary spaces?
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.
unnecessary spaces?
done.
@@ -78,3 +79,13 @@ photon::fs::IFileSystem *create_ext4fs(photon::fs::IFile *imgfile, bool mkfs, | |||
} | |||
return target; | |||
} | |||
|
|||
bool is_erofs_fs(const photon::fs::IFile *imgfile) | |||
{ |
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.
shall we check if imgfile == nullptr?
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.
shall we check if imgfile == nullptr?
done.
To support dynamic prefetching, EROFS provides the following interfaces: - ErofsFileSystem: - open - stat - opendir - ErofsFile: - fstat - fiemap - ErofsDir: - get - next - closedir - rewinddir - seekdir - telldir Signed-off-by: Hongzhen Luo <[email protected]>
thanks |
What this PR does / why we need it:
_target
and_source
, and introducestruct liberofs_file
to wrap the source and target files.The corresponding accelerated-container-image PR:
containerd/accelerated-container-image#299
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: