forked from Imagelibrary/littlefs
Renamed lfs_fs_findfreeblocks -> lfs_fs_gc, tweaked documentation
The idea is in the future this function may be extended to support other block janitorial work. In such a case calling this lfs_fs_gc provides a more general name that can include other operations. This is currently just wishful thinking, however.
This commit is contained in:
@@ -26,7 +26,7 @@ code = '''
|
||||
}
|
||||
for (int n = 0; n < FILES; n++) {
|
||||
if (GC) {
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
}
|
||||
size_t size = strlen(names[n]);
|
||||
for (lfs_size_t i = 0; i < SIZE; i += size) {
|
||||
@@ -81,7 +81,7 @@ code = '''
|
||||
memcpy(buffer, names[n], size);
|
||||
for (int i = 0; i < SIZE; i += size) {
|
||||
if (GC) {
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
}
|
||||
lfs_file_write(&lfs, &file, buffer, size) => size;
|
||||
}
|
||||
@@ -255,8 +255,8 @@ code = '''
|
||||
}
|
||||
res => LFS_ERR_NOSPC;
|
||||
|
||||
// note that lfs_fs_findfreeblocks should not error here
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
// note that lfs_fs_gc should not error here
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
|
||||
lfs_file_close(&lfs, &file) => 0;
|
||||
lfs_unmount(&lfs) => 0;
|
||||
@@ -309,8 +309,8 @@ code = '''
|
||||
}
|
||||
res => LFS_ERR_NOSPC;
|
||||
|
||||
// note that lfs_fs_findfreeblocks should not error here
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
// note that lfs_fs_gc should not error here
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
|
||||
lfs_file_close(&lfs, &file) => 0;
|
||||
lfs_unmount(&lfs) => 0;
|
||||
@@ -351,8 +351,8 @@ code = '''
|
||||
count += 1;
|
||||
}
|
||||
err => LFS_ERR_NOSPC;
|
||||
// note that lfs_fs_findfreeblocks should not error here
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
// note that lfs_fs_gc should not error here
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
lfs_file_close(&lfs, &file) => 0;
|
||||
|
||||
lfs_remove(&lfs, "exhaustion") => 0;
|
||||
@@ -451,8 +451,8 @@ code = '''
|
||||
break;
|
||||
}
|
||||
}
|
||||
// note that lfs_fs_findfreeblocks should not error here
|
||||
lfs_fs_findfreeblocks(&lfs) => 0;
|
||||
// note that lfs_fs_gc should not error here
|
||||
lfs_fs_gc(&lfs) => 0;
|
||||
lfs_file_close(&lfs, &file) => 0;
|
||||
|
||||
lfs_unmount(&lfs) => 0;
|
||||
|
||||
Reference in New Issue
Block a user