Skip to content

Commit 0f31630

Browse files
committed
[nrf fromtree] doc: zms: update ZMS documentation about mount_flags
Updtae the documentation and describe the usage of the mount_flags. Detail the ZMS_MOUNT_FLAG_NO_FORMAT optional flag. Signed-off-by: Riadh Ghaddab <riadh.ghaddab@nordicsemi.no> (cherry picked from commit 9f7802e)
1 parent 4ce8368 commit 0f31630

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

doc/services/storage/zms/zms.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ By default, :c:func:`zms_mount` returns an error if the partition cannot be moun
110110
For recovery-oriented use cases, :c:func:`zms_mount_force` can be used to automatically
111111
wipe and reinitialize the partition when the first mount attempt fails.
112112

113+
Mount flags
114+
-----------
115+
116+
ZMS mount behavior can be controlled with optional flags in ``zms_fs.mount_flags``.
117+
118+
- Default behavior (no optional flags set, ``mount_flags = 0``): if the partition is erased and no valid
119+
ZMS header is found, :c:func:`zms_mount` formats the partition by creating the
120+
initial ZMS header.
121+
- ``ZMS_MOUNT_FLAG_NO_FORMAT``: if the partition is erased and no valid ZMS
122+
header is found, :c:func:`zms_mount` does not format the partition and returns
123+
``-ENOTSUP``.
124+
113125
To mount the filesystem the following elements in the :c:struct:`zms_fs` structure must be initialized:
114126

115127
.. code-block:: c
@@ -125,6 +137,9 @@ To mount the filesystem the following elements in the :c:struct:`zms_fs` structu
125137
/** Number of sectors in the file system */
126138
uint32_t sector_count;
127139
140+
/** Optional mount behavior flags (enum zms_mount_flags) */
141+
uint32_t mount_flags;
142+
128143
/** Flash device runtime structure */
129144
const struct device *flash_device;
130145
};

0 commit comments

Comments
 (0)