diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2017-01-05 15:59:44 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2017-01-05 15:59:44 (GMT) |
commit | 25e83ac23aaf397a924378dd31008e6a0d6677ba (patch) | |
tree | dd0d1985c359959dd862b79296b8ee3898739561 /src/H5AC.c | |
parent | 5a55331bedbfd6a87ccc4684abfbd172ebb5e55d (diff) | |
parent | 49fa0e8dbabe5019b1491845a963d8cfe41b59c1 (diff) | |
download | hdf5-25e83ac23aaf397a924378dd31008e6a0d6677ba.zip hdf5-25e83ac23aaf397a924378dd31008e6a0d6677ba.tar.gz hdf5-25e83ac23aaf397a924378dd31008e6a0d6677ba.tar.bz2 |
Merge pull request #236 in HDFFV/hdf5 from develop_merge_cache_image_04 to develop
Merged file shutdown changes from cache_image.
* commit '49fa0e8dbabe5019b1491845a963d8cfe41b59c1':
Bring file shutdown code from cache image branch
Merge code from cache image branch to split FSM ring into two types: raw data and metadata. Also, some more ring reset safeties and minor code cleanups.
Align w/incoming cache image changes, and improve recovery on errors.
Revert accidental changes to freespace open and close routines.
Remove 'const' from cache client pre_serialize callback, to reduce warnings, and correspondingly remove 'const' from some internal routines. Also rename some H5MF* routines to reflect their static/package usage.
Align with incoming cache_image branch changes: use the index list (instead of the hash buckets) for scanning the entries during a flush, and also add in counters for tracking operations during cache flushes.
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, |