Skip to content

Commit

Permalink
Merge pull request #4562 from geky/fat-init-bd
Browse files Browse the repository at this point in the history
fatfs: Fixed initialization of block device in mount/unmount functions
  • Loading branch information
theotherjimmy committed Jun 19, 2017
2 parents 737a64c + d7fe4ff commit e4bdedc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
6 changes: 3 additions & 3 deletions features/filesystem/fat/FATFileSystem.cpp
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
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

0 comments on commit e4bdedc

Please sign in to comment.