summaryrefslogtreecommitdiff
path: root/shared-module/storage
diff options
context:
space:
mode:
authorScott Shawcroft <scott.shawcroft@gmail.com>2017-06-28 14:46:49 -0700
committerScott Shawcroft <scott.shawcroft@gmail.com>2017-06-28 14:46:49 -0700
commitd6a24afd71067102ca5e2ac9c2c81ddfae5ba140 (patch)
tree130de908bfeec1c0a2719a7c4dc8f73ff2be30ae /shared-module/storage
parent5ddbf26b62af230004219ec021c9e8ecd8abec26 (diff)
Change vfs mount ordering such that the root is always last in the
linked list. Its also the only one statically allocated and made available over USB.
Diffstat (limited to 'shared-module/storage')
-rw-r--r--shared-module/storage/__init__.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/shared-module/storage/__init__.c b/shared-module/storage/__init__.c
index 582b91a5b..97a049bac 100644
--- a/shared-module/storage/__init__.c
+++ b/shared-module/storage/__init__.c
@@ -78,16 +78,10 @@ void common_hal_storage_mount(mp_obj_t vfs_obj, const char* mount_path, bool rea
}
}
- // insert the vfs into the mount table
+ // Insert the vfs into the mount table by pushing it onto the front of the
+ // mount table.
mp_vfs_mount_t **vfsp = &MP_STATE_VM(vfs_mount_table);
- while (*vfsp != NULL) {
- if ((*vfsp)->len == 1) {
- // make sure anything mounted at the root stays at the end of the list
- vfs->next = *vfsp;
- break;
- }
- vfsp = &(*vfsp)->next;
- }
+ vfs->next = *vfsp;
*vfsp = vfs;
}