Skip to content

Restructure storage filesystem directory #13300

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 3 commits into from
Jul 20, 2020

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Jul 15, 2020

Summary of changes

Preceding PR: #13253 #13244 #13273

Restructured storage/filesystem as per the new directory structure proposal:

storage
├── blockdevice
├── filesystem
│   ├── mbed_lib.json
│   ├── include
│   │   └── filesystem
│   │       ├── mbed_filesystem.h
│   │       ├── Dir.h
│   │       └── [...]
│   ├── source
│   │   ├── Dir.cpp
│   │   └── [...]
│   ├── tests
│   ├── fat
│   │   ├── include
│   │   │   └── fat
│   │   ├── source
│   │   ├── tests
│   │   └── [...]
│   ├── littlefs
│   │   └── [...]
│   └── littlefsv2
│       └── [...]

Impact of changes

None.

Migration actions required

None.

Documentation

To Be Updated.


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[x] Tests / results supplied as part of this PR

Manual testing: (Build for K64F target with GCC_ARM toolchain)

  • mbed-os-example-blockdevice
  • mbed-os-example-filesystem
  • Greentea tests: Full and Bare metal profiles
  • Unit tests build and run

Reviewers

@0xc0170 @ARMmbed/mbed-os-core


@rajkan01 rajkan01 force-pushed the storage_fsdir_restructure branch 2 times, most recently from 0ef689c to eca9b3b Compare July 15, 2020 18:10
@rajkan01 rajkan01 changed the title Storage fsdir restructure Restructure storage filesystem directory Jul 15, 2020
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jul 15, 2020
@ciarmcom ciarmcom requested review from 0xc0170 and a team July 15, 2020 19:00
@ciarmcom
Copy link
Member

@rajkan01, thank you for your changes.
@0xc0170 @ARMmbed/mbed-os-core @ARMmbed/mbed-os-storage @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

Thanks @rajkan01, the directory structure looks good to me in general. Please fix the line endings.

@evedon I've raised one questions regarding the "sub" libraries (fat, littlefs, etc.) under filesystem.


clean:
./clean.sh

Copy link
Contributor

Choose a reason for hiding this comment

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

The line ending has been changed from \n to \r\n (Windows) - this is why we see a big diff on GitHub. Please revert it back - it'll make review (and git blame in the future) easier.


rm -f main.cpp
rm -f template_all_names.txt
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

- ['info\.name', 'ent.d_name']
- ['info\.type', 'ent.d_type']
- ['^.*info\.size.*$', ''] # dirent sizes not supported
- ['lfs2_format\(&lfs2, &cfg\)', 'MBED_TEST_FILESYSTEM::format(&bd)']
Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

- ['LFS2_O_WRONLY \| LFS2_O_CREAT', '"wb"']
- ['LFS2_O_RDONLY', '"rb"']
- ['LFS2_O_RDWR', '"r+b"']
- ['lfs2_format\(&lfs2, &cfg\)', 'MBED_TEST_FILESYSTEM::format(&bd)']
Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

{{
{test}
}}

Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

res = bd.deinit();
TEST_ASSERT_EQUAL(0, res);
}}

Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

int main() {{
return !Harness::run(specification);
}}
#include "mbed.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Line ending

Comment on lines +17 to +19
#include "filesystem/FileSystem.h"
#include "fat/FATFileSystem.h"
#include "littlefs/LittleFileSystem.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

Something I'd like to discuss:
In terms of user experience, including "filesystem/FATFileSystem.h", "filesystem/LittleFileSystem.h" in code seems more sensible than "fat/FATFileSystem.h", "littlefs/LittleFileSystem.h". If we want to achieve that, we can have

storage
├── filesystem
│   ├── fat
│   │   └── include
│   │       └── filesystem   # changed from fat
│   │           └── FATFileSystem.h

Of course, this would be a slight change from our initial proposal. What do you think? @rajkan01 @evedon

Copy link
Contributor

Choose a reason for hiding this comment

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

It breaks the consistency in the directory structure for little benefit. I don't think it is worth doing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay

@evedon
Copy link
Contributor

evedon commented Jul 16, 2020

File permission on storage/filesystem/littlefs/littlefs/tests/template.fmt should be reverted to 644. Apart from line endings issues noted by @LDong-Arm, code change is fine.

@rajkan01 rajkan01 force-pushed the storage_fsdir_restructure branch 2 times, most recently from c2d2b6e to ef5602f Compare July 16, 2020 17:21
Copy link
Contributor

@LDong-Arm LDong-Arm left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify
Copy link

mergify bot commented Jul 17, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@rajkan01 rajkan01 force-pushed the storage_fsdir_restructure branch from e0eb4e2 to 699acaa Compare July 17, 2020 19:38
@mergify mergify bot added needs: CI and removed needs: work labels Jul 20, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 20, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Jul 20, 2020

Test run: SUCCESS

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

@rajkan01
Copy link
Contributor Author

@0xc0170 This PR is ready for merge. Could you merge...

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 20, 2020

One last check : changing permissions on some scripts within this PR was intentional ?

See for instance littlefs/tests/TESTS/util/clean.sh 100644 → 100755

@rajkan01
Copy link
Contributor Author

rajkan01 commented Jul 20, 2020

One last check : changing permissions on some scripts within this PR was intentional ?
See for instance littlefs/tests/TESTS/util/clean.sh 100644 → 100755

@0xc0170 Revert to the previous permission as this was changed unintentionally on the last PR #13244 and even you have commented #13244 (comment)

@0xc0170 0xc0170 merged commit 3a8989a into ARMmbed:master Jul 20, 2020
@mergify mergify bot removed the ready for merge label Jul 20, 2020
@mbedmain mbedmain added release-version: 6.2.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Aug 16, 2020
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.

7 participants