trv: Reverted dropped fixgrm call
See previous commit for motivation. This was an attempt to simplify
lfs3_trv_read that wasn't worth it.
Code changes:
code stack ctx
before: 35112 2136 660
after: 35164 (+0.1%) 2136 (+0.0%) 660 (+0.0%)
code stack ctx
gbmap before: 38040 2136 776
gbmap after: 38088 (+0.1%) 2136 (+0.0%) 776 (+0.0%)
This commit is contained in:
@@ -16812,6 +16812,21 @@ int lfs3_trv_read(lfs3_t *lfs3, lfs3_trv_t *trv,
|
||||
return LFS3_ERR_BUSY;
|
||||
}
|
||||
|
||||
// check for pending grms every step, just in case some other
|
||||
// operation introduced new grms
|
||||
#ifndef LFS3_RDONLY
|
||||
if (lfs3_t_ismkconsistent(trv->gc.t.h.flags)
|
||||
&& lfs3_grm_count(lfs3) > 0) {
|
||||
uint32_t dirty = trv->gc.t.h.flags;
|
||||
int err = lfs3_fs_fixgrm(lfs3);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
// reset dirty flag
|
||||
trv->gc.t.h.flags &= ~LFS3_t_DIRTY | dirty;
|
||||
}
|
||||
#endif
|
||||
|
||||
// discard current block queue?
|
||||
if (lfs3_t_isstale(trv->gc.t.h.flags)) {
|
||||
trv->blocks[0] = -1;
|
||||
|
||||
Reference in New Issue
Block a user