summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c21
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 @@
79#include "misc.h" 79#include "misc.h"
80#include "settings.h" 80#include "settings.h"
81#include "dir.h" 81#include "dir.h"
82#include "filefuncs.h" 82#include "pathfuncs.h"
83#include "structec.h" 83#include "structec.h"
84#include "debug.h" 84#include "debug.h"
85 85
@@ -88,6 +88,8 @@
88#include "eeprom_settings.h" 88#include "eeprom_settings.h"
89#endif 89#endif
90 90
91#undef HAVE_DIRCACHE
92
91#ifdef __PCTOOL__ 93#ifdef __PCTOOL__
92#define yield() do { } while(0) 94#define yield() do { } while(0)
93#define sim_sleep(timeout) do { } while(0) 95#define sim_sleep(timeout) do { } while(0)
@@ -2986,20 +2988,21 @@ static bool commit(void)
2986 /* Try to steal every buffer we can :) */ 2988 /* Try to steal every buffer we can :) */
2987 if (tempbuf_size == 0) 2989 if (tempbuf_size == 0)
2988 local_allocation = true; 2990 local_allocation = true;
2989 2991
2992#if 0 /* FIXME: How much big? dircache buffer can no longer be taken but
2993 may be freed to make room and the cache resumed. --jethead71 */
2990#ifdef HAVE_DIRCACHE 2994#ifdef HAVE_DIRCACHE
2991 if (tempbuf_size == 0) 2995 if (tempbuf_size == 0)
2992 { 2996 {
2993 /* Try to steal the dircache buffer. */ 2997 /* Shut down dircache to free its allocation. */
2994 tempbuf = dircache_steal_buffer(&tempbuf_size); 2998 dircache_free_buffer();
2995 tempbuf_size &= ~0x03;
2996
2997 if (tempbuf_size > 0) 2999 if (tempbuf_size > 0)
2998 { 3000 {
2999 dircache_buffer_stolen = true; 3001 dircache_buffer_stolen = true;
3000 } 3002 }
3001 } 3003 }
3002#endif 3004#endif
3005#endif
3003 3006
3004#ifdef HAVE_TC_RAMCACHE 3007#ifdef HAVE_TC_RAMCACHE
3005 if (tempbuf_size == 0 && tc_stat.ramcache_allocated > 0) 3008 if (tempbuf_size == 0 && tc_stat.ramcache_allocated > 0)
@@ -4462,7 +4465,7 @@ static bool check_dir(const char *dirname, int add_files)
4462 tc_stat.curentry = curpath; 4465 tc_stat.curentry = curpath;
4463 4466
4464 /* Add a new entry to the temporary db file. */ 4467 /* Add a new entry to the temporary db file. */
4465 add_tagcache(curpath, (info.wrtdate << 16) | info.wrttime 4468 add_tagcache(curpath, info.mtime
4466#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 4469#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
4467 , dir->internal_entry 4470 , dir->internal_entry
4468#endif 4471#endif
@@ -4780,7 +4783,7 @@ void tagcache_shutdown(void)
4780 /* Flush the command queue. */ 4783 /* Flush the command queue. */
4781 run_command_queue(true); 4784 run_command_queue(true);
4782 4785
4783#ifdef HAVE_EEPROM_SETTINGS 4786#if defined(HAVE_EEPROM_SETTINGS) && defined(HAVE_TC_RAMCACHE)
4784 if (tc_stat.ramcache) 4787 if (tc_stat.ramcache)
4785 tagcache_dumpsave(); 4788 tagcache_dumpsave();
4786#endif 4789#endif