Remove file expand, use seek for mass storage

This commit is contained in:
Willy-JL
2023-08-29 01:33:31 +02:00
parent 8bdbdaa6f5
commit 54804fcc66
10 changed files with 26 additions and 92 deletions

View File

@@ -396,22 +396,6 @@ static uint64_t storage_ext_file_tell(void* ctx, File* file) {
return position;
}
static bool storage_ext_file_expand(void* ctx, File* file, const uint64_t size) {
#ifdef FURI_RAM_EXEC
UNUSED(ctx);
UNUSED(file);
UNUSED(size);
file->error_id = FSE_NOT_READY;
#else
StorageData* storage = ctx;
SDFile* file_data = storage_get_storage_file_data(file, storage);
file->internal_error_id = f_expand(file_data, size, 1);
file->error_id = storage_ext_parse_error(file->internal_error_id);
#endif
return (file->error_id == FSE_OK);
}
static bool storage_ext_file_truncate(void* ctx, File* file) {
#ifdef FURI_RAM_EXEC
UNUSED(ctx);
@@ -625,7 +609,6 @@ static const FS_Api fs_api = {
.write = storage_ext_file_write,
.seek = storage_ext_file_seek,
.tell = storage_ext_file_tell,
.expand = storage_ext_file_expand,
.truncate = storage_ext_file_truncate,
.size = storage_ext_file_size,
.sync = storage_ext_file_sync,

View File

@@ -455,14 +455,6 @@ static uint64_t storage_int_file_tell(void* ctx, File* file) {
return position;
}
static bool storage_int_file_expand(void* ctx, File* file, const uint64_t size) {
UNUSED(ctx);
UNUSED(file);
UNUSED(size);
file->error_id = FSE_NOT_IMPLEMENTED;
return (file->error_id == FSE_OK);
}
static bool storage_int_file_truncate(void* ctx, File* file) {
StorageData* storage = ctx;
lfs_t* lfs = lfs_get_from_storage(storage);
@@ -711,7 +703,6 @@ static const FS_Api fs_api = {
.write = storage_int_file_write,
.seek = storage_int_file_seek,
.tell = storage_int_file_tell,
.expand = storage_int_file_expand,
.truncate = storage_int_file_truncate,
.size = storage_int_file_size,
.sync = storage_int_file_sync,