mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-19 23:03:55 +00:00
Don't count a sector in the cache unless we manage to create it.
This commit is contained in:
parent
f2314b445d
commit
af6b9f17f9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=114035
|
@ -231,10 +231,10 @@ g_bde_get_sector(struct g_bde_work *wp, off_t offset)
|
|||
if (sp != NULL && sp->ref > 0)
|
||||
sp = NULL;
|
||||
if (sp == NULL) {
|
||||
g_bde_ncache++;
|
||||
sc->ncache++;
|
||||
sp = g_bde_new_sector(wp, sc->sectorsize);
|
||||
if (sp != NULL) {
|
||||
g_bde_ncache++;
|
||||
sc->ncache++;
|
||||
TAILQ_INSERT_TAIL(&sc->freelist, sp, list);
|
||||
sp->malloc = 2;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue