aboutsummaryrefslogtreecommitdiff
path: root/file.h
diff options
context:
space:
mode:
authorStephen Crane <cranes@google.com>2022-11-11 23:31:43 +0000
committerStephen Crane <cranes@google.com>2022-12-06 07:36:41 +0000
commite5c66a9c2cbf158b860d8efbcf51067efaa2a4f2 (patch)
tree16b47cf1eb88fba1c0cd59e08f8e27f065d2ff15 /file.h
parentdbffd16e6d0d4ecb894768b9d4457429f0d6de90 (diff)
downloadstorage-e5c66a9c2cbf158b860d8efbcf51067efaa2a4f2.tar.gz
storage: Add functionality to rebuild the free set
If we replace corrupted file(s), we may lose blocks that are now free but we couldn't walk the tree to find them. This change allows the free set to be entirely rebuilt by walking the file tree and noting all blocks in use. Bug: 244608684 Test: build.py generic-arm64-test-debug --test storage_block_test Change-Id: Id669b12e1f4c4f50999ee4287019d69ef05a1d15
Diffstat (limited to 'file.h')
-rw-r--r--file.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/file.h b/file.h
index 56e1758..d6fd2ce 100644
--- a/file.h
+++ b/file.h
@@ -20,6 +20,7 @@
#include "block_cache.h"
#include "block_mac.h"
+struct block_set;
struct fs;
struct transaction;
@@ -104,6 +105,9 @@ void file_transaction_complete_failed(struct transaction* tr);
void file_transaction_success(struct transaction* tr);
void file_transaction_failed(struct transaction* tr);
+void files_rebuild_free_set(struct transaction* tr,
+ struct block_set* new_free_set,
+ struct block_mac* files_root);
/* TODO: move to dir? */
enum file_create_mode {