diff options
Diffstat (limited to 'src/H5ACproxy_entry.c')
-rw-r--r-- | src/H5ACproxy_entry.c | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c index 66aacb3..105a531 100644 --- a/src/H5ACproxy_entry.c +++ b/src/H5ACproxy_entry.c @@ -5,12 +5,10 @@ * * * This file is part of HDF5. The full HDF5 copyright notice, including * * terms governing use, modification, and redistribution, is contained in * - * the files COPYING and Copyright.html. COPYING can be found at the root * - * of the source code distribution tree; Copyright.html can be found at the * - * root level of an installed copy of the electronic HDF5 document set and * - * is linked from the top-level documents page. It can also be found at * - * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * - * access to either file, you may request a copy from help@hdfgroup.org. * + * the COPYING file, which can be found at the root of the source code * + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. * + * If you do not have access to either file, you may request a copy from * + * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /*------------------------------------------------------------------------- @@ -312,6 +310,10 @@ H5AC_proxy_entry_add_child(H5AC_proxy_entry_t *pentry, H5F_t *f, hid_t dxpl_id, if(H5AC_mark_entry_clean(pentry) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTCLEAN, FAIL, "can't mark proxy entry clean") + /* Proxies start out serialized (insertions are automatically marked unserialized) */ + if(H5AC_mark_entry_serialized(pentry) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "can't mark proxy entry clean") + /* If there are currently parents, iterate over the list of parents, creating flush dependency on them */ if(pentry->parents) if(H5SL_iterate(pentry->parents, H5AC__proxy_entry_add_child_cb, pentry) < 0) @@ -438,6 +440,7 @@ H5AC_proxy_entry_dest(H5AC_proxy_entry_t *pentry) HDassert(NULL == pentry->parents); HDassert(0 == pentry->nchildren); HDassert(0 == pentry->ndirty_children); + HDassert(0 == pentry->nunser_children); /* Free the proxy entry object */ pentry = H5FL_FREE(H5AC_proxy_entry_t, pentry); @@ -549,6 +552,7 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) case H5AC_NOTIFY_ACTION_BEFORE_EVICT: /* Sanity checks */ HDassert(0 == pentry->ndirty_children); + HDassert(0 == pentry->nunser_children); /* No action */ break; @@ -590,6 +594,29 @@ H5AC__proxy_entry_notify(H5AC_notify_action_t action, void *_thing) HGOTO_ERROR(H5E_CACHE, H5E_CANTCLEAN, FAIL, "can't mark proxy entry clean") break; + case H5AC_NOTIFY_ACTION_CHILD_UNSERIALIZED: + /* Increment # of unserialized children */ + pentry->nunser_children++; + + /* Check for first unserialized child */ + if(1 == pentry->nunser_children) + if(H5AC_mark_entry_unserialized(pentry) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTUNSERIALIZE, FAIL, "can't mark proxy entry unserialized") + break; + + case H5AC_NOTIFY_ACTION_CHILD_SERIALIZED: + /* Sanity check */ + HDassert(pentry->nunser_children > 0); + + /* Decrement # of unserialized children */ + pentry->nunser_children--; + + /* Check for last unserialized child */ + if(0 == pentry->nunser_children) + if(H5AC_mark_entry_serialized(pentry) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTSERIALIZE, FAIL, "can't mark proxy entry serialized") + break; + default: #ifdef NDEBUG HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "unknown notify action from metadata cache") |