gefs: getblk(): remove duplicate getcallerpc(), check b->bp.gen from cache

This commit is contained in:
cinap_lenrek 2025-01-06 00:51:36 +00:00
parent 66d2e1ac59
commit c91fd35518

View file

@ -735,18 +735,15 @@ getblk(Bptr bp, int flg)
}
if((b = cacheget(bp.addr)) != nil){
assert(checkflag(b, 0, Bfreed));
b->lasthold = getcallerpc(&bp);
qunlock(&fs->blklk[i]);
poperror();
return b;
assert(b->bp.gen == bp.gen);
} else {
b = cachepluck();
b->alloced = getcallerpc(&bp);
readblk(b, bp, flg);
b->bp.gen = bp.gen;
cacheins(b);
}
b = cachepluck();
b->alloced = getcallerpc(&bp);
b->alloced = getcallerpc(&bp);
readblk(b, bp, flg);
b->bp.gen = bp.gen;
b->lasthold = getcallerpc(&bp);
cacheins(b);
qunlock(&fs->blklk[i]);
poperror();