/* * lane_need_recovery_tx -- return 1 if transaction's section needs recovery */ static int lane_need_recovery_tx(struct pmem_info *pip, struct lane_section_layout *layout) { struct lane_tx_layout *section = (struct lane_tx_layout *)layout; int set_cache = 0; struct list_entry *entryp = PLIST_FIRST(pip->obj.pop, §ion->undo_set_cache); if (entryp) { struct tx_range_cache *cache = ENTRY_TO_DATA(entryp); struct tx_range *range = (struct tx_range *)&cache->range[0]; set_cache = (range->offset && range->size); } /* * The transaction section needs recovery * if state is not committed and * any undo log not empty */ return section->state == TX_STATE_NONE && (!PLIST_EMPTY(§ion->undo_alloc) || !PLIST_EMPTY(§ion->undo_free) || !PLIST_EMPTY(§ion->undo_set) || set_cache); }
/* * lane_need_recovery_tx -- return 1 if transaction's section needs recovery */ static int lane_need_recovery_tx(struct pmem_info *pip, struct lane_section_layout *layout) { struct lane_tx_layout *section = (struct lane_tx_layout *)layout; /* * The transaction section needs recovery * if state is not committed and * any undo log not empty */ return section->state == TX_STATE_NONE && (!PLIST_EMPTY(§ion->undo_alloc) || !PLIST_EMPTY(§ion->undo_free) || !PLIST_EMPTY(§ion->undo_set)); }