Re: [RFC] Introduction of Virtual Filesystem Interface in Zephyr

Nashif, Anas

Sounds like a good proposal.

-----Original Message-----
From: zephyr-devel-bounces@... [mailto:zephyr-devel-bounces@...] On Behalf Of Pallala, Ramakrishna
Sent: Tuesday, February 6, 2018 4:20 AM
To: devel@...
Subject: [Zephyr-devel] [RFC] Introduction of Virtual Filesystem Interface in Zephyr


In the current Zephyr tree, we have support for FATFS and NFFS support but they are mutually exclusive i.e we cannot have both filesystems mounted at the same time.
Also, we don't have the flexibility to have multiple filesystems mounted even if they are of the same type. The reason is that the current implementation assumes that we will only have one instance of the single filesystem in the system.

Example fs_open call flow of FATFS at present:
fs_open -> f_open

This RFC is about implementing a Virtual Filesystem Interface (VFS) in Zephyr and support multiple instances of multiple filesystems. The idea is to have a simple VFS layer which will provide registration mechanisms to the filesystems which want to be part of the system. Once the filesystems are registered with VFS then all the application level file related calls will go through the VFS.

For example a fs_open call on FASFS will take the following route with the introduction of VFS:
fs_open -> vfs_open -> fatfs_open -> f_open

Once we have VFS in place, supporting multiple instances of the same file should be straightforward as VFS does not care about which file system you are mounting/registering. It only cares about the unique mount point and the underlying flash read/writes land into different flash areas. So if we have defined four flash areas/regions on a flash device we should be able to create/mount four different file systems on the same device.

There is a Github ticket raised for this topic

Please share your comments/suggestion over email or post on github issue page (preferred).

Zephyr-devel mailing list

Join to automatically receive all group messages.