DB commit: Prefer using the database's RAM buffer over the dircache buffer The intention is to leave the dircache buffer intact and avoid having to rebuild the dircache after a commit. --- apps/tagcache.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/tagcache.c b/apps/tagcache.c index 5abb32a..ea45eae 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -2963,6 +2963,15 @@ static bool commit(void) if (tempbuf_size == 0) local_allocation = true; +#ifdef HAVE_TC_RAMCACHE + if (tempbuf_size == 0 && tc_stat.ramcache_allocated > 0) + { + tempbuf = (char *)(hdr + 1); + tempbuf_size = tc_stat.ramcache_allocated - sizeof(struct ramcache_header) - 128; + tempbuf_size &= ~0x03; + } +#endif + #ifdef HAVE_DIRCACHE if (tempbuf_size == 0) { @@ -2977,15 +2986,6 @@ static bool commit(void) } #endif -#ifdef HAVE_TC_RAMCACHE - if (tempbuf_size == 0 && tc_stat.ramcache_allocated > 0) - { - tempbuf = (char *)(hdr + 1); - tempbuf_size = tc_stat.ramcache_allocated - sizeof(struct ramcache_header) - 128; - tempbuf_size &= ~0x03; - } -#endif - /* And finally fail if there are no buffers available. */ if (tempbuf_size == 0) { -- 1.7.1