t: Restricted LFS_ERR_BUSY to only LFS_T_EXCL

So now lfsr_traversal_read will only return LFS_ERR_BUSY if LFS_T_EXCL
was provided to lfsr_traversal_open.

This means it's no longer possible to opportunistically traverse blocks,
_and_ detect mutation in the same traversal (though I suppose you could
open multiple traversals for this?), but on the flipside this
potentially frees up the implementation a bit.

This motivation for this is that LFS_ERR_BUSY is potentially confusing
and annoying to handle if you don't care about mutation.

           code          stack
  before: 34566           2624
  after:  34558 (-0.0%)   2624 (+0.0%)
This commit is contained in:
Christopher Haster
2024-06-20 11:24:57 -05:00
parent 7e96ff4dbd
commit 0502cb8f92
3 changed files with 70 additions and 61 deletions
+1 -4
View File
@@ -9532,10 +9532,7 @@ done:;
lfs_alloc_markfree(lfs);
}
// return BUSY if we're dirty, NOENT if we're clean
return (lfsr_f_isdirty(t->mt.o.flags))
? LFS_ERR_BUSY
: LFS_ERR_NOENT;
return LFS_ERR_NOENT;
}
static int lfsr_traversal_rewind_(lfs_t *lfs, lfsr_traversal_t *t) {