summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c483
1 files changed, 325 insertions, 158 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index f8805b3..59cabde 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -136,14 +136,14 @@ static const H5AC_class_t *const H5AC_class_s[] = {
/*-------------------------------------------------------------------------
- * Function: H5AC_init
+ * Function: H5AC_init
*
- * Purpose: Initialize the interface from some other layer.
+ * Purpose: Initialize the interface from some other layer.
*
- * Return: Success: non-negative
- * Failure: negative
+ * Return: Success: non-negative
+ * Failure: negative
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Saturday, January 18, 2003
*
*-------------------------------------------------------------------------
@@ -162,13 +162,13 @@ done:
/*-------------------------------------------------------------------------
- * Function H5AC__init_package
+ * Function: H5AC__init_package
*
- * Purpose: Initialize interface-specific information
+ * Purpose: Initialize interface-specific information
*
- * Return: Non-negative on success/Negative on failure
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -198,15 +198,15 @@ H5AC__init_package(void)
/*-------------------------------------------------------------------------
- * Function: H5AC_term_package
+ * Function: H5AC_term_package
*
- * Purpose: Terminate this interface.
+ * Purpose: Terminate this interface.
*
- * Return: Success: Positive if anything was done that might
- * affect other interfaces; zero otherwise.
- * Failure: Negative.
+ * Return: Success: Positive if anything was done that might
+ * affect other interfaces; zero otherwise.
+ * Failure: Negative.
*
- * Programmer: Quincey Koziol
+ * Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
*-------------------------------------------------------------------------
@@ -284,7 +284,7 @@ herr_t
H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_config_t * image_config_ptr)
{
#ifdef H5_HAVE_PARALLEL
- char prefix[H5C__PREFIX_LEN] = "";
+ char prefix[H5C__PREFIX_LEN] = "";
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
struct H5C_cache_image_ctl_t int_ci_config = H5C__DEFAULT_CACHE_IMAGE_CTL;
@@ -309,9 +309,9 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
#ifdef H5_HAVE_PARALLEL
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
- MPI_Comm mpi_comm;
- int mpi_rank;
- int mpi_size;
+ MPI_Comm mpi_comm;
+ int mpi_rank;
+ int mpi_size;
if(MPI_COMM_NULL == (mpi_comm = H5F_mpi_get_comm(f)))
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI communicator")
@@ -400,7 +400,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
#endif /* H5_HAVE_PARALLEL */
if(NULL == f->shared->cache)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed")
#ifdef H5_HAVE_PARALLEL
if(aux_ptr != NULL)
@@ -472,6 +472,14 @@ done:
* matzke@llnl.gov
* Jul 9 1997
*
+ * Changes:
+ *
+ * In the parallel case, added code to setup the MDC slist
+ * before the call to H5AC__flush_entries() and take it down
+ * afterwards.
+ *
+ * JRM -- 7/29/20
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -497,58 +505,115 @@ H5AC_dest(H5F_t *f)
#endif /* H5AC_DUMP_STATS_ON_CLOSE */
/* Check if log messages are being emitted */
- if(H5C_get_logging_status(f->shared->cache, &log_enabled, &curr_logging) < 0)
+ if(H5C_get_logging_status(f->shared->cache,
+ &log_enabled, &curr_logging) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to get logging status")
- if(log_enabled && curr_logging)
+ if(log_enabled && curr_logging) {
+
if(H5C_log_write_destroy_cache_msg(f->shared->cache) < 0)
- HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message")
+
+ HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \
+ "unable to emit log message")
+ }
+
/* Tear down logging */
- if(log_enabled)
+ if(log_enabled) {
+
if(H5C_log_tear_down(f->shared->cache) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "mdc logging tear-down failed")
+
+ HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, \
+ "mdc logging tear-down failed")
+ }
#ifdef H5_HAVE_PARALLEL
+
/* destroying the cache, so clear all collective entries */
if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed")
+
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, \
+ "H5C_clear_coll_entries() failed")
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache);
- if(aux_ptr)
+
+ if(aux_ptr) {
+
/* Sanity check */
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+
+
+ /* If the file was opened R/W, attempt to flush all entries
+ * from rank 0 & Bcast clean list to other ranks.
+ *
+ * Must not flush in the R/O case, as this will trigger the
+ * free space manager settle routines.
+ *
+ * Must also enable the skip list before the call to
+ * H5AC__flush_entries() and disable it afterwards, as the
+ * skip list will be disabled after the previous flush.
+ *
+ * Note that H5C_dest() does slist setup and take down as well.
+ * Unfortunately, we can't do the setup and take down just once,
+ * as H5C_dest() is called directly in the test code.
+ *
+ * Fortunately, the cache should be clean or close to it at this
+ * point, so the overhead should be minimal.
+ */
+ if(H5F_ACC_RDWR & H5F_INTENT(f)) {
- /* If the file was opened R/W, attempt to flush all entries
- * from rank 0 & Bcast clean list to other ranks.
- *
- * Must not flush in the R/O case, as this will trigger the
- * free space manager settle routines.
- */
- if(H5F_ACC_RDWR & H5F_INTENT(f))
- if(H5AC__flush_entries(f) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush")
+ /* enable and load the slist */
+ if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0 )
+
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
+ "set slist enabled failed")
+
+ if(H5AC__flush_entries(f) < 0)
+
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush")
+
+ /* disable the slist -- should be empty */
+ if ( H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0 )
+
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "disable slist failed")
+ }
+ }
#endif /* H5_HAVE_PARALLEL */
/* Destroy the cache */
if(H5C_dest(f) < 0)
+
HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache")
+
f->shared->cache = NULL;
#ifdef H5_HAVE_PARALLEL
+
if(aux_ptr != NULL) {
+
if(aux_ptr->d_slist_ptr != NULL) {
+
HDassert(H5SL_count(aux_ptr->d_slist_ptr) == 0);
H5SL_close(aux_ptr->d_slist_ptr);
+
} /* end if */
+
if(aux_ptr->c_slist_ptr != NULL) {
+
HDassert(H5SL_count(aux_ptr->c_slist_ptr) == 0);
H5SL_close(aux_ptr->c_slist_ptr);
+
} /* end if */
+
if(aux_ptr->candidate_slist_ptr != NULL) {
+
HDassert(H5SL_count(aux_ptr->candidate_slist_ptr) == 0);
H5SL_close(aux_ptr->candidate_slist_ptr);
+
} /* end if */
+
aux_ptr->magic = 0;
aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
+
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -561,12 +626,12 @@ done:
* Function: H5AC_evict
*
* Purpose: Evict all entries except the pinned entries
- * in the cache.
+ * in the cache.
*
* Return: Non-negative on success/Negative on failure
*
* Programmer: Vailin Choi
- * Dec 2013
+ * Dec 2013
*
*-------------------------------------------------------------------------
*/
@@ -600,9 +665,9 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_expunge_entry
*
- * Purpose: Expunge the target entry from the cache without writing it
- * to disk even if it is dirty. The entry must not be either
- * pinned or protected.
+ * Purpose: Expunge the target entry from the cache without writing it
+ * to disk even if it is dirty. The entry must not be either
+ * pinned or protected.
*
* Return: Non-negative on success/Negative on failure
*
@@ -643,13 +708,13 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_flush
*
- * Purpose: Flush (and possibly destroy) the metadata cache associated
- * with the specified file.
+ * Purpose: Flush (and possibly destroy) the metadata cache associated
+ * with the specified file.
*
- * If the cache contains protected entries, the function will
- * fail, as protected entries cannot be flushed. However
- * all unprotected entries should be flushed before the
- * function returns failure.
+ * If the cache contains protected entries, the function will
+ * fail, as protected entries cannot be flushed. However
+ * all unprotected entries should be flushed before the
+ * function returns failure.
*
* Return: Non-negative on success/Negative on failure if there was a
* request to flush all items and something was protected.
@@ -701,15 +766,15 @@ done:
* Function: H5AC_get_entry_status
*
* Purpose: Given a file address, determine whether the metadata
- * cache contains an entry at that location. If it does,
- * also determine whether the entry is dirty, protected,
- * pinned, etc. and return that information to the caller
- * in *status.
+ * cache contains an entry at that location. If it does,
+ * also determine whether the entry is dirty, protected,
+ * pinned, etc. and return that information to the caller
+ * in *status.
*
- * If the specified entry doesn't exist, set *status_ptr
- * to zero.
+ * If the specified entry doesn't exist, set *status_ptr
+ * to zero.
*
- * On error, the value of *status is undefined.
+ * On error, the value of *status is undefined.
*
* Return: Non-negative on success/Negative on failure
*
@@ -721,14 +786,14 @@ done:
herr_t
H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
{
- hbool_t in_cache; /* Entry @ addr is in the cache */
- hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
- hbool_t is_protected; /* Entry @ addr is in the cache and protected */
- hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
- hbool_t is_corked;
- hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
- hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
- hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
+ hbool_t in_cache; /* Entry @ addr is in the cache */
+ hbool_t is_dirty; /* Entry @ addr is in the cache and dirty */
+ hbool_t is_protected; /* Entry @ addr is in the cache and protected */
+ hbool_t is_pinned; /* Entry @ addr is in the cache and pinned */
+ hbool_t is_corked;
+ hbool_t is_flush_dep_child; /* Entry @ addr is in the cache and is a flush dependency child */
+ hbool_t is_flush_dep_parent; /* Entry @ addr is in the cache and is a flush dependency parent */
+ hbool_t image_is_up_to_date; /* Entry @ addr is in the cache and has an up to date image */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -741,21 +806,21 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed")
if(in_cache) {
- *status |= H5AC_ES__IN_CACHE;
- if(is_dirty)
- *status |= H5AC_ES__IS_DIRTY;
- if(is_protected)
- *status |= H5AC_ES__IS_PROTECTED;
- if(is_pinned)
- *status |= H5AC_ES__IS_PINNED;
- if(is_corked)
- *status |= H5AC_ES__IS_CORKED;
- if(is_flush_dep_parent)
- *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
- if(is_flush_dep_child)
- *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
- if(image_is_up_to_date)
- *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE;
+ *status |= H5AC_ES__IN_CACHE;
+ if(is_dirty)
+ *status |= H5AC_ES__IS_DIRTY;
+ if(is_protected)
+ *status |= H5AC_ES__IS_PROTECTED;
+ if(is_pinned)
+ *status |= H5AC_ES__IS_PINNED;
+ if(is_corked)
+ *status |= H5AC_ES__IS_CORKED;
+ if(is_flush_dep_parent)
+ *status |= H5AC_ES__IS_FLUSH_DEP_PARENT;
+ if(is_flush_dep_child)
+ *status |= H5AC_ES__IS_FLUSH_DEP_CHILD;
+ if(image_is_up_to_date)
+ *status |= H5AC_ES__IMAGE_IS_UP_TO_DATE;
} /* end if */
else
*status = 0;
@@ -875,8 +940,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_dirty
*
- * Purpose: Mark a pinned or protected entry as dirty. The target
- * entry MUST be either pinned, protected, or both.
+ * Purpose: Mark a pinned or protected entry as dirty. The target
+ * entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -929,8 +994,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_clean
*
- * Purpose: Mark a pinned entry as clean. The target
- * entry MUST be pinned.
+ * Purpose: Mark a pinned entry as clean. The target
+ * entry MUST be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -982,8 +1047,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_unserialized
*
- * Purpose: Mark a pinned or protected entry as unserialized. The target
- * entry MUST be either pinned, protected, or both.
+ * Purpose: Mark a pinned or protected entry as unserialized. The target
+ * entry MUST be either pinned, protected, or both.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1024,8 +1089,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_mark_entry_serialized
*
- * Purpose: Mark a pinned entry as serialized. The target
- * entry MUST be pinned.
+ * Purpose: Mark a pinned entry as serialized. The target
+ * entry MUST be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1124,7 +1189,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_pin_protected_entry()
*
- * Purpose: Pin a protected cache entry. The entry must be protected
+ * Purpose: Pin a protected cache entry. The entry must be protected
* at the time of call, and must be unpinned.
*
* Return: Non-negative on success/Negative on failure
@@ -1203,9 +1268,112 @@ done:
/*-------------------------------------------------------------------------
+ *
+ * Function: H5AC_prep_for_file_flush
+ *
+ * Purpose: This function should be called just prior to the first
+ * call to H5AC_flush() during a file flush.
+ *
+ * Its purpose is to handly any setup required prior to
+ * metadata cache flush.
+ *
+ * Initially, this means setting up the slist prior to the
+ * flush. We do this in a seperate call because
+ * H5F__flush_phase2() make repeated calls to H5AC_flush().
+ * Handling this detail in separate calls allows us to avoid
+ * the overhead of setting up and taking down the skip list
+ * repeatedly.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: John Mainzer
+ * 5/5/20
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5AC_prep_for_file_flush(H5F_t *f)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->cache);
+
+ if ( H5C_set_slist_enabled(f->shared->cache, TRUE, FALSE) < 0)
+
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed")
+
+done:
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5AC_prep_for_file_flush() */
+
+
+/*-------------------------------------------------------------------------
+ *
+ * Function: H5AC_secure_from_file_flush
+ *
+ * Purpose: This function should be called just after the last
+ * call to H5AC_flush() during a file flush.
+ *
+ * Its purpose is to perform any necessary cleanup after the
+ * metadata cache flush.
+ *
+ * The objective of the call is to allow the metadata cache
+ * to do any necessary necessary cleanup work after a cache
+ * flush.
+ *
+ * Initially, this means taking down the slist after the
+ * flush. We do this in a seperate call because
+ * H5F__flush_phase2() make repeated calls to H5AC_flush().
+ * Handling this detail in separate calls allows us to avoid
+ * the overhead of setting up and taking down the skip list
+ * repeatedly.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: John Mainzer
+ * 5/5/20
+ *
+ * Changes: None.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5AC_secure_from_file_flush(H5F_t *f)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ /* Sanity checks */
+ HDassert(f);
+ HDassert(f->shared);
+ HDassert(f->shared->cache);
+
+ if ( H5C_set_slist_enabled(f->shared->cache, FALSE, FALSE) < 0)
+
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "slist enabled failed")
+
+done:
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5AC_secure_from_file_flush() */
+
+
+/*-------------------------------------------------------------------------
+ *
* Function: H5AC_create_flush_dependency()
*
- * Purpose: Create a flush dependency between two entries in the metadata
+ * Purpose: Create a flush dependency between two entries in the metadata
* cache.
*
* Return: Non-negative on success/Negative on failure
@@ -1250,16 +1418,16 @@ done:
* Function: H5AC_protect
*
* Purpose: If the target entry is not in the cache, load it. If
- * necessary, attempt to evict one or more entries to keep
- * the cache within its maximum size.
+ * necessary, attempt to evict one or more entries to keep
+ * the cache within its maximum size.
*
- * Mark the target entry as protected, and return its address
- * to the caller. The caller must call H5AC_unprotect() when
- * finished with the entry.
+ * Mark the target entry as protected, and return its address
+ * to the caller. The caller must call H5AC_unprotect() when
+ * finished with the entry.
*
- * While it is protected, the entry may not be either evicted
- * or flushed -- nor may it be accessed by another call to
- * H5AC_protect. Any attempt to do so will result in a failure.
+ * While it is protected, the entry may not be either evicted
+ * or flushed -- nor may it be accessed by another call to
+ * H5AC_protect. Any attempt to do so will result in a failure.
*
* Return: Success: Ptr to the object.
* Failure: NULL
@@ -1301,7 +1469,7 @@ H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *udata,
/* Check for invalid access request */
if((0 == (H5F_INTENT(f) & H5F_ACC_RDWR)) && (0 == (flags & H5C__READ_ONLY_FLAG)))
- HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
+ HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "no write intent on file")
#if H5AC_DO_TAGGING_SANITY_CHECKS
if(!H5C_get_ignore_tags(f->shared->cache) && H5AC__verify_tag(type) < 0)
@@ -1331,7 +1499,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_resize_entry
*
- * Purpose: Resize a pinned or protected entry.
+ * Purpose: Resize a pinned or protected entry.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1384,8 +1552,8 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_unpin_entry()
*
- * Purpose: Unpin a cache entry. The entry must be unprotected at
- * the time of call, and must be pinned.
+ * Purpose: Unpin a cache entry. The entry must be unprotected at
+ * the time of call, and must be pinned.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1427,7 +1595,7 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_destroy_flush_dependency()
*
- * Purpose: Destroy a flush dependency between two entries.
+ * Purpose: Destroy a flush dependency between two entries.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1470,27 +1638,27 @@ done:
/*-------------------------------------------------------------------------
* Function: H5AC_unprotect
*
- * Purpose: Undo an H5AC_protect() call -- specifically, mark the
- * entry as unprotected, remove it from the protected list,
- * and give it back to the replacement policy.
+ * Purpose: Undo an H5AC_protect() call -- specifically, mark the
+ * entry as unprotected, remove it from the protected list,
+ * and give it back to the replacement policy.
*
- * The TYPE and ADDR arguments must be the same as those in
- * the corresponding call to H5AC_protect() and the THING
- * argument must be the value returned by that call to
- * H5AC_protect().
+ * The TYPE and ADDR arguments must be the same as those in
+ * the corresponding call to H5AC_protect() and the THING
+ * argument must be the value returned by that call to
+ * H5AC_protect().
*
- * If the deleted flag is TRUE, simply remove the target entry
- * from the cache, clear it, and free it without writing it to
- * disk.
+ * If the deleted flag is TRUE, simply remove the target entry
+ * from the cache, clear it, and free it without writing it to
+ * disk.
*
- * This version of the function is a complete re-write to
- * use the new metadata cache. While there isn't all that
- * much difference between the old and new Purpose sections,
- * the original version is given below.
+ * This version of the function is a complete re-write to
+ * use the new metadata cache. While there isn't all that
+ * much difference between the old and new Purpose sections,
+ * the original version is given below.
*
- * Original purpose section:
+ * Original purpose section:
*
- * This function should be called to undo the effect of
+ * This function should be called to undo the effect of
* H5AC_protect(). The TYPE and ADDR arguments should be the
* same as the corresponding call to H5AC_protect() and the
* THING argument should be the value returned by H5AC_protect().
@@ -1509,8 +1677,8 @@ herr_t
H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
unsigned flags)
{
- hbool_t dirtied;
- hbool_t deleted;
+ hbool_t dirtied;
+ hbool_t deleted;
#ifdef H5_HAVE_PARALLEL
H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
@@ -1531,14 +1699,14 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing,
HDassert( ((H5AC_info_t *)thing)->type == type );
dirtied = (hbool_t)(((flags & H5AC__DIRTIED_FLAG) == H5AC__DIRTIED_FLAG) ||
- (((H5AC_info_t *)thing)->dirtied));
+ (((H5AC_info_t *)thing)->dirtied));
deleted = (hbool_t)((flags & H5C__DELETED_FLAG) == H5C__DELETED_FLAG);
/* Check if the size changed out from underneath us, if we're not deleting
* the entry.
*/
if(dirtied && !deleted) {
- size_t curr_size = 0;
+ size_t curr_size = 0;
if((type->image_len)(thing, &curr_size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
@@ -1625,7 +1793,7 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
if(internal_config.rpt_fcn == NULL)
config_ptr->rpt_fcn_enabled = FALSE;
else
- config_ptr->rpt_fcn_enabled = TRUE;
+ config_ptr->rpt_fcn_enabled = TRUE;
config_ptr->open_trace_file = FALSE;
config_ptr->close_trace_file = FALSE;
config_ptr->trace_file_name[0] = '\0';
@@ -1658,12 +1826,12 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
if(NULL != (aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr))) {
config_ptr->dirty_bytes_threshold = aux_ptr->dirty_bytes_threshold;
- config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy;
+ config_ptr->metadata_write_strategy = aux_ptr->metadata_write_strategy;
} /* end if */
else {
#endif /* H5_HAVE_PARALLEL */
config_ptr->dirty_bytes_threshold = H5AC__DEFAULT_DIRTY_BYTES_THRESHOLD;
- config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
+ config_ptr->metadata_write_strategy = H5AC__DEFAULT_METADATA_WRITE_STRATEGY;
#ifdef H5_HAVE_PARALLEL
} /* end else */
}
@@ -1800,7 +1968,7 @@ herr_t
H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config_ptr)
{
H5C_auto_size_ctl_t internal_config;
- herr_t ret_value = SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -1880,16 +2048,16 @@ done:
* Function: H5AC_validate_config()
*
* Purpose: Run a sanity check on the contents of the supplied
- * instance of H5AC_cache_config_t.
+ * instance of H5AC_cache_config_t.
*
* Do nothing and return SUCCEED if no errors are detected,
* and flag an error and return FAIL otherwise.
*
- * At present, this function operates by packing the data
- * from the instance of H5AC_cache_config_t into an instance
- * of H5C_auto_size_ctl_t, and then calling
- * H5C_validate_resize_config(). As H5AC_cache_config_t and
- * H5C_auto_size_ctl_t diverge, we may have to change this.
+ * At present, this function operates by packing the data
+ * from the instance of H5AC_cache_config_t into an instance
+ * of H5C_auto_size_ctl_t, and then calling
+ * H5C_validate_resize_config(). As H5AC_cache_config_t and
+ * H5C_auto_size_ctl_t diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -1914,7 +2082,7 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr)
/* don't bother to test trace_file_name unless open_trace_file is TRUE */
if(config_ptr->open_trace_file) {
- size_t name_len;
+ size_t name_len;
/* Can't really test the trace_file_name field without trying to
* open the file, so we will content ourselves with a couple of
@@ -1957,17 +2125,17 @@ done:
* Function: H5AC_validate_cache_image_config()
*
* Purpose: Run a sanity check on the contents of the supplied
- * instance of H5AC_cache_image_config_t.
+ * instance of H5AC_cache_image_config_t.
*
* Do nothing and return SUCCEED if no errors are detected,
* and flag an error and return FAIL otherwise.
*
- * At present, this function operates by packing the data
- * from the instance of H5AC_cache_image_config_t into an
- * instance of H5C_cache_image_ctl_t, and then calling
- * H5C_validate_cache_image_config(). If and when
+ * At present, this function operates by packing the data
+ * from the instance of H5AC_cache_image_config_t into an
+ * instance of H5C_cache_image_ctl_t, and then calling
+ * H5C_validate_cache_image_config(). If and when
* H5AC_cache_image_config_t and H5C_cache_image_ctl_t
- * diverge, we may have to change this.
+ * diverge, we may have to change this.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2013,13 +2181,13 @@ done:
* Function: H5AC__check_if_write_permitted
*
* Purpose: Determine if a write is permitted under the current
- * circumstances, and set *write_permitted_ptr accordingly.
- * As a general rule it is, but when we are running in parallel
- * mode with collective I/O, we must ensure that a read cannot
- * cause a write.
+ * circumstances, and set *write_permitted_ptr accordingly.
+ * As a general rule it is, but when we are running in parallel
+ * mode with collective I/O, we must ensure that a read cannot
+ * cause a write.
*
- * In the event of failure, the value of *write_permitted_ptr
- * is undefined.
+ * In the event of failure, the value of *write_permitted_ptr
+ * is undefined.
*
* Return: Non-negative on success/Negative on failure.
*
@@ -2035,9 +2203,9 @@ H5_ATTR_UNUSED
*f, hbool_t *write_permitted_ptr)
{
#ifdef H5_HAVE_PARALLEL
- H5AC_aux_t * aux_ptr = NULL;
+ H5AC_aux_t * aux_ptr = NULL;
#endif /* H5_HAVE_PARALLEL */
- hbool_t write_permitted = TRUE;
+ hbool_t write_permitted = TRUE;
FUNC_ENTER_STATIC_NOERR
@@ -2051,9 +2219,9 @@ H5_ATTR_UNUSED
HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
if((aux_ptr->mpi_rank == 0) || (aux_ptr->metadata_write_strategy == H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED))
- write_permitted = aux_ptr->write_permitted;
+ write_permitted = aux_ptr->write_permitted;
else
- write_permitted = FALSE;
+ write_permitted = FALSE;
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -2067,12 +2235,12 @@ H5_ATTR_UNUSED
* Function: H5AC__ext_config_2_int_config()
*
* Purpose: Utility function to translate an instance of
- * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
+ * H5AC_cache_config_t to an instance of H5C_auto_size_ctl_t.
*
- * Places translation in *int_conf_ptr and returns SUCCEED
- * if successful. Returns FAIL on failure.
+ * Places translation in *int_conf_ptr and returns SUCCEED
+ * if successful. Returns FAIL on failure.
*
- * Does only minimal sanity checking.
+ * Does only minimal sanity checking.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2453,7 +2621,7 @@ done:
* Purpose: Given a file address, retrieve the ring for an entry at that
* address.
*
- * On error, the value of *ring is not modified.
+ * On error, the value of *ring is not modified.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2531,11 +2699,11 @@ H5AC_set_ring(H5AC_ring_t ring, H5AC_ring_t *orig_ring)
* 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.
+ * Note that this function simply passes the call on to
+ * the metadata cache proper, and returns the result.
*
- * Return: Success: Non-negative
- * Failure: Negative
+ * Return: Success: Non-negative
+ * Failure: Negative
*
* Programmer: Quincey Koziol
* September 17, 2016
@@ -2608,7 +2776,7 @@ done:
* Function: H5AC_remove_entry()
*
* Purpose: Remove an entry from the cache. Must be not protected, pinned,
- * dirty, involved in flush dependencies, etc.
+ * dirty, involved in flush dependencies, etc.
*
* Return: Non-negative on success/Negative on failure
*
@@ -2669,4 +2837,3 @@ H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_l
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_get_mdc_image_info() */
-