diff options
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r-- | apps/tagcache.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index b7d5516e81..2b6041227b 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -79,7 +79,7 @@ #include "misc.h" #include "settings.h" #include "dir.h" -#include "filefuncs.h" +#include "pathfuncs.h" #include "structec.h" #include "debug.h" @@ -88,6 +88,8 @@ #include "eeprom_settings.h" #endif +#undef HAVE_DIRCACHE + #ifdef __PCTOOL__ #define yield() do { } while(0) #define sim_sleep(timeout) do { } while(0) @@ -2986,20 +2988,21 @@ static bool commit(void) /* Try to steal every buffer we can :) */ if (tempbuf_size == 0) local_allocation = true; - + +#if 0 /* FIXME: How much big? dircache buffer can no longer be taken but + may be freed to make room and the cache resumed. --jethead71 */ #ifdef HAVE_DIRCACHE if (tempbuf_size == 0) { - /* Try to steal the dircache buffer. */ - tempbuf = dircache_steal_buffer(&tempbuf_size); - tempbuf_size &= ~0x03; - + /* Shut down dircache to free its allocation. */ + dircache_free_buffer(); if (tempbuf_size > 0) { dircache_buffer_stolen = true; } } -#endif +#endif +#endif #ifdef HAVE_TC_RAMCACHE if (tempbuf_size == 0 && tc_stat.ramcache_allocated > 0) @@ -4462,7 +4465,7 @@ static bool check_dir(const char *dirname, int add_files) tc_stat.curentry = curpath; /* Add a new entry to the temporary db file. */ - add_tagcache(curpath, (info.wrtdate << 16) | info.wrttime + add_tagcache(curpath, info.mtime #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) , dir->internal_entry #endif @@ -4780,7 +4783,7 @@ void tagcache_shutdown(void) /* Flush the command queue. */ run_command_queue(true); -#ifdef HAVE_EEPROM_SETTINGS +#if defined(HAVE_EEPROM_SETTINGS) && defined(HAVE_TC_RAMCACHE) if (tc_stat.ramcache) tagcache_dumpsave(); #endif |