summaryrefslogtreecommitdiffstats
path: root/src/H5HFiblock.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2014-06-18 18:18:36 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2014-06-18 18:18:36 (GMT)
commit12ee3deb82f879cd4cf40e1604442e41ab2359bf (patch)
tree455b95f4dd1abb0873fa677ed0c372a64ed56e92 /src/H5HFiblock.c
parent471aedb1e85ba6b4c5b829373963c21d77ce0835 (diff)
downloadhdf5-12ee3deb82f879cd4cf40e1604442e41ab2359bf.zip
hdf5-12ee3deb82f879cd4cf40e1604442e41ab2359bf.tar.gz
hdf5-12ee3deb82f879cd4cf40e1604442e41ab2359bf.tar.bz2
[svn-r25321] Reworked and enhanced extreme sanity check in H5C.c, fixing an
uninitialized variable bug in passing. Added the H5C_get_entry_ptr_from_addr() and H5C_verify_entry_type() in H5C.c, along with their pass through functions in H5AC.c. Note that H5C_get_entry_ptr_from_addr() is quite slimey, and should be avoided if possible. Updated fractal heap to use flush ordering to force children in the hdr / iblock / dblock tree to be flushed prior to parents. This is part of a port of the fractal heap to the V3 cache, although I gather that it will also be useful for SWMR. Added sanity checking code to the fractal heap to verify that direct blocks are flushed before their parent indirect blocks, child indirect block are flushed prior to their parent indirect blocks, and that the root iblock or dblock is flushed prior to the header Tested on: Jam: Serial and parallel Phoenix (Debian): serial, debug and production amazon (MacOS): serial
Diffstat (limited to 'src/H5HFiblock.c')
-rw-r--r--src/H5HFiblock.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c
index c989bfc..4473803 100644
--- a/src/H5HFiblock.c
+++ b/src/H5HFiblock.c
@@ -438,7 +438,20 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si
/* Attach direct block to new root indirect block */
dblock->parent = iblock;
+ dblock->fd_parent = iblock;
dblock->par_entry = 0;
+
+ /* destroy flush dependency between direct block and header */
+ if(H5AC_destroy_flush_dependency(dblock->hdr, dblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \
+ "unable to destroy flush dependency")
+
+ /* create flush dependency between direct block and new root indirect block */
+ if(H5AC_create_flush_dependency(dblock->parent, dblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \
+ "unable to create flush dependency")
+
+
if(H5HF_man_iblock_attach(iblock, 0, hdr->man_dtable.table_addr) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTATTACH, FAIL, "can't attach root direct block to parent indirect block")
@@ -884,6 +897,19 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id)
dblock->parent = NULL;
dblock->par_entry = 0;
+ /* destroy flush dependency between old root iblock and new root direct block*/
+ if(H5AC_destroy_flush_dependency(dblock->fd_parent, dblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTUNDEPEND, FAIL, \
+ "unable to destroy flush dependency")
+
+
+ /* create flush dependency between header and new root direct block */
+ if(H5AC_create_flush_dependency(dblock->hdr, dblock) < 0)
+ HGOTO_ERROR(H5E_HEAP, H5E_CANTDEPEND, FAIL, \
+ "unable to create flush dependency")
+
+ dblock->fd_parent = NULL;
+
/* Point root at direct block */
hdr->man_dtable.curr_root_rows = 0;
hdr->man_dtable.table_addr = dblock_addr;
@@ -1078,6 +1104,12 @@ H5HF_man_iblock_create(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *par_iblo
/* Attach to parent indirect block, if there is one */
iblock->parent = par_iblock;
+ iblock->fd_parent = par_iblock; /* this copy of the parent pointer is */
+ /* needed by the notify callback so */
+ /* that it can take down flush */
+ /* dependencies on eviction even if */
+ /* the parent pointer has been nulled */
+ /* out. JRM -- 5/18/14 */
iblock->par_entry = par_entry;
if(iblock->parent) {
/* Attach new block to parent */