fs: Add nx_mount/nx_umount2 function

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-05-04 21:49:07 +08:00
committed by patacongo
parent 4a3d28a957
commit de33f86ae3
4 changed files with 148 additions and 56 deletions
+44
View File
@@ -188,6 +188,10 @@
#define OPEN_SETFD(f) ((f) | OPEN_MAGIC)
#define OPEN_GETFD(r) ((r) & OPEN_MASK)
/* nx_umount() is equivalent to nx_umount2() with flags = 0 */
#define umount(t) umount2(t,0)
/****************************************************************************
* Public Type Definitions
****************************************************************************/
@@ -678,6 +682,46 @@ int register_mtdpartition(FAR const char *partition,
int unregister_mtddriver(FAR const char *path);
#endif
/****************************************************************************
* Name: nx_mount
*
* Description:
* nx_mount() is similar to the standard 'mount' interface except that is
* not a cancellation point and it does not modify the errno variable.
*
* nx_mount() is an internal NuttX interface and should not be called from
* applications.
*
* Returned Value:
* Zero is returned on success; a negated value is returned on any failure.
*
****************************************************************************/
#ifndef CONFIG_DISABLE_MOUNTPOINT
int nx_mount(FAR const char *source, FAR const char *target,
FAR const char *filesystemtype, unsigned long mountflags,
FAR const void *data);
#endif
/****************************************************************************
* Name: nx_umount2
*
* Description:
* nx_umount2() is similar to the standard 'umount2' interface except that
* is not a cancellation point and it does not modify the errno variable.
*
* nx_umount2() is an internal NuttX interface and should not be called
* from applications.
*
* Returned Value:
* Zero is returned on success; a negated value is returned on any failure.
*
****************************************************************************/
#ifndef CONFIG_DISABLE_MOUNTPOINT
int nx_umount2(FAR const char *target, unsigned int flags);
#endif
/****************************************************************************
* Name: files_initlist
*
+1 -1
View File
@@ -81,7 +81,7 @@
#define MNT_EXPIRE (1 << 2)
#define UMOUNT_NOFOLLOW (0)
/* mount() is equivalent to umount2() with flags = 0 */
/* umount() is equivalent to umount2() with flags = 0 */
#define umount(t) umount2(t,0)