gc: Dropped lfsr_gc_setflags/setsteps
Now that you can provide gc_flags/gc_steps in lfs_config, I think it's a
bit more clear that _mutating_ the flags/steps is a niche feature, and
not worth implementing/testing.
It raises the question why not have a similar lfsr_setflags or
lfsr_file_setflags, and the answer there is it would be a pain-in-the-
ass to make sure all possible corner cases are covered.
It actually already was a pain-in-the-ass to test lfsr_gcsetflags/
setsteps... but just because we already did the work is not a good
reason for keeping complexity around.
---
Note that most of the use cases for lfsr_gc_setflags/setsteps can be
covered by either remounting the filesystem or through the
lfsr_traversal_t APIs directly.
The end result is a bit of code savings when incremental gc is enabled:
code stack ctx
default before: 37796 2608 620
default after: 37796 (+0.0%) 2608 (+0.0%) 620 (+0.0%)
gc before: 37944 2608 768
gc after 37896 (-0.1%) 2608 (+0.0%) 768 (+0.0%)
This commit is contained in:
@@ -1270,27 +1270,6 @@ int lfsr_traversal_rewind(lfs_t *lfs, lfsr_traversal_t *t);
|
||||
int lfsr_gc(lfs_t *lfs);
|
||||
#endif
|
||||
|
||||
#ifdef LFS_GC
|
||||
// Sets the gc flags.
|
||||
//
|
||||
// Returns a negative error code on failure.
|
||||
int lfsr_gc_setflags(lfs_t *lfs, uint32_t flags);
|
||||
#endif
|
||||
|
||||
#ifdef LFS_GC
|
||||
// Sets the number of gc steps per lfsr_gc call, with each step being
|
||||
// ~1 block of work.
|
||||
//
|
||||
// More steps per call will make more progress if interleaved with
|
||||
// other filesystem operations, but may also introduce more latency.
|
||||
// steps=1 will do the minimum amount of work to make progress, and
|
||||
// steps=-1 will not return until all pending janitorial work has
|
||||
// been completed.
|
||||
//
|
||||
// Returns a negative error code on failure.
|
||||
int lfsr_gc_setsteps(lfs_t *lfs, lfs_soff_t steps);
|
||||
#endif
|
||||
|
||||
|
||||
/// Filesystem-level filesystem operations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user