diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-12-11 08:28:05 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-12-11 08:28:05 (GMT) |
commit | feb9d1f6761b541a388100d04ec56a9b88a7e462 (patch) | |
tree | c79f3b73f886cb9c7c27926c77d4f951bc460ef7 /src/H5C.c | |
parent | cc6eb939f4dec06e234835acbb5b3bc269b228c5 (diff) | |
download | hdf5-feb9d1f6761b541a388100d04ec56a9b88a7e462.zip hdf5-feb9d1f6761b541a388100d04ec56a9b88a7e462.tar.gz hdf5-feb9d1f6761b541a388100d04ec56a9b88a7e462.tar.bz2 |
Bring over changes from revise_chunks that cleanup recent SWMR changes from
code review feedback.
Diffstat (limited to 'src/H5C.c')
-rw-r--r-- | src/H5C.c | 43 |
1 files changed, 36 insertions, 7 deletions
@@ -1702,6 +1702,13 @@ H5C_move_entry(H5C_t * cache_ptr, HDassert(entry_ptr->addr == old_addr); HDassert(entry_ptr->type == type); + /* Check for R/W status, otherwise error */ + /* (Moving a R/O entry would mark it dirty, which shouldn't + * happen. QAK - 2016/12/02) + */ + if(entry_ptr->is_read_only) + HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "can't move R/O entry") + H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL) if(test_entry_ptr != NULL) { /* we are hosed */ @@ -5066,16 +5073,38 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags) if(!(flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG)) { HDassert(cache_ptr->index_size == 0); HDassert(cache_ptr->clean_index_size == 0); - HDassert(cache_ptr->dirty_index_size == 0); - HDassert(cache_ptr->slist_len == 0); - HDassert(cache_ptr->slist_size == 0); HDassert(cache_ptr->pel_len == 0); HDassert(cache_ptr->pel_size == 0); - HDassert(cache_ptr->pl_len == 0); - HDassert(cache_ptr->pl_size == 0); - HDassert(cache_ptr->LRU_list_len == 0); - HDassert(cache_ptr->LRU_list_size == 0); } /* end if */ + else { + H5C_cache_entry_t *entry_ptr; /* Cache entry */ + unsigned u; /* Local index variable */ + + /* All rings except ring 4 should be empty now */ + /* (Ring 4 has the superblock) */ + for(u = H5C_RING_USER; u < H5C_RING_SB; u++) { + HDassert(cache_ptr->index_ring_len[u] == 0); + HDassert(cache_ptr->index_ring_size[u] == 0); + HDassert(cache_ptr->clean_index_ring_size[u] == 0); + } /* end for */ + + /* Check that any remaining pinned entries are in the superblock ring */ + entry_ptr = cache_ptr->pel_head_ptr; + while(entry_ptr) { + /* Check ring */ + HDassert(entry_ptr->ring == H5C_RING_SB); + + /* Advance to next entry in pinned entry list */ + entry_ptr = entry_ptr->next; + } /* end while */ + } /* end else */ + HDassert(cache_ptr->dirty_index_size == 0); + HDassert(cache_ptr->slist_len == 0); + HDassert(cache_ptr->slist_size == 0); + HDassert(cache_ptr->pl_len == 0); + HDassert(cache_ptr->pl_size == 0); + HDassert(cache_ptr->LRU_list_len == 0); + HDassert(cache_ptr->LRU_list_size == 0); done: FUNC_LEAVE_NOAPI(ret_value) |