From 9daacabd658508d2607a64b288c9bce7a635fb15 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 3 Mar 2022 07:37:03 -0500 Subject: [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 --- firmware/common/dircache.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'firmware/common/dircache.c') 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) */ int dircache_readdir_dirent(struct filestr_base *stream, struct dirscan_info *scanp, - struct dirent *entry) + struct DIRENT *entry) { struct file_base_info *dirinfop = stream->infop; @@ -1760,7 +1760,7 @@ static int sab_process_volume(IF_MV(int volume,) struct dircache_entry *ce) return sab_process_dir(ce); } -int dircache_readdir_r(struct dircache_dirscan *dir, struct dirent *result) +int dircache_readdir_r(struct dircache_dirscan *dir, struct DIRENT *result) { if (dircache_state != DIRCACHE_READY) 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) cename = ""; #ifdef HAVE_MULTIVOLUME + /* prepend the volume specifier */ int volume = IF_MV_VOL(-idx - 1); - if (volume > 0) - { - /* prepend the volume specifier for volumes > 0 */ - cename = alloca(VOL_MAX_LEN+1); - get_volume_name(volume, cename); - } + cename = alloca(VOL_MAX_LEN+1); + get_volume_name(volume, cename); #endif /* HAVE_MULTIVOLUME */ data->serialhash = dc_hash_serialnum(get_idx_dcvolp(idx)->serialnum, -- cgit v1.2.3