[FL-2675] /int space reservation (#1448)

* storage: added global #defines for /int, /ext & /any
* storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros
* core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction
* storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders
* core: added macro aliases for core record names
* Bumped protobuf commit pointer
* storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
hedger
2022-07-26 15:21:51 +03:00
committed by GitHub
parent 52a83fc929
commit 056446dfed
171 changed files with 1111 additions and 910 deletions

View File

@@ -226,7 +226,7 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
furi_assert(subghz);
furi_assert(file_path);
Storage* storage = furi_record_open("storage");
Storage* storage = furi_record_open(RECORD_STORAGE);
FlipperFormat* fff_data_file = flipper_format_file_alloc(storage);
Stream* fff_data_stream = flipper_format_get_raw_stream(subghz->txrx->fff_data);
@@ -308,7 +308,7 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
string_clear(temp_str);
flipper_format_free(fff_data_file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
switch(load_key_state) {
case SubGhzLoadKeyStateParseErr:
@@ -335,7 +335,7 @@ bool subghz_key_load(SubGhz* subghz, const char* file_path, bool show_dialog) {
bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len) {
furi_assert(subghz);
Storage* storage = furi_record_open("storage");
Storage* storage = furi_record_open(RECORD_STORAGE);
string_t temp_str;
string_t file_name;
string_t file_path;
@@ -372,7 +372,7 @@ bool subghz_get_next_name_file(SubGhz* subghz, uint8_t max_len) {
string_clear(temp_str);
string_clear(file_path);
string_clear(file_name);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return res;
}
@@ -385,7 +385,7 @@ bool subghz_save_protocol_to_file(
furi_assert(flipper_format);
furi_assert(dev_file_name);
Storage* storage = furi_record_open("storage");
Storage* storage = furi_record_open(RECORD_STORAGE);
Stream* flipper_format_stream = flipper_format_get_raw_stream(flipper_format);
bool saved = false;
@@ -414,7 +414,7 @@ bool subghz_save_protocol_to_file(
saved = true;
} while(0);
string_clear(file_dir);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return saved;
}
@@ -447,7 +447,7 @@ bool subghz_rename_file(SubGhz* subghz) {
furi_assert(subghz);
bool ret = true;
Storage* storage = furi_record_open("storage");
Storage* storage = furi_record_open(RECORD_STORAGE);
if(string_cmp(subghz->file_path_tmp, subghz->file_path)) {
FS_Error fs_result = storage_common_rename(
@@ -458,7 +458,7 @@ bool subghz_rename_file(SubGhz* subghz) {
ret = false;
}
}
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return ret;
}
@@ -466,9 +466,9 @@ bool subghz_rename_file(SubGhz* subghz) {
bool subghz_delete_file(SubGhz* subghz) {
furi_assert(subghz);
Storage* storage = furi_record_open("storage");
Storage* storage = furi_record_open(RECORD_STORAGE);
bool result = storage_simply_remove(storage, string_get_cstr(subghz->file_path_tmp));
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
subghz_file_name_clear(subghz);