diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2017-01-05 05:36:14 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2017-01-05 05:36:14 (GMT) |
commit | afd7e5b476d65960d0e309f35fa2df3235731564 (patch) | |
tree | f92049d856d85402a334c00df4c98b12accf7a41 /src/H5AC.c | |
parent | 6232dd6d62e5a58a6185b9502b6d8719cf0ce676 (diff) | |
download | hdf5-afd7e5b476d65960d0e309f35fa2df3235731564.zip hdf5-afd7e5b476d65960d0e309f35fa2df3235731564.tar.gz hdf5-afd7e5b476d65960d0e309f35fa2df3235731564.tar.bz2 |
Bring file shutdown code from cache image branch
Diffstat (limited to 'src/H5AC.c')
-rw-r--r-- | src/H5AC.c | 86 |
1 files changed, 86 insertions, 0 deletions
@@ -1287,6 +1287,44 @@ done: /*------------------------------------------------------------------------- + * + * Function: H5AC_prep_for_file_close + * + * Purpose: This function should be called just prior to the cache + * flushes at file close. + * + * The objective of the call is to allow the metadata cache + * to do any preparatory work prior to generation of a + * cache image. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 7/3/15 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_prep_for_file_close(H5F_t *f, hid_t dxpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + HDassert(f->shared->cache); + + if(H5C_prep_for_file_close(f, dxpl_id) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cache prep for file close failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_prep_for_file_close() */ + + +/*------------------------------------------------------------------------- * Function: H5AC_create_flush_dependency() * * Purpose: Create a flush dependency between two entries in the metadata @@ -2777,6 +2815,54 @@ done: /*------------------------------------------------------------------------- + * Function: H5AC_unsettle_entry_ring() + * + * Purpose: Advise the metadata cache that the specified entry's metadata + * cache manager ring is no longer settled (if it was on entry). + * + * If the target metadata cache manager ring is already + * unsettled, do nothing, and return SUCCEED. + * + * If the target metadata cache manager ring is settled, and + * we are not in the process of a file shutdown, mark + * the ring as unsettled, and return SUCCEED. + * + * If the target metadata cache manager is settled, and we + * are in the process of a file shutdown, post an error + * message, and return FAIL. + * + * Note that this function simply passes the call on to + * the metadata cache proper, and returns the result. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * September 17, 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_unsettle_entry_ring(void *_entry) +{ + H5AC_info_t *entry = (H5AC_info_t *)_entry; /* Entry to remove */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity checks */ + HDassert(entry); + + /* Unsettle the entry's ring */ + if(H5C_unsettle_entry_ring(entry) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove entry") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_unsettle_entry_ring() */ + + +/*------------------------------------------------------------------------- * Function: H5AC_remove_entry() * * Purpose: Remove an entry from the cache. Must be not protected, pinned, |