tuxera / reliance-edge

Transactional power-failsafe filesystem for microcontrollers
https://www.tuxera.com/company/open-source
GNU General Public License v2.0
109 stars 32 forks source link

Add a FUSE file system implementation for Reliance. #7

Closed jcdubois closed 7 years ago

jcdubois commented 8 years ago

This patch is on top of the previous linux patch.

It adds a FUSE file system implementation for reliance.

One mounted the user can access the reliance file system like a normal file system through the selected mount point. You can interract with the reliance file system with the usual linux tools (mkdir, cp, rm, ln, vi, ...).

Note: As Reliance does not support access permission all users have the same access right on all files/directories.

aamcampbell commented 7 years ago

This is excellent, thanks for contributing! We recently discussed the need for a fuse implementation, so we appreciate your help with this.

Just so you know, we have the following steps to complete internally before merging this into the repository:

I expect these steps to be this complete within the next few days.

jcdubois commented 7 years ago

Please note that the fuse filesystem build is obviously dependent on the presence of the "libfuse-dev" package on the system. I put it in its own directory to avoid having impact on the other tools build.

aamcampbell commented 7 years ago

Good thought. However, the fuse project should be included all projects (including those listed in projects/freertos/atmel and projects/freertos/st), and we want to avoid unnecessary duplication. One solution would be to use use "reliance_fuse" as a separate make target in os/linux/host.mk, so that make builds the existing host tools and make reliance_fuse builds the fuse implementation.

jcdubois commented 7 years ago

Note also that this preliminary implementation is very crude. It doesn't benefit from the transactional feature or reliance-edge. This could/should be improved by using the fuse_file_info structure in open/read/write/close implementation.

jcdubois commented 7 years ago

So, I added the less crude implementation.

aamcampbell commented 7 years ago

I did notice how the fuse_file_info structure was not used before. Using it should provide several benefits, including performance.

Unfortunately we had to re-implement the fuse port to avoid using GPL code by other authors (based on the copyright notice at the top of reliance_fuse.c), but that process has gone smoothly using another Datalight fuse implementation as a template and using code from your implementation that is specific to Reliance Edge. I hope to push it to GitHub today.

aamcampbell commented 7 years ago

I haven't had time to extensively test it yet, but I've pushed the FUSE implementation to GitHub with commit 27031645.

jcdubois commented 7 years ago

I had to remove the flag_nopath initialization as it was not supported on Ubuntu precise (LTS) which is the default build env for Travis.

Anyway, if not initialized, they would default to 0 which it the expected value here.

aamcampbell commented 7 years ago

I merged in this pull request, and put the changes through our automated build system with commit 13db89b6. This is a new way of merging pull requests for us that should work well for minor changes on code that does not require MISRA compliance. We still had to manually merge changes in our internal repositories, which is why a whitespace fix in os/linux/services/osbdev.c got reverted by commit 13db89b6 (I missed it until now, so I'll fix it again in the next commit). I hope this makes sense to you.