Skip to content

fatfs: Fixed initialization of block device in mount/unmount functions #4562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions features/filesystem/fat/FATFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,10 @@ FATFileSystem::~FATFileSystem()

int FATFileSystem::mount(BlockDevice *bd) {
// requires duplicate definition to allow virtual overload to work
return mount(bd, false);
return mount(bd, true);
}

int FATFileSystem::mount(BlockDevice *bd, bool force) {
int FATFileSystem::mount(BlockDevice *bd, bool mount) {
lock();
if (_id != -1) {
unlock();
Expand All @@ -265,7 +265,7 @@ int FATFileSystem::mount(BlockDevice *bd, bool force) {
_fsid[1] = ':';
_fsid[2] = '\0';
debug_if(FFS_DBG, "Mounting [%s] on ffs drive [%s]\n", getName(), _fsid);
FRESULT res = f_mount(&_fs, _fsid, force);
FRESULT res = f_mount(&_fs, _fsid, mount);
unlock();
return fat_error_remap(res);
}
Expand Down
9 changes: 1 addition & 8 deletions features/filesystem/fat/FATFileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ class FATFileSystem : public FileSystem {
*/
virtual int mount(BlockDevice *bd);

/** Mounts a filesystem to a block device
*
* @param bd BlockDevice to mount to
* @param force Flag to force the underlying filesystem to force mounting the filesystem
* @return 0 on success, negative error code on failure
*/
virtual int mount(BlockDevice *bd, bool force);

/** Unmounts a filesystem from the underlying block device
*
* @return 0 on success, negative error code on failure
Expand Down Expand Up @@ -235,6 +227,7 @@ class FATFileSystem : public FileSystem {
protected:
virtual void lock();
virtual void unlock();
virtual int mount(BlockDevice *bd, bool mount);
};

#endif