MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / dfs_mnt_setflags

Function dfs_mnt_setflags

components/dfs/dfs_v2/src/dfs_mnt.c:390–403  ·  view source on GitHub ↗

* @brief Set specific flags for a dfs_mnt structure instance. * * This function sets specific flags for the given dfs_mnt structure. * If the MS_RDONLY flag is included in the input flags, it sets the MNT_RDONLY flag * for the mount point and cleans the page cache if the page cache feature is enabled. * * @param[in,out] mnt Pointer to the dfs_mnt structure for which flags are to be set. *

Source from the content-addressed store, hash-verified

388 * @return returns 0 to indicate success.
389 */
390int dfs_mnt_setflags(struct dfs_mnt *mnt, int flags)
391{
392 int error = 0;
393
394 if (flags & MS_RDONLY)
395 {
396 mnt->flags |= MNT_RDONLY;
397#ifdef RT_USING_PAGECACHE
398 dfs_pcache_clean(mnt);
399#endif
400 }
401
402 return error;
403}
404
405/**
406 * @brief Destroy a dfs_mnt structure instance and unmount it if necessary.

Callers 1

dfs_remountFunction · 0.85

Calls 1

dfs_pcache_cleanFunction · 0.85

Tested by

no test coverage detected