-
Notifications
You must be signed in to change notification settings - Fork 3k
LocalFileSystem: Repair the FileSystemLike hooks #4087
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
Conversation
98aa09f
to
294ac38
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.
Seems ok to me!
@mbed-bot: TEST HOST_OSES=ALL |
[Build 1329] |
features/filesystem/FileSystem.cpp
Outdated
@@ -109,3 +123,37 @@ size_t FileSystem::dir_size(fs_dir_t dir) | |||
return size; | |||
} | |||
|
|||
template <typename F> |
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.
worth documenting the intention with managed class ?
The previous one had // Internally used file objects with managed memory on close
Jenkins CI failure:
|
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.
Looks reasonable to me - abstract FileSystemHandle returning abstract FileHandle etc - but I've never looked that hard at the FileSystem bits, so I don't have much basis for comparison.
Seems like the API could work with a device filing system which is my current mental test.
Thanks for catching those @0xc0170! Should be updated. I always get surprised by these compiler differences. @kjbracey-arm, I've been keeping a device filing system in mind as well :) |
@mbed-bot: TEST HOST_OSES=ALL |
[Build 1336] |
This will need some serious docs work. /morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
|
/morph test-nightly |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
@geky We haven't replaced the Jenkins build data after upgrading the CI system, however the public build results are still available here: http://mbedosci.cloudapp.net/results/nightly/1881 |
5b68689
to
59ab957
Compare
Updated with workaround, looks like some targets are defining an |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
Failures were related to networking issues last night, rerunning |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
/morph test-nightly |
@geky Looks like travis actually failed on this one, can you take a look? |
f15fd29
to
ba30b32
Compare
/morph test-nightly |
Result: ABORTEDYour command has finished executing! Here's what you wrote!
OutputTest failed! |
@0xc0170, thanks for the rebase 👍 more merge conflicts I take it? |
@geky mind fixing the conflict? |
ba30b32
to
92c4384
Compare
Rebased |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
92c4384
to
5795373
Compare
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
retest uvisor |
Looks like we need to properly rebase ,retarget has errors (same was done with yesterday rebase?) |
Required for other representations of FileSystems, ie LocalFileSystem Introduces FileSystemHandle for the same behaviour as FileHandle and DirHandle. Requires the following to hook into file/dir lookup: ``` int open(FileHandle **file, const char *filename, int flags) int open(DirHandle **dir, const char *path) ``` This hook is provided by the FileSystem class, so requires no changes from implementations.
The old open/opendir functions did not provide a route for errors and relied on implementations manually setting errno. Updated to return errors directly.
5795373
to
0fc5ce2
Compare
I removed the MBED_CONF_FILESYSTEM_PRESENT ifdef around ManagedFile and ManagedDir. Also updated ManagedFile to inherit from FileHandle and ManagedDir to inherit from DirHandle. |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
Thanks for the rebase! ManagedFile/ManagedDir are actually no longer used, but it's not like they will hurt master until we get around to removing them. |
Repaired the FileSystemLike hooks needed by the LocalFileSystem. This introduces FileSystemLike which is similar to FileLike, and FileSystemHandle which is similar to FileHandle.
To implement a FileSystemLike with error codes, the following functions must be implemented for file/dir lookup (only file is required):
This pr adopts the FileSystemLike into LocalFileSystem, FileSystem, and the retarget code. Hooks are provided by the common FileSystem layer, so no implementation needs to change.
This should resolve #3983, however is dependent on #3867, which restricts this to version 5.5.
should resolve: #3983
cause: https://github.com/ARMmbed/mbed-os/pull/3773/files
cc @simonqhughes, @kjbracey-arm, @bridadan