Do an explicit retry after we have dumped the cache, rather than a
(potential) tail recursion.
This commit is contained in:
parent
e8e0742ef4
commit
9b99e39d61
@ -251,15 +251,12 @@ g_bde_get_sector(struct g_bde_work *wp, off_t offset)
|
||||
if (sp != NULL) {
|
||||
TAILQ_REMOVE(&sc->freelist, sp, list);
|
||||
TAILQ_INSERT_TAIL(&sc->freelist, sp, list);
|
||||
sp->used = time_uptime;
|
||||
}
|
||||
wp->ksp = sp;
|
||||
if (sp == NULL) {
|
||||
g_bde_purge_sector(sc, -1);
|
||||
sp = g_bde_get_sector(wp, offset);
|
||||
}
|
||||
if (sp != NULL)
|
||||
sp->used = time_uptime;
|
||||
KASSERT(sp != NULL, ("get_sector failed"));
|
||||
return(sp);
|
||||
}
|
||||
|
||||
@ -336,6 +333,8 @@ g_bde_read_keysector(struct g_bde_softc *sc, struct g_bde_work *wp)
|
||||
|
||||
g_trace(G_T_TOPOLOGY, "g_bde_read_keysector(%p)", wp);
|
||||
sp = g_bde_get_sector(wp, wp->kso);
|
||||
if (sp == NULL)
|
||||
sp = g_bde_get_sector(wp, wp->kso);
|
||||
if (sp == NULL)
|
||||
return (sp);
|
||||
if (sp->owner != wp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user