Lines Matching refs:entry

57         const struct block_cache_entry* entry) {  in block_cache_entry_data_is_valid()  argument
58 return entry->state == BLOCK_ENTRY_DATA_CLEAN_DECRYPTED || in block_cache_entry_data_is_valid()
59 entry->state == BLOCK_ENTRY_DATA_CLEAN_ENCRYPTED || in block_cache_entry_data_is_valid()
60 entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED || in block_cache_entry_data_is_valid()
61 entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED; in block_cache_entry_data_is_valid()
65 const struct block_cache_entry* entry) { in block_cache_entry_data_is_dirty() argument
66 return entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED || in block_cache_entry_data_is_dirty()
67 entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED; in block_cache_entry_data_is_dirty()
71 const struct block_cache_entry* entry) { in block_cache_entry_data_is_encrypted() argument
72 return entry->state == BLOCK_ENTRY_DATA_CLEAN_ENCRYPTED || in block_cache_entry_data_is_encrypted()
73 entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED; in block_cache_entry_data_is_encrypted()
77 const struct block_cache_entry* entry) { in block_cache_entry_data_is_decrypted() argument
78 return entry->state == BLOCK_ENTRY_DATA_CLEAN_DECRYPTED || in block_cache_entry_data_is_decrypted()
79 entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED; in block_cache_entry_data_is_decrypted()
112 static void block_cache_queue_io_op(struct block_cache_entry* entry, in block_cache_queue_io_op() argument
115 assert(entry->io_op == BLOCK_CACHE_IO_OP_NONE); in block_cache_queue_io_op()
116 assert(entry->dev); in block_cache_queue_io_op()
117 assert(!list_in_list(&entry->io_op_node)); in block_cache_queue_io_op()
119 entry->io_op = io_op; in block_cache_queue_io_op()
120 list_add_tail(&entry->dev->io_ops, &entry->io_op_node); in block_cache_queue_io_op()
127 static void block_cache_queue_read(struct block_cache_entry* entry) { in block_cache_queue_read() argument
128 assert(!block_cache_entry_data_is_dirty(entry)); in block_cache_queue_read()
129 entry->state = BLOCK_ENTRY_DATA_LOADING; in block_cache_queue_read()
130 block_cache_queue_io_op(entry, BLOCK_CACHE_IO_OP_READ); in block_cache_queue_read()
132 entry->dev->start_read(entry->dev, entry->block); in block_cache_queue_read()
140 static void block_cache_queue_write(struct block_cache_entry* entry, in block_cache_queue_write() argument
142 block_cache_queue_io_op(entry, BLOCK_CACHE_IO_OP_WRITE); in block_cache_queue_write()
144 entry->dev->start_write(entry->dev, entry->block, encrypted_data, in block_cache_queue_write()
145 entry->block_size, entry->is_superblock); in block_cache_queue_write()
177 struct block_cache_entry* entry; in block_cache_pop_io_op() local
179 list_for_every_entry(&dev->io_ops, entry, struct block_cache_entry, in block_cache_pop_io_op()
181 if (entry->block == block) { in block_cache_pop_io_op()
182 assert(entry->dev == dev); in block_cache_pop_io_op()
183 assert(entry->io_op == io_op); in block_cache_pop_io_op()
184 entry->io_op = BLOCK_CACHE_IO_OP_NONE; in block_cache_pop_io_op()
185 list_delete(&entry->io_op_node); in block_cache_pop_io_op()
186 return entry; in block_cache_pop_io_op()
213 struct block_cache_entry* entry; in block_cache_complete_read() local
215 assert(data_size <= sizeof(entry->data)); in block_cache_complete_read()
218 entry = block_cache_pop_io_op(dev, block, BLOCK_CACHE_IO_OP_READ); in block_cache_complete_read()
219 assert(entry->state == BLOCK_ENTRY_DATA_LOADING); in block_cache_complete_read()
225 printf("%s: load block %" PRIu64 " failed\n", __func__, entry->block); in block_cache_complete_read()
226 entry->state = BLOCK_ENTRY_DATA_LOAD_FAILED; in block_cache_complete_read()
230 entry->block); in block_cache_complete_read()
231 entry->state = BLOCK_ENTRY_DATA_NOT_FOUND; in block_cache_complete_read()
236 entry->block_size = data_size; in block_cache_complete_read()
238 memcpy(entry->data, data, data_size); in block_cache_complete_read()
241 ret = calculate_mac(entry->key, &entry->mac, entry->data, in block_cache_complete_read()
242 entry->block_size); in block_cache_complete_read()
249 entry->block); in block_cache_complete_read()
252 entry->state = BLOCK_ENTRY_DATA_CLEAN_ENCRYPTED; in block_cache_complete_read()
267 struct block_cache_entry* entry; in block_cache_complete_write() local
269 entry = block_cache_pop_io_op(dev, block, BLOCK_CACHE_IO_OP_WRITE); in block_cache_complete_write()
272 entry->block); in block_cache_complete_write()
274 assert(entry->dirty_tr); in block_cache_complete_write()
276 entry->dirty_tr = NULL; in block_cache_complete_write()
277 entry->pinned = false; in block_cache_complete_write()
280 entry->block); in block_cache_complete_write()
281 transaction_fail(entry->dirty_tr); in block_cache_complete_write()
304 assert(block == entry->block); in block_cache_complete_write()
323 static bool block_cache_entry_has_refs(struct block_cache_entry* entry) { in block_cache_entry_has_refs() argument
324 return !list_is_empty(&entry->obj.ref_list); in block_cache_entry_has_refs()
333 static bool block_cache_entry_has_one_ref(struct block_cache_entry* entry) { in block_cache_entry_has_one_ref() argument
334 return list_length(&entry->obj.ref_list) == 1; in block_cache_entry_has_one_ref()
341 static void block_cache_entry_decrypt(struct block_cache_entry* entry) { in block_cache_entry_decrypt() argument
347 assert(block_cache_entry_data_is_encrypted(entry)); in block_cache_entry_decrypt()
349 decrypt_data = entry->data; in block_cache_entry_decrypt()
350 decrypt_size = entry->block_size; in block_cache_entry_decrypt()
352 iv = (void*)entry->data; in block_cache_entry_decrypt()
358 ret = storage_decrypt(entry->key, decrypt_data, decrypt_size, iv); in block_cache_entry_decrypt()
364 entry->block); in block_cache_entry_decrypt()
367 if (entry->state == BLOCK_ENTRY_DATA_CLEAN_ENCRYPTED) { in block_cache_entry_decrypt()
368 entry->state = BLOCK_ENTRY_DATA_CLEAN_DECRYPTED; in block_cache_entry_decrypt()
369 } else if (entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED) { in block_cache_entry_decrypt()
376 entry->state = BLOCK_ENTRY_DATA_DIRTY_DECRYPTED; in block_cache_entry_decrypt()
387 static void block_cache_entry_encrypt(struct block_cache_entry* entry) { in block_cache_entry_encrypt() argument
394 assert(entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED); in block_cache_entry_encrypt()
395 assert(!block_cache_entry_has_refs(entry)); in block_cache_entry_encrypt()
397 encrypt_data = entry->data; in block_cache_entry_encrypt()
398 encrypt_size = entry->block_size; in block_cache_entry_encrypt()
400 iv = (void*)entry->data; in block_cache_entry_encrypt()
407 ret = storage_encrypt(entry->key, encrypt_data, encrypt_size, iv); in block_cache_entry_encrypt()
410 entry->state = BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED; in block_cache_entry_encrypt()
413 entry->block); in block_cache_entry_encrypt()
416 if (!entry->dirty_mac) { in block_cache_entry_encrypt()
417 mac = entry->mac; in block_cache_entry_encrypt()
421 ret = calculate_mac(entry->key, &entry->mac, entry->data, in block_cache_entry_encrypt()
422 entry->block_size); in block_cache_entry_encrypt()
426 if (!entry->dirty_mac) { in block_cache_entry_encrypt()
427 assert(!CRYPTO_memcmp(&mac, &entry->mac, sizeof(mac))); in block_cache_entry_encrypt()
429 entry->dirty_mac = false; in block_cache_entry_encrypt()
440 static void block_cache_entry_clean(struct block_cache_entry* entry) { in block_cache_entry_clean() argument
441 if (!block_cache_entry_data_is_dirty(entry)) { in block_cache_entry_clean()
446 printf("%s: encrypt block %" PRIu64 "\n", __func__, entry->block); in block_cache_entry_clean()
449 assert(entry->block_size <= sizeof(entry->data)); in block_cache_entry_clean()
450 if (entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED) { in block_cache_entry_clean()
451 block_cache_entry_encrypt(entry); in block_cache_entry_clean()
453 assert(entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED); in block_cache_entry_clean()
456 assert(entry->dirty_tr); in block_cache_entry_clean()
463 struct transaction* tr = entry->dirty_tr; in block_cache_entry_clean()
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()
471 if (itr && itr != entry->dirty_tr) { in block_cache_entry_clean()
473 __func__, entry->block); 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()
487 transaction_fail(entry->dirty_tr); in block_cache_entry_clean()
488 assert(entry->state == BLOCK_ENTRY_DATA_INVALID); in block_cache_entry_clean()
493 block_cache_queue_write(entry, entry->data); in block_cache_entry_clean()
509 assert(entry->state == BLOCK_ENTRY_DATA_DIRTY_ENCRYPTED); in block_cache_entry_clean()
510 entry->state = BLOCK_ENTRY_DATA_CLEAN_ENCRYPTED; in block_cache_entry_clean()
522 static unsigned int block_cache_entry_score(struct block_cache_entry* entry, in block_cache_entry_score() argument
524 if (!entry->dev) { in block_cache_entry_score()
527 return index * (block_cache_entry_data_is_dirty(entry) in block_cache_entry_score()
528 ? (entry->dirty_tmp ? 1 : 2) in block_cache_entry_score()
536 static void block_cache_entry_discard_dirty(struct block_cache_entry* entry) { in block_cache_entry_discard_dirty() argument
537 assert(!entry->dirty_ref); in block_cache_entry_discard_dirty()
538 assert(!list_in_list(&entry->io_op_node)); in block_cache_entry_discard_dirty()
539 entry->state = BLOCK_ENTRY_DATA_INVALID; in block_cache_entry_discard_dirty()
540 entry->dev = NULL; in block_cache_entry_discard_dirty()
541 entry->block = DATA_BLOCK_INVALID; in block_cache_entry_discard_dirty()
542 entry->dirty_tr = NULL; in block_cache_entry_discard_dirty()
544 entry->pinned = false; in block_cache_entry_discard_dirty()
545 entry->is_superblock = false; in block_cache_entry_discard_dirty()
547 entry->dirty_mac = false; in block_cache_entry_discard_dirty()
554 static void block_cache_entry_discard(struct block_cache_entry* entry) { in block_cache_entry_discard() argument
555 assert(!block_cache_entry_has_refs(entry)); in block_cache_entry_discard()
556 assert(!entry->dirty_ref); in block_cache_entry_discard()
557 assert(!entry->dirty_tr); in block_cache_entry_discard()
558 assert(!list_in_list(&entry->io_op_node)); in block_cache_entry_discard()
559 block_cache_entry_discard_dirty(entry); in block_cache_entry_discard()
579 struct block_cache_entry* entry; in block_cache_lookup() local
606 list_for_every_entry(&block_cache_lru, entry, struct block_cache_entry, in block_cache_lookup()
608 assert(entry->guard1 == BLOCK_CACHE_GUARD_1); in block_cache_lookup()
609 assert(entry->guard2 == BLOCK_CACHE_GUARD_2); in block_cache_lookup()
610 if (entry->dev == dev && entry->block == block) { in block_cache_lookup()
614 __func__, block, entry - block_cache_entries, in block_cache_lookup()
615 block_cache_entry_data_state_name(entry->state)); in block_cache_lookup()
633 if (!block_cache_entry_has_refs(entry) && !entry->pinned) { in block_cache_lookup()
634 score = block_cache_entry_score(entry, available); in block_cache_lookup()
637 unused_entry = entry; in block_cache_lookup()
644 __func__, block, entry - block_cache_entries, in block_cache_lookup()
645 entry->block); in block_cache_lookup()
652 if (entry->pinned) { in block_cache_lookup()
653 assert(entry->block != DATA_BLOCK_INVALID); in block_cache_lookup()
658 __func__, block, entry - block_cache_entries, in block_cache_lookup()
659 entry->block); in block_cache_lookup()
664 entry = unused_entry; in block_cache_lookup()
666 if (!entry || !allocate) { in block_cache_lookup()
672 entry = NULL; in block_cache_lookup()
679 __func__, block, entry - block_cache_entries, in block_cache_lookup()
680 block_cache_entry_data_state_name(entry->state), available, in block_cache_lookup()
684 assert(!entry->dirty_ref); in block_cache_lookup()
686 if (block_cache_entry_data_is_dirty(entry)) { in block_cache_lookup()
688 block_cache_entry_clean(entry); in block_cache_lookup()
689 block_cache_complete_io(entry->dev); in block_cache_lookup()
706 if (!entry->pinned) { in block_cache_lookup()
713 __func__, entry->block); in block_cache_lookup()
715 assert(!block_cache_entry_data_is_dirty(entry)); in block_cache_lookup()
716 assert(!entry->dirty_mac); in block_cache_lookup()
717 assert(!entry->dirty_tr); in block_cache_lookup()
719 entry->dev = dev; in block_cache_lookup()
720 entry->block = block; in block_cache_lookup()
721 assert(dev->block_size <= sizeof(entry->data)); in block_cache_lookup()
722 entry->block_size = dev->block_size; in block_cache_lookup()
723 entry->key = fs->key; in block_cache_lookup()
724 entry->state = BLOCK_ENTRY_DATA_INVALID; in block_cache_lookup()
725 entry->is_superblock = false; in block_cache_lookup()
730 return entry; in block_cache_lookup()
754 struct block_cache_entry* entry, in block_cache_load_entry() argument
757 if (!block_cache_entry_data_is_valid(entry)) { in block_cache_load_entry()
758 assert(!block_cache_entry_has_refs(entry)); in block_cache_load_entry()
761 entry->block); in block_cache_load_entry()
763 block_cache_queue_read(entry); in block_cache_load_entry()
764 block_cache_complete_io(entry->dev); in block_cache_load_entry()
766 if (!block_cache_entry_data_is_valid(entry)) { in block_cache_load_entry()
768 entry->block, entry->state); in block_cache_load_entry()
769 switch (entry->state) { in block_cache_load_entry()
779 if (CRYPTO_memcmp(&entry->mac, mac, mac_size)) { in block_cache_load_entry()
781 entry->block); in block_cache_load_entry()
791 if (block_cache_entry_data_is_encrypted(entry)) { in block_cache_load_entry()
792 block_cache_entry_decrypt(entry); in block_cache_load_entry()
794 assert(block_cache_entry_data_is_decrypted(entry)); in block_cache_load_entry()
826 struct block_cache_entry* entry; in block_cache_get() local
841 entry = block_cache_lookup(fs, dev, block, true); in block_cache_get()
842 assert(entry); in block_cache_get()
845 res = block_cache_load_entry(entry, mac, mac_size); in block_cache_get()
857 assert(!entry->dirty_ref); in block_cache_get()
858 obj_add_ref_allow_unreferenced_obj(&entry->obj, ref); in block_cache_get()
861 block, entry - block_cache_entries, in block_cache_get()
862 block_cache_entry_data_state_name(entry->state)); in block_cache_get()
864 return entry; in block_cache_get()
889 struct block_cache_entry* entry; in block_cache_get_data() local
890 entry = block_cache_get(fs, dev, block, load, mac, mac_size, ref, in block_cache_get_data()
892 if (!entry) { in block_cache_get_data()
895 return entry->data; in block_cache_get_data()
905 struct block_cache_entry* entry; in data_to_block_cache_entry() local
908 entry = containerof(data, struct block_cache_entry, data); in data_to_block_cache_entry()
909 assert(entry >= block_cache_entries); in data_to_block_cache_entry()
910 assert(entry < &block_cache_entries[BLOCK_CACHE_SIZE]); in data_to_block_cache_entry()
911 assert(((uintptr_t)entry - (uintptr_t)entry) % sizeof(entry[0]) == 0); in data_to_block_cache_entry()
912 return entry; in data_to_block_cache_entry()
936 struct block_cache_entry* entry = in block_cache_entry_destroy() local
939 list_delete(&entry->lru_node); in block_cache_entry_destroy()
940 list_add_head(&block_cache_lru, &entry->lru_node); in block_cache_entry_destroy()
942 if (entry->dirty_mac) { in block_cache_entry_destroy()
943 block_cache_entry_encrypt(entry); in block_cache_entry_destroy()
998 struct block_cache_entry* entry; in block_cache_clean_transaction() local
1003 list_for_every_entry(&block_cache_lru, entry, struct block_cache_entry, in block_cache_clean_transaction()
1005 assert(entry->guard1 == BLOCK_CACHE_GUARD_1); in block_cache_clean_transaction()
1006 assert(entry->guard2 == BLOCK_CACHE_GUARD_2); in block_cache_clean_transaction()
1007 if (entry->dirty_tr != tr) { in block_cache_clean_transaction()
1011 assert(block_cache_entry_data_is_dirty(entry)); in block_cache_clean_transaction()
1013 assert(!entry->dirty_ref); in block_cache_clean_transaction()
1015 if (entry->dirty_tmp) { in block_cache_clean_transaction()
1020 dev = entry->dev; in block_cache_clean_transaction()
1024 assert(entry->dev == dev); in block_cache_clean_transaction()
1029 entry->block); in block_cache_clean_transaction()
1032 entry->block); in block_cache_clean_transaction()
1036 assert(!block_cache_entry_has_refs(entry)); in block_cache_clean_transaction()
1038 block_cache_entry_clean(entry); in block_cache_clean_transaction()
1040 assert(entry->dirty_tr != tr); in block_cache_clean_transaction()
1046 assert(!block_cache_entry_data_is_dirty(entry)); in block_cache_clean_transaction()
1047 assert(!entry->dirty_tr); in block_cache_clean_transaction()
1069 struct block_cache_entry* entry; in block_cache_discard_transaction() local
1072 list_for_every_entry(&block_cache_lru, entry, struct block_cache_entry, in block_cache_discard_transaction()
1074 assert(entry->guard1 == BLOCK_CACHE_GUARD_1); in block_cache_discard_transaction()
1075 assert(entry->guard2 == BLOCK_CACHE_GUARD_2); in block_cache_discard_transaction()
1076 if (entry->dirty_tr != tr) { in block_cache_discard_transaction()
1080 if (entry->dirty_tmp) { in block_cache_discard_transaction()
1082 assert(entry->dev == tr->fs->dev); in block_cache_discard_transaction()
1089 dev = entry->dev; in block_cache_discard_transaction()
1092 assert(entry->dev == dev); in block_cache_discard_transaction()
1094 assert(block_cache_entry_data_is_dirty(entry)); in block_cache_discard_transaction()
1099 entry->block, entry->dirty_tmp); in block_cache_discard_transaction()
1102 entry->block, entry->dirty_tmp); in block_cache_discard_transaction()
1106 if (block_cache_entry_has_refs(entry)) { in block_cache_discard_transaction()
1109 entry->block, entry->dirty_ref); in block_cache_discard_transaction()
1112 entry->block, entry->dirty_ref); in block_cache_discard_transaction()
1115 assert(!entry->dirty_ref); in block_cache_discard_transaction()
1118 assert(!block_cache_entry_has_refs(entry)); in block_cache_discard_transaction()
1119 assert(entry->dirty_tmp); in block_cache_discard_transaction()
1121 entry->dirty_tr = NULL; in block_cache_discard_transaction()
1122 entry->state = BLOCK_ENTRY_DATA_INVALID; in block_cache_discard_transaction()
1123 assert(!entry->dirty_tr); in block_cache_discard_transaction()
1252 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_dirty() local
1256 assert(!entry->dirty_tr || entry->dirty_tr == tr); in block_dirty()
1257 assert(!entry->dirty_ref); in block_dirty()
1260 if (block_cache_entry_data_is_encrypted(entry)) { in block_dirty()
1263 entry->block); in block_dirty()
1265 } else if (entry->state != BLOCK_ENTRY_DATA_CLEAN_DECRYPTED) { in block_dirty()
1269 __func__, entry->block, in block_dirty()
1270 block_cache_entry_data_state_name(entry->state)); in block_dirty()
1273 assert(block_cache_entry_has_one_ref(entry)); in block_dirty()
1274 entry->state = BLOCK_ENTRY_DATA_DIRTY_DECRYPTED; in block_dirty()
1275 entry->dirty_ref = true; in block_dirty()
1276 entry->dirty_tmp = is_tmp; in block_dirty()
1277 entry->dirty_tr = tr; in block_dirty()
1290 struct block_cache_entry* entry; in block_is_clean() local
1292 entry = block_cache_lookup(NULL, dev, block, false); in block_is_clean()
1293 return !entry || !block_cache_entry_data_is_dirty(entry); in block_is_clean()
1301 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_discard_dirty() local
1303 if (block_cache_entry_data_is_dirty(entry)) { in block_discard_dirty()
1304 assert(entry->dev); in block_discard_dirty()
1305 block_cache_entry_discard_dirty(entry); in block_discard_dirty()
1316 struct block_cache_entry* entry; in block_discard_dirty_by_block() local
1318 entry = block_cache_lookup(NULL, dev, block, false); in block_discard_dirty_by_block()
1319 if (!entry) { in block_discard_dirty_by_block()
1322 assert(!entry->dirty_ref); in block_discard_dirty_by_block()
1323 assert(!block_cache_entry_has_refs(entry)); in block_discard_dirty_by_block()
1324 if (!block_cache_entry_data_is_dirty(entry)) { in block_discard_dirty_by_block()
1327 block_discard_dirty(entry->data); in block_discard_dirty_by_block()
1348 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_put_dirty_etc() local
1351 struct iv* iv = (void*)entry->data; /* TODO: support external iv */ in block_put_dirty_etc()
1355 assert(entry->state == BLOCK_ENTRY_DATA_DIRTY_DECRYPTED); in block_put_dirty_etc()
1356 assert(entry->dirty_ref); in block_put_dirty_etc()
1360 assert(entry->guard1 == BLOCK_CACHE_GUARD_1); in block_put_dirty_etc()
1361 assert(entry->guard2 == BLOCK_CACHE_GUARD_2); in block_put_dirty_etc()
1363 entry->dirty_ref = false; in block_put_dirty_etc()
1364 if (block_cache_entry_data_is_dirty(entry)) { in block_put_dirty_etc()
1365 entry->dirty_mac = true; in block_put_dirty_etc()
1369 pr_warn("block %" PRIu64 ", not dirty\n", entry->block); in block_put_dirty_etc()
1370 assert(entry->dirty_tr == NULL); in block_put_dirty_etc()
1376 assert(block_cache_entry_data_is_encrypted(entry) || !tr); in block_put_dirty_etc()
1377 assert(!entry->dirty_mac); in block_put_dirty_etc()
1379 assert(block_mac_to_block(tr, block_mac) == entry->block); in block_put_dirty_etc()
1380 block_mac_set_mac(tr, block_mac, &entry->mac); in block_put_dirty_etc()
1386 __func__, entry->block, block_mac, parent ? parent->block : 0); in block_put_dirty_etc()
1423 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_put_dirty_no_mac() local
1425 assert(entry->dev); in block_put_dirty_no_mac()
1426 assert((allow_tampering && !entry->dev->tamper_detecting) || in block_put_dirty_no_mac()
1427 (!allow_tampering && entry->dev->tamper_detecting)); in block_put_dirty_no_mac()
1535 struct block_cache_entry* entry = data_to_block_cache_entry(data_ro); in block_get_cleared_super() local
1536 assert(!block_cache_entry_data_is_dirty(entry)); in block_get_cleared_super()
1537 entry->pinned = pinned; in block_get_cleared_super()
1538 entry->is_superblock = true; in block_get_cleared_super()
1589 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_move() local
1591 assert(block_cache_entry_has_one_ref(entry)); in block_move()
1592 assert(!block_cache_entry_data_is_dirty(entry)); in block_move()
1593 assert(entry->dev == tr->fs->dev); in block_move()
1598 __func__, entry - block_cache_entries, entry->block, block); in block_move()
1616 entry->block = block; in block_move()
1626 struct block_cache_entry* entry = data_to_block_cache_entry(data); in block_put() local
1630 entry->block, entry - block_cache_entries, in block_put()
1631 block_cache_entry_data_state_name(entry->state)); in block_put()
1634 assert(!entry->dirty_ref); in block_put()
1636 obj_del_ref(&entry->obj, ref, block_cache_entry_destroy); in block_put()
1691 struct block_cache_entry* entry = data_to_block_cache_entry(data); in data_to_block_num() local
1693 return entry->block; in data_to_block_num()
1706 struct block_cache_entry* entry; in block_cache_debug_get_ref_block_count() local
1708 list_for_every_entry(&block_cache_lru, entry, struct block_cache_entry, in block_cache_debug_get_ref_block_count()
1710 assert(entry->guard1 == BLOCK_CACHE_GUARD_1); in block_cache_debug_get_ref_block_count()
1711 assert(entry->guard2 == BLOCK_CACHE_GUARD_2); in block_cache_debug_get_ref_block_count()
1712 if (block_cache_entry_has_refs(entry)) { in block_cache_debug_get_ref_block_count()
1716 __func__, entry - block_cache_entries, entry->block, in block_cache_debug_get_ref_block_count()
1717 entry->dev); in block_cache_debug_get_ref_block_count()
1720 __func__, entry - block_cache_entries, entry->block); in block_cache_debug_get_ref_block_count()