summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-03-08 11:49:55 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-03-08 11:51:34 -0500
commite3081b35cdeb1e568c61369e5b3b15b6e428d3c3 (patch)
treea736fee7726ee7848a4d439b021b8ceec02c2223
parent1ba5ef716d37a9fe7f0863caed2fab8570b2c7c4 (diff)
downloadrockbox-e3081b35cdeb1e568c61369e5b3b15b6e428d3c3.tar.gz
rockbox-e3081b35cdeb1e568c61369e5b3b15b6e428d3c3.zip
Fix a couple dircache oopsies.
Moving binding from queued to resolved was messed up if it was the first queued one and there were other resolved files open at the time of resolving it. Dircache info for a directory about to be recursively scanned should be filled before opening it. Would only affect a directory if it happened to be opening while it was being initialized. Change-Id: I26ccf219c382d7caf1424b5ddddc4793e74cb390
-rw-r--r--firmware/common/dircache.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 8a75f3bbad..08457f2da1 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -425,15 +425,18 @@ static void binding_resolve(const struct file_base_info *infop)
425 } 425 }
426 426
427 if (p == dcrivolp->queued0) 427 if (p == dcrivolp->queued0)
428 {
428 dcrivolp->queued0 = BINDING_NEXT(p); 429 dcrivolp->queued0 = BINDING_NEXT(p);
430 if (dcrivolp->resolved0 == NULL)
431 dcrivolp->resolved0 = p;
432 }
429 else 433 else
430 { 434 {
431 file_binding_remove_next(prevp, p); 435 file_binding_remove_next(prevp, p);
432 file_binding_insert_first(p); 436 file_binding_insert_first(p);
437 dcrivolp->resolved0 = p;
433 } 438 }
434 439
435 dcrivolp->resolved0 = p;
436
437 /* srcinfop may be the actual one */ 440 /* srcinfop may be the actual one */
438 if (&p->info != infop) 441 if (&p->info != infop)
439 p->info.dcfile = infop->dcfile; 442 p->info.dcfile = infop->dcfile;
@@ -1375,6 +1378,8 @@ static void sab_process_sub(struct sab *sabp)
1375 infop->fatfile.dircluster = dircluster; 1378 infop->fatfile.dircluster = dircluster;
1376 infop->fatfile.e.entry = ce->direntry; 1379 infop->fatfile.e.entry = ce->direntry;
1377 infop->fatfile.e.entries = ce->direntries; 1380 infop->fatfile.e.entries = ce->direntries;
1381 infop->dcfile.idx = idx;
1382 infop->dcfile.serialnum = ce->serialnum;
1378 } /* end while */ 1383 } /* end while */
1379} 1384}
1380 1385