Skip to content

fs: Add FileSystem::reformat #4908

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

Merged
merged 2 commits into from
Aug 21, 2017
Merged

fs: Add FileSystem::reformat #4908

merged 2 commits into from
Aug 21, 2017

Conversation

geky
Copy link
Contributor

@geky geky commented Aug 14, 2017

This function provides a shortcut to reformatting a mounted filesystem.

Usage without mounted filesystem:

BlockDevice *bd = user_provided;
int err = fs.mount(bd);
if (err) {
    fs.reformat(bd);
}
// fs is now mounted

Usage with mounted filesystem:

fs.reformat();
// fs is now mounted

Formatting without mounting

BlockDevice *bd = user_provided;
FATFileSystem::format(bd);
// fs is not mounted

Also, since this function is a virtual member of the FileSystem class, the user does not need to know the underlying filesystem to reformat the underlying storage.

can replace #4886
resolves #4903
related #4407
cc @netanelgonen, @sg-, @pan-, @theotherjimmy

This function provides a shortcut to reformatting a mounted filesystem.

Also, since this function is a virtual member of the FileSystem class,
the user does not need to know the underlying filesystem to reformat
the underlying storage.
@geky
Copy link
Contributor Author

geky commented Aug 16, 2017

I'll go ahead and kick off CI to move things along
/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1046

All builds and test passed!

@geky
Copy link
Contributor Author

geky commented Aug 18, 2017

I'm guessing this is ready to go in now. Last call for comments.

@JanneKiiskila
Copy link
Contributor

Would it be possible to get this patched to mbed OS 5.5.x already?
@geky @adbridge

@theotherjimmy
Copy link
Contributor

@JanneKiiskila We try to put only "bug fixes" into patch versions. This PR is queued for 5.6.0 because it adds a new API in a backwards compatible way. OTOH, it's been almost 3 months since the last minor release, so we're due for another one soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create a format virtual function for the format api
6 participants