-Cosmetic change in a comparison

-Move fat_dir structure out of dircache stack to RAM. Reduce dircache stack size (max level depth should stay be around 20). This should fix nano2g dircache stkov of FS#10679
-Change the structure returned by readdir_cached to match the one returned by readdir_uncached: remove useless fields to save space and avoid any potential incoherence
-Remove one field from the internal structure used by {opend,read,close}dir_cached because it was mostly redundant.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24708 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2010-02-16 22:49:11 +00:00
parent f82c021b8b
commit 53b1af7a61
3 changed files with 61 additions and 53 deletions

View file

@ -76,11 +76,20 @@ struct dircache_entry {
char *d_name;
};
struct dirent_cached {
char *d_name;
int attribute;
long size;
long startcluster;
unsigned short wrtdate; /* Last write date */
unsigned short wrttime; /* Last write time */
};
typedef struct {
bool busy;
struct dircache_entry *entry;
struct dircache_entry *internal_entry;
struct dircache_entry secondary_entry;
struct dirent_cached theent; /* .attribute is set to -1 on init(opendir) */
/* the two following field can't be used at the same time so have an union */
struct dircache_entry *internal_entry; /* the current entry in the directory */
DIR_UNCACHED *regulardir;
} DIR_CACHED;
@ -111,7 +120,7 @@ void dircache_rename(const char *oldpath, const char *newpath);
void dircache_add_file(const char *path, long startcluster);
DIR_CACHED* opendir_cached(const char* name);
struct dircache_entry* readdir_cached(DIR_CACHED* dir);
struct dirent_cached* readdir_cached(DIR_CACHED* dir);
int closedir_cached(DIR_CACHED *dir);
int mkdir_cached(const char *name);
int rmdir_cached(const char* name);