1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2017-03-08 11:49:55 -05:00
parent 1ba5ef716d
commit e3081b35cd

View file

@ -425,14 +425,17 @@ static void binding_resolve(const struct file_base_info *infop)
} }
if (p == dcrivolp->queued0) if (p == dcrivolp->queued0)
{
dcrivolp->queued0 = BINDING_NEXT(p); dcrivolp->queued0 = BINDING_NEXT(p);
if (dcrivolp->resolved0 == NULL)
dcrivolp->resolved0 = p;
}
else else
{ {
file_binding_remove_next(prevp, p); file_binding_remove_next(prevp, p);
file_binding_insert_first(p); file_binding_insert_first(p);
}
dcrivolp->resolved0 = p; dcrivolp->resolved0 = p;
}
/* srcinfop may be the actual one */ /* srcinfop may be the actual one */
if (&p->info != infop) if (&p->info != infop)
@ -1375,6 +1378,8 @@ static void sab_process_sub(struct sab *sabp)
infop->fatfile.dircluster = dircluster; infop->fatfile.dircluster = dircluster;
infop->fatfile.e.entry = ce->direntry; infop->fatfile.e.entry = ce->direntry;
infop->fatfile.e.entries = ce->direntries; infop->fatfile.e.entries = ce->direntries;
infop->dcfile.idx = idx;
infop->dcfile.serialnum = ce->serialnum;
} /* end while */ } /* end while */
} }