Skip to content

Commit 5049694

Browse files
Ramakrishna Pallalanashif
authored andcommitted
doc: Add documentation for file system subsystem
Add documentation for file system subsystem. Signed-off-by: Ramakrishna Pallala <[email protected]>
1 parent d6870e4 commit 5049694

File tree

1 file changed

+45
-4
lines changed

1 file changed

+45
-4
lines changed

doc/reference/file_system/index.rst

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,54 @@
33
File Systems
44
############
55

6+
Zephyr RTOS Virtual Filesystem Switch (VFS) allows applications to mount multiple
7+
file systems at different mount points (e.g., ``/fatfs`` and ``/nffs``). The
8+
mount point data structure contains all the necessary information required
9+
to instantiate, mount, and operate on a file system. The File system Switch
10+
decouples the applications from directly accessing an individual file system's
11+
specific API or internal functions by introducing file system registration
12+
mechanisms.
613

14+
In Zephyr, any file system implementation or library can be plugged into or
15+
pulled out through a file system registration API.
716

8-
.. comment
9-
not documenting
10-
.. doxygengroup:: file_system
11-
.. doxygengroup:: file_system_storage
17+
.. code-block:: c
1218
19+
int fs_register(enum fs_type type, struct fs_file_system_t *fs);
20+
21+
int fs_unregister(enum fs_type type, struct fs_file_system_t *fs);
22+
23+
Zephyr RTOS supports multiple instances of a file system by making use of
24+
the mount point as the disk volume name, which is used by the file system library
25+
while formatting or mounting a disk.
26+
27+
A file system is declared as:
28+
29+
.. code-block:: c
30+
31+
static struct fs_mount_t mp = {
32+
.type = FS_FATFS,
33+
.mnt_point = FATFS_MNTP,
34+
.fs_data = &fat_fs,
35+
};
36+
37+
where
38+
39+
- ``FS_FATFS`` is the file system type like FATFS or NFFS.
40+
- ``FATFS_MNTP`` is the mount point where the file system will be mounted.
41+
- ``fat_fs`` is the file system data which will be used by fs_mount() API.
42+
43+
Known Limitations
44+
*****************
45+
46+
NFFS supports only one instance of file system due to the library's internal
47+
implementation limitation.
48+
49+
50+
Sample
51+
******
52+
53+
A sample of how the file system can be used is supplied in ``samples/subsys/fs``.
1354

1455
API Reference
1556
*************

0 commit comments

Comments
 (0)