/trusty/user/app/storage/ |
D | super.c | 200 uint32_t block_size = tr->fs->super_dev->block_size; in update_super_block_internal() 204 if (!tr->fs->writable) { in update_super_block_internal() 213 assert(tr->fs->initial_super_block_tr == NULL || in update_super_block_internal() 214 tr->fs->initial_super_block_tr == tr); in update_super_block_internal() 216 ver = (tr->fs->super_block_version + 1) & SUPER_BLOCK_FLAGS_VERSION_MASK; in update_super_block_internal() 230 if (tr->fs->alternate_data) { in update_super_block_internal() 233 if (tr->repaired || tr->fs->main_repaired) { in update_super_block_internal() 240 assert(!tr->repaired || !tr->fs->alternate_data); in update_super_block_internal() 254 if (tr->fs->needs_full_scan) { in update_super_block_internal() 259 tr->fs->super_block[index], ver); in update_super_block_internal() [all …]
|
D | fs.h | 135 struct fs { struct 170 void fs_mark_scan_required(struct fs* fs); argument 217 int fs_init(struct fs* fs, 224 static inline bool fs_is_repaired(struct fs* fs) { in fs_is_repaired() argument 225 return fs->main_repaired && !fs->alternate_data; in fs_is_repaired() 228 static inline bool fs_is_readable(struct fs* fs) { in fs_is_readable() argument 229 return fs->readable; in fs_is_readable() 232 static inline bool fs_is_writable(struct fs* fs) { in fs_is_writable() argument 233 return fs->writable; in fs_is_writable() 277 enum fs_check_result fs_check_full(struct fs* fs); [all …]
|
D | block_mac.c | 24 static size_t block_mac_block_size(const struct fs* fs) { in block_mac_block_size() argument 25 size_t size = fs->block_num_size; in block_mac_block_size() 31 static size_t block_mac_mac_size(const struct fs* fs) { in block_mac_mac_size() argument 32 size_t size = fs->mac_size; in block_mac_mac_size() 39 memset(dest, 0, block_mac_block_size(tr->fs) + block_mac_mac_size(tr->fs)); in block_mac_clear() 42 data_block_t block_mac_to_block_fs(const struct fs* fs, in block_mac_to_block_fs() argument 46 memcpy(&block, block_mac->data, block_mac_block_size(fs)); in block_mac_to_block_fs() 54 return block_mac_to_block_fs(tr->fs, block_mac); in block_mac_to_block() 59 return block_mac->data + block_mac_block_size(tr->fs); in block_mac_to_mac() 65 memcpy(block_mac->data, &block, block_mac_block_size(tr->fs)); in block_mac_set_block() [all …]
|
D | transaction.c | 166 .start = tr->fs->min_block_num, in transaction_rebuild_free_set() 167 .end = tr->fs->dev->block_count, in transaction_rebuild_free_set() 184 list_add_tail(&tr->fs->allocated, &previously_allocated.node); in transaction_rebuild_free_set() 186 block_set_init(tr->fs, &tr->allocated); in transaction_rebuild_free_set() 187 list_add_tail(&tr->fs->allocated, &tr->allocated.node); in transaction_rebuild_free_set() 189 block_set_init(tr->fs, new_free_set); in transaction_rebuild_free_set() 341 assert(tr->fs); in transaction_complete_etc() 344 if (tr->fs->checkpoint_required) { in transaction_complete_etc() 345 tr->fs->checkpoint_required = false; in transaction_complete_etc() 346 if (!checkpoint_commit(tr->fs)) { in transaction_complete_etc() [all …]
|
D | aidl_service.h | 24 struct fs; 78 struct fs* fs, 112 struct fs* fs,
|
D | block_mac.h | 42 struct fs; 46 data_block_t block_mac_to_block_fs(const struct fs* fs, 65 static inline bool block_mac_valid_fs(const struct fs* fs, in block_mac_valid_fs() argument 67 return block_mac_to_block_fs(fs, block_mac); in block_mac_valid_fs()
|
D | block_device_tipc.h | 90 struct fs* tr_state; 105 struct fs tr_state_rpmb; 112 struct fs tr_state_ns_tdp; 119 struct fs tr_state_ns_nsp; 125 struct fs tr_state_ns;
|
D | transaction.h | 59 struct fs* fs; member 79 void transaction_init(struct transaction* tr, struct fs* fs, bool activate);
|
D | checkpoint.c | 161 bool checkpoint_commit(struct fs* fs) { in checkpoint_commit() argument 165 assert(fs); in checkpoint_commit() 166 transaction_init(&tr, fs, true); in checkpoint_commit() 171 fs->name); in checkpoint_commit() 173 pr_err("Failed to commit checkpoint for filesystem %s\n", fs->name); in checkpoint_commit()
|
D | block_set.h | 68 struct fs; 112 void block_set_init(struct fs* fs, struct block_set* set); 121 void block_set_copy_ro_fs(struct fs* fs,
|
D | block_cache.c | 465 assert(entry->dirty_tr->fs); in block_cache_entry_clean() 466 struct transaction* itr = entry->dirty_tr->fs->initial_super_block_tr; in block_cache_entry_clean() 481 if (entry->dirty_tr->fs->initial_super_block_tr) { in block_cache_entry_clean() 486 assert(!entry->dirty_tr->fs->initial_super_block_tr->failed); in block_cache_entry_clean() 575 static struct block_cache_entry* block_cache_lookup(struct fs* fs, in block_cache_lookup() argument 587 assert(fs || !allocate); in block_cache_lookup() 723 entry->key = fs->key; in block_cache_lookup() 817 struct fs* fs, in block_cache_get() argument 841 entry = block_cache_lookup(fs, dev, block, true); in block_cache_get() 847 error_report_block_mac_mismatch(fs->name, TRUSTY_BLOCKTYPE_UNKNOWN); in block_cache_get() [all …]
|
D | block_cache.h | 25 struct fs; 64 const void* block_get_super(struct fs* fs, 132 bool block_probe(struct fs* fs,
|
D | checkpoint.h | 39 bool checkpoint_commit(struct fs* fs);
|
D | block_set.c | 183 data_block_t min = tr->fs->min_block_num; in block_set_check_ranges() 184 data_block_t max = tr->fs->dev->block_count; in block_set_check_ranges() 628 void block_set_init(struct fs* fs, struct block_set* set) { in block_set_init() argument 629 assert(fs); in block_set_init() 630 assert(fs->dev); in block_set_init() 633 block_tree_init(&set->block_tree, fs->dev->block_size, fs->block_num_size, in block_set_init() 634 fs->block_num_size + fs->mac_size, fs->block_num_size); in block_set_init() 662 block_set_init(tr->fs, dest); in block_set_copy() 681 void block_set_copy_ro_fs(struct fs* fs, in block_set_copy_ro_fs() argument 684 block_set_init(fs, dest); in block_set_copy_ro_fs() [all …]
|
D | block_allocator.c | 245 if (!fs_is_writable(tr->fs)) { in find_free_block() 259 block = block_set_find_next_block(tr, &tr->fs->free, block, true); in find_free_block() 283 block = block_set_find_next_block(tr, &tr->fs->checkpoint_free, block, in find_free_block() 293 assert(!list_is_empty(&tr->fs->allocated)); in find_free_block() 294 list_for_every_entry(&tr->fs->allocated, set, struct block_set, node) { in find_free_block() 316 block_set_print(tr, &tr->fs->free); in find_free_block() 318 block_set_print(tr, &tr->fs->checkpoint_free); in find_free_block() 319 list_for_every_entry(&tr->fs->allocated, set, struct block_set, in find_free_block() 366 tr->last_tmp_free_block = tr->fs->dev->block_count / 4 * 3; in block_allocate_etc() 441 assert(block_is_clean(tr->fs->dev, block)); in block_free_etc() [all …]
|
D | block_map.c | 40 size_t block_num_size = tr->fs->block_num_size; in block_map_init() 41 size_t block_mac_size = block_num_size + tr->fs->mac_size; in block_map_init() 208 block_discard_dirty_by_block(tr->fs->dev, data); in block_map_truncate() 235 data_block_t min = tr->fs->min_block_num; in block_map_check() 236 data_block_t max = tr->fs->dev->block_count; in block_map_check() 306 block_discard_dirty_by_block(tr->fs->dev, root_block); in block_map_free()
|
D | file.c | 71 hash &= BIT_MASK(tr->fs->block_num_size * 8); in path_hash() 103 tr->fs->dev->block_size); in file_block_map_init() 155 block_tree_print(tr, &tr->fs->files); in files_print() 157 block_tree_walk(tr, &tr->fs->files, 0, true, &path); in files_print() 176 data_block_t file_block_size = get_file_block_size(tr->fs); in file_check() 222 found = file_tree_lookup(&block_mac, tr, &tr->fs->files, &tree_path, in file_block_map_update() 355 size_t get_file_block_size(struct fs* fs) { in get_file_block_size() argument 356 return fs->dev->block_size - sizeof(struct iv); in get_file_block_size() 612 size_t file_block_size = get_file_block_size(tr->fs); in file_set_size() 659 assert(sizeof(*file_entry) <= tr->fs->dev->block_size); in file_tree_lookup() [all …]
|
D | file.h | 24 struct fs; 70 size_t get_file_block_size(struct fs* fs);
|
D | aidl_service.cpp | 182 StorageClientSession(struct fs* fs, in StorageClientSession() argument 186 storage_client_session_init(&inner_, fs, peer); in StorageClientSession() 651 struct fs* fs = filesystems_[fs_type]; in MakeSession() local 652 if (fs == nullptr) { in MakeSession() 661 *out = std::make_shared<StorageClientSession>(fs, fs_type, peer); in MakeSession() 688 void ActivateFilesystem(struct fs* fs, storage_aidl_filesystem fs_type) { in ActivateFilesystem() argument 694 filesystems_[fs_type] = fs; in ActivateFilesystem() 703 std::array<struct fs*, STORAGE_AIDL_FILESYSTEMS_COUNT> filesystems_; 781 struct fs* fs, in storage_aidl_enable_filesystem() argument 783 ctx->inner->service.ActivateFilesystem(fs, fs_type); in storage_aidl_enable_filesystem()
|
D | client.h | 52 struct fs* fs,
|
D | client.c | 302 struct fs* fs, in storage_client_session_init() argument 308 transaction_init(&session->tr, fs, false); in storage_client_session_init() 661 size_t block_size = get_file_block_size(session->tr.fs); in storage_file_read() 737 size_t block_size = get_file_block_size(session->tr.fs); in storage_create_gap() 781 size_t block_size = get_file_block_size(session->tr.fs); in storage_file_write()
|
D | block_tree.c | 889 if (block_mac_to_block(tr, block_mac) >= tr->fs->dev->block_count) { in block_tree_check_sub_tree() 1064 assert(tr->fs->dev->block_size >= tree->block_size); in block_tree_check() 1312 assert(tree->block_size <= tr->fs->dev->block_size); in block_tree_walk() 1718 tr->fs->block_num_size + tr->fs->mac_size); in block_tree_path_put_dirty() 1759 tr->fs->mac_size < 16); in block_tree_path_put_dirty() 1773 tr->fs->mac_size < 16); in block_tree_path_put_dirty() 2815 MIN(sizeof(data), tr->fs->block_num_size))); in block_tree_remove()
|
/trusty/user/app/storage/test/storage_host_test/ |
D | storage_host_test.c | 98 size_t file_block_size = tr->fs->dev->block_size - sizeof(struct iv); in file_test_open() 246 struct fs* fs = NULL; in clear_all_pending_superblock_writes() local 248 fs = &test_block_device.tr_state_rpmb; in clear_all_pending_superblock_writes() 249 if (fs->initial_super_block_tr) { in clear_all_pending_superblock_writes() 250 transaction_initial_super_block_complete(fs->initial_super_block_tr); in clear_all_pending_superblock_writes() 251 EXPECT_EQ(NULL, fs->initial_super_block_tr); in clear_all_pending_superblock_writes() 255 fs = &test_block_device.tr_state_ns_tdp; in clear_all_pending_superblock_writes() 256 if (fs->initial_super_block_tr) { in clear_all_pending_superblock_writes() 257 transaction_initial_super_block_complete(fs->initial_super_block_tr); in clear_all_pending_superblock_writes() 258 EXPECT_EQ(NULL, fs->initial_super_block_tr); in clear_all_pending_superblock_writes() [all …]
|
/trusty/user/app/storage/test/block_host_test/ |
D | block_test.c | 134 struct fs* fs = tr->fs; in block_test_clear_reinit_etc() local 135 const struct key* key = fs->key; in block_test_clear_reinit_etc() 136 struct block_device* dev = tr->fs->dev; in block_test_clear_reinit_etc() 137 struct block_device* super_dev = tr->fs->super_dev; in block_test_clear_reinit_etc() 143 fs_destroy(fs); in block_test_clear_reinit_etc() 158 ret = fs_init(fs, FILE_SYSTEM_TEST, key, dev, super_dev, flags); in block_test_clear_reinit_etc() 160 fs->reserved_count = 18; /* HACK: override default reserved space */ in block_test_clear_reinit_etc() 161 transaction_init(tr, fs, true); in block_test_clear_reinit_etc() 297 block_tree_walk(tr, &tr->fs->files, 0, true, &path); in mark_files_in_use() 311 size_t block_mac_size = tr->fs->block_num_size + tr->fs->mac_size; in check_fs_prepare() [all …]
|
/trusty/user/app/storage/test/storage-unittest/ |
D | main.c | 3143 #define DEFINE_STORAGE_UNIT_TEST(fs, fs_name, run_mode_val, run_mode_name) \ argument 3150 .port = (fs), .run_mode = (run_mode_val), \ 3153 #define DEFINE_STORAGE_UNIT_TESTS_FS(fs, fs_name) \ argument 3154 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, RUN_MODE_ALL, ""), \ 3155 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, \ 3158 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, \ 3161 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, \ 3164 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, RUN_MODE_INIT, ".init"), \ 3165 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, RUN_MODE_CHECK, ".check"), \ 3166 DEFINE_STORAGE_UNIT_TEST((fs), fs_name, RUN_MODE_CLEAN, ".clean")
|