diff options
| author | Damien George | 2017-11-16 16:01:47 +1100 |
|---|---|---|
| committer | Damien George | 2017-11-20 11:46:40 +1100 |
| commit | 12ad64bc554fe33772c492efc55eb9290463048a (patch) | |
| tree | 6055de58a2e8d73bec8fbb97574ceb93fcf64ef1 /extmod/vfs_fat.h | |
| parent | ccaa5f5b0bad69f0f0ea81151e34c218fe13ce66 (diff) | |
extmod/vfs_fat: Mount FatFS on creation so VFS methods can be used.
It's possible to use the methods (eg ilistdir) of a VFS FatFS object
without it being mounted in the VFS itself. This previously worked but
only because FatFS was "mounting" the filesystem automatically when any
function (eg f_opendir) was called. But it didn't work for ports that used
synchronisation objects (_FS_REENTRANT) because they are only initialised
via a call to f_mount. So, call f_mount explicitly when creating a new
FatFS object so that everything is set up correctly. Then also provide a
finaliser to do the f_umount call, but only if synchronisation objects are
enabled (since otherwise the f_umount call does nothing).
Diffstat (limited to 'extmod/vfs_fat.h')
| -rw-r--r-- | extmod/vfs_fat.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h index 443e4eda8..688452973 100644 --- a/extmod/vfs_fat.h +++ b/extmod/vfs_fat.h @@ -35,6 +35,7 @@ #define FSUSER_NATIVE (0x0001) // readblocks[2]/writeblocks[2] contain native func #define FSUSER_FREE_OBJ (0x0002) // fs_user_mount_t obj should be freed on umount #define FSUSER_HAVE_IOCTL (0x0004) // new protocol with ioctl +#define FSUSER_NO_FILESYSTEM (0x0008) // the block device has no filesystem on it typedef struct _fs_user_mount_t { mp_obj_base_t base; |
