diff options
author | William Wilgus <wilgus.william@gmail.com> | 2022-03-03 07:37:03 -0500 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2022-03-03 18:58:07 -0500 |
commit | 9daacabd658508d2607a64b288c9bce7a635fb15 (patch) | |
tree | ce96538ea82a4176f00f8eb9531711db7dea5750 /firmware/common/dircache.c | |
parent | f88ea12bacf381ad4f39ba2328c806e772c0dda8 (diff) | |
download | rockbox-9daacabd658508d2607a64b288c9bce7a635fb15.tar.gz rockbox-9daacabd658508d2607a64b288c9bce7a635fb15.zip |
[RESTORED!] Allow mounting of any directory as the root directory.
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.
Defaults are in export/rbpaths.h
It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.
Change-Id: I3b5a14c530ff4b10d97f67636237d96875eb8969
Author: Michael Sevakis
Diffstat (limited to 'firmware/common/dircache.c')
-rw-r--r-- | firmware/common/dircache.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 3b880d3382..7a84b761a0 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c | |||
@@ -1473,7 +1473,7 @@ static void sab_process_volume(struct dircache_volume *dcvolp) | |||
1473 | */ | 1473 | */ |
1474 | int dircache_readdir_dirent(struct filestr_base *stream, | 1474 | int dircache_readdir_dirent(struct filestr_base *stream, |
1475 | struct dirscan_info *scanp, | 1475 | struct dirscan_info *scanp, |
1476 | struct dirent *entry) | 1476 | struct DIRENT *entry) |
1477 | { | 1477 | { |
1478 | struct file_base_info *dirinfop = stream->infop; | 1478 | struct file_base_info *dirinfop = stream->infop; |
1479 | 1479 | ||
@@ -1760,7 +1760,7 @@ static int sab_process_volume(IF_MV(int volume,) struct dircache_entry *ce) | |||
1760 | return sab_process_dir(ce); | 1760 | return sab_process_dir(ce); |
1761 | } | 1761 | } |
1762 | 1762 | ||
1763 | int dircache_readdir_r(struct dircache_dirscan *dir, struct dirent *result) | 1763 | int dircache_readdir_r(struct dircache_dirscan *dir, struct DIRENT *result) |
1764 | { | 1764 | { |
1765 | if (dircache_state != DIRCACHE_READY) | 1765 | if (dircache_state != DIRCACHE_READY) |
1766 | return readdir_r(dir->###########3, result, &result); | 1766 | return readdir_r(dir->###########3, result, &result); |
@@ -2541,13 +2541,10 @@ static ssize_t get_path_sub(int idx, struct get_path_sub_data *data) | |||
2541 | cename = ""; | 2541 | cename = ""; |
2542 | 2542 | ||
2543 | #ifdef HAVE_MULTIVOLUME | 2543 | #ifdef HAVE_MULTIVOLUME |
2544 | /* prepend the volume specifier */ | ||
2544 | int volume = IF_MV_VOL(-idx - 1); | 2545 | int volume = IF_MV_VOL(-idx - 1); |
2545 | if (volume > 0) | 2546 | cename = alloca(VOL_MAX_LEN+1); |
2546 | { | 2547 | get_volume_name(volume, cename); |
2547 | /* prepend the volume specifier for volumes > 0 */ | ||
2548 | cename = alloca(VOL_MAX_LEN+1); | ||
2549 | get_volume_name(volume, cename); | ||
2550 | } | ||
2551 | #endif /* HAVE_MULTIVOLUME */ | 2548 | #endif /* HAVE_MULTIVOLUME */ |
2552 | 2549 | ||
2553 | data->serialhash = dc_hash_serialnum(get_idx_dcvolp(idx)->serialnum, | 2550 | data->serialhash = dc_hash_serialnum(get_idx_dcvolp(idx)->serialnum, |