From d6a24afd71067102ca5e2ac9c2c81ddfae5ba140 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 28 Jun 2017 14:46:49 -0700 Subject: 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. --- shared-module/storage/__init__.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'shared-module') 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; } -- cgit v1.2.3