diff options
author | Michael Hohmuth <sideral@rockbox.org> | 2011-08-04 23:03:27 +0000 |
---|---|---|
committer | Michael Hohmuth <sideral@rockbox.org> | 2011-08-04 23:03:27 +0000 |
commit | fa81cdc61a58848708481322812c80c62f0b3bf6 (patch) | |
tree | 91ec55bb1e45e60afdf7d0e797aadb23ca772e7b /apps | |
parent | 32dfc0cdc19eca850aab4fd994b32f8a1528e4c6 (diff) |
Database: find_entry_ram: Avoid dircache use if it's not ready
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30254 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tagcache.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 7f33db7cf5..1889237b3a 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -392,7 +392,7 @@ static long find_entry_ram(const char *filename, int dc) int i; /* Check if tagcache is loaded into ram. */ - if (!tc_stat.ramcache) + if (!tc_stat.ramcache || !is_dircache_intact()) return -1; if (dc < 0) @@ -540,8 +540,7 @@ static int find_index(const char *filename) long idx_id = -1; #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) - if (tc_stat.ramcache && is_dircache_intact()) - idx_id = find_entry_ram(filename, -1); + idx_id = find_entry_ram(filename, -1); #endif if (idx_id < 0) @@ -1799,10 +1798,7 @@ static void __attribute__ ((noinline)) add_tagcache(char *path, /* Check if the file is already cached. */ #if defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE) - if (tc_stat.ramcache && is_dircache_intact()) - { - idx_id = find_entry_ram(path, dc); - } + idx_id = find_entry_ram(path, dc); #endif /* Be sure the entry doesn't exist. */ |