summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-08-04 23:22:15 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-08-04 23:22:15 +0000
commit211c082d91cbdaf8b1953f263e687c2a8f66148c (patch)
treeb68787092935b8f2115357a61b08eb2e44dc515e
parent3049a6bd04fdc4865de792adfc8b5474ef07b660 (diff)
downloadrockbox-211c082d91cbdaf8b1953f263e687c2a8f66148c.tar.gz
rockbox-211c082d91cbdaf8b1953f263e687c2a8f66148c.zip
Database: find_entry_ram: Avoid dircache use if it's not ready
git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_9@30256 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagcache.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 017d1326aa..9f4769258f 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -390,7 +390,7 @@ static long find_entry_ram(const char *filename,
390 int i; 390 int i;
391 391
392 /* Check if tagcache is loaded into ram. */ 392 /* Check if tagcache is loaded into ram. */
393 if (!tc_stat.ramcache) 393 if (!tc_stat.ramcache || !is_dircache_intact())
394 return -1; 394 return -1;
395 395
396 if (dc == NULL) 396 if (dc == NULL)
@@ -538,8 +538,7 @@ static int find_index(const char *filename)
538 long idx_id = -1; 538 long idx_id = -1;
539 539
540#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 540#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
541 if (tc_stat.ramcache && is_dircache_intact()) 541 idx_id = find_entry_ram(filename, NULL);
542 idx_id = find_entry_ram(filename, NULL);
543#endif 542#endif
544 543
545 if (idx_id < 0) 544 if (idx_id < 0)
@@ -1804,10 +1803,7 @@ static void __attribute__ ((noinline)) add_tagcache(char *path,
1804 1803
1805 /* Check if the file is already cached. */ 1804 /* Check if the file is already cached. */
1806#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) 1805#if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
1807 if (tc_stat.ramcache && is_dircache_intact()) 1806 idx_id = find_entry_ram(path, dc);
1808 {
1809 idx_id = find_entry_ram(path, dc);
1810 }
1811#endif 1807#endif
1812 1808
1813 /* Be sure the entry doesn't exist. */ 1809 /* Be sure the entry doesn't exist. */