[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

@@ -49,7 +49,7 @@ static bool archive_favorites_read_line(File* file, string_t str_result) {
uint16_t archive_favorites_count(void* context) {
furi_assert(context);
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
string_t buffer;
@@ -74,7 +74,7 @@ uint16_t archive_favorites_count(void* context) {
string_clear(buffer);
storage_file_free(file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return lines;
}
@@ -82,7 +82,7 @@ uint16_t archive_favorites_count(void* context) {
static bool archive_favourites_rescan() {
string_t buffer;
string_init(buffer);
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
File* fav_item_file = storage_file_alloc(fs_api);
@@ -122,7 +122,7 @@ static bool archive_favourites_rescan() {
storage_file_free(file);
storage_file_free(fav_item_file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return result;
}
@@ -131,7 +131,7 @@ bool archive_favorites_read(void* context) {
furi_assert(context);
ArchiveBrowserView* browser = context;
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
File* fav_item_file = storage_file_alloc(fs_api);
@@ -184,7 +184,7 @@ bool archive_favorites_read(void* context) {
string_clear(buffer);
storage_file_free(file);
storage_file_free(fav_item_file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
archive_set_item_count(browser, file_count);
@@ -204,7 +204,7 @@ bool archive_favorites_delete(const char* format, ...) {
va_end(args);
string_init(buffer);
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
bool result = storage_file_open(file, ARCHIVE_FAV_PATH, FSAM_READ, FSOM_OPEN_EXISTING);
@@ -233,7 +233,7 @@ bool archive_favorites_delete(const char* format, ...) {
storage_common_remove(fs_api, ARCHIVE_FAV_TEMP_PATH);
storage_file_free(file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return result;
}
@@ -247,7 +247,7 @@ bool archive_is_favorite(const char* format, ...) {
va_end(args);
string_init(buffer);
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
bool found = false;
@@ -272,7 +272,7 @@ bool archive_is_favorite(const char* format, ...) {
string_clear(buffer);
string_clear(filename);
storage_file_free(file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return found;
}
@@ -281,7 +281,7 @@ bool archive_favorites_rename(const char* src, const char* dst) {
furi_assert(src);
furi_assert(dst);
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
string_t path;
@@ -318,7 +318,7 @@ bool archive_favorites_rename(const char* src, const char* dst) {
storage_common_remove(fs_api, ARCHIVE_FAV_TEMP_PATH);
storage_file_free(file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
return result;
}
@@ -333,7 +333,7 @@ void archive_favorites_save(void* context) {
furi_assert(context);
ArchiveBrowserView* browser = context;
Storage* fs_api = furi_record_open("storage");
Storage* fs_api = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(fs_api);
for(size_t i = 0; i < archive_file_get_array_size(browser); i++) {
@@ -346,5 +346,5 @@ void archive_favorites_save(void* context) {
storage_common_remove(fs_api, ARCHIVE_FAV_TEMP_PATH);
storage_file_free(file);
furi_record_close("storage");
furi_record_close(RECORD_STORAGE);
}