diff options
author | William Wilgus <wilgus.william@gmail.com> | 2024-03-21 18:27:23 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2024-03-23 01:03:33 -0400 |
commit | fdc3668a6a4d85fa6dde890ced7e9b850233bc0d (patch) | |
tree | 5b686359a60acaf753a66f2d09078607b9b11b45 /firmware/include/rb_namespace.h | |
parent | ae01ea7fd93d4ed3e1a97f9c9b25ca072ebbc431 (diff) | |
download | rockbox-fdc3668a6a4d85fa6dde890ced7e9b850233bc0d.tar.gz rockbox-fdc3668a6a4d85fa6dde890ced7e9b850233bc0d.zip |
[BugFix] Multiboot Database duplicate files
When the sd card is mounted into the root namespace the database
picks up files through both paths
previously we hid the mounted drive but this causes issues with users
databases when the drive letter changes
Adds a way to keep track of volumes mounted in the root namespace
Hides the enumerated volume in root
Database:
we can just parse the root directory ('/') and get to any mounted
volume but we can also enumerate a volume in the root directory
when this occurs it leads to multiple entries since the files can
be reached through multiple paths ex, /Foo could also be /SD1/Foo
Instead we will attempt to rewrite the root with any non-hidden volumes
failing that just leave the paths alone
Change-Id: I7bdba8cfaf63902d2a3852d28484bcf8ca317ebd
Diffstat (limited to 'firmware/include/rb_namespace.h')
-rw-r--r-- | firmware/include/rb_namespace.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/include/rb_namespace.h b/firmware/include/rb_namespace.h index 7bc711b5a6..5cd8c2dd29 100644 --- a/firmware/include/rb_namespace.h +++ b/firmware/include/rb_namespace.h | |||
@@ -37,6 +37,8 @@ struct ns_scan_info | |||
37 | }; | 37 | }; |
38 | 38 | ||
39 | /* root functions */ | 39 | /* root functions */ |
40 | #define ROOT_MAX_REALPATH 80 | ||
41 | const char* root_get_realpath(void); | ||
40 | int root_mount_path(const char *path, unsigned int flags); | 42 | int root_mount_path(const char *path, unsigned int flags); |
41 | void root_unmount_volume(IF_MV_NONVOID(int volume)); | 43 | void root_unmount_volume(IF_MV_NONVOID(int volume)); |
42 | int root_readdir_dirent(struct filestr_base *stream, | 44 | int root_readdir_dirent(struct filestr_base *stream, |
@@ -49,6 +51,7 @@ int ns_open_root(IF_MV(int volume,) unsigned int *callflagsp, | |||
49 | struct file_base_info *infop, uint16_t *attrp); | 51 | struct file_base_info *infop, uint16_t *attrp); |
50 | int ns_open_stream(const char *path, unsigned int callflags, | 52 | int ns_open_stream(const char *path, unsigned int callflags, |
51 | struct filestr_base *stream, struct ns_scan_info *scanp); | 53 | struct filestr_base *stream, struct ns_scan_info *scanp); |
54 | bool ns_volume_is_visible(IF_MV_NONVOID(int volume)); | ||
52 | 55 | ||
53 | /* closes the namespace stream */ | 56 | /* closes the namespace stream */ |
54 | static inline int ns_close_stream(struct filestr_base *stream) | 57 | static inline int ns_close_stream(struct filestr_base *stream) |