Skip to content

Merge feature-posix branch (FileHandle::truncate) #8972

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 4 commits into from
Dec 17, 2018

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Dec 5, 2018

Description

Merge feature branch feature-posix, which contains just the FileHandle::truncate extension from #7162.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[X] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Fixes #7010

@kjbracey kjbracey force-pushed the merge_file_truncate branch from 3596db7 to ab11825 Compare December 5, 2018 08:45
@0xc0170 0xc0170 requested a review from a team December 5, 2018 11:14
@cmonr cmonr requested a review from geky December 5, 2018 15:41
Copy link
Contributor

@geky geky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, keeping this out of tree doesn't help anyone

@kjbracey-arm thanks for maintaining this branch, @dannybenor fyi

@cmonr cmonr requested a review from dannybenor December 6, 2018 02:08
@cmonr
Copy link
Contributor

cmonr commented Dec 6, 2018

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 6, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 1
Build artifacts

@cmonr
Copy link
Contributor

cmonr commented Dec 7, 2018

@kjbracey-arm Is it safe to delete the feature-posix once this comes in?

@kjbracey
Copy link
Contributor Author

kjbracey commented Dec 7, 2018

Yes, can delete the feature branch delete when this is merged.

No further changes planned - it was created as a one-off to hold this PR pending further discussion/review.

@cmonr
Copy link
Contributor

cmonr commented Dec 14, 2018

@kjbracey-arm If b42dbf0 can be cherry-picked into its own branch and PR, it can be taken into 5.11.1.

Then we can merge this PR for 5.12.0. Afaik, that commit is the only one that would cause 5.11.1 release issues if we were to merge this PR now.

kjbracey and others added 4 commits December 14, 2018 19:29
ARM C library is really good at optimising out calls to underlying
seek. The only ones we were actually detecting in the empty file case
were the ones that the default FileHandle::size() made itself during
the SEEK_END case.

When we implement TestFile::size() directly, we will no longer see
a single seek call from the ARM C library in the empty file case, so
remove those tests.

Beef up the non-empty file case, adding checks that we are making
underlying read+write calls in the correct position, as a proxy for
direct checks for underlying seek being called.
Add support for file truncation (or extension) to the abstract API.

No hooks to actual implementations in this commit.
- File::truncate
- FileSystem::file_truncate
- FATFileSystem::file_truncate
- LittleFileSystem::file_truncate
@kjbracey kjbracey force-pushed the merge_file_truncate branch from 14e4ad6 to 8db2c0d Compare December 14, 2018 17:29
@kjbracey
Copy link
Contributor Author

Rebased, formatting fixes squashed in, and fseek/ftell test refactor moved to front so it can be a separate PR.

@NirSonnenschein
Copy link
Contributor

CI started

@mbed-ci
Copy link

mbed-ci commented Dec 17, 2018

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 2
Build artifacts

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.

8 participants