summaryrefslogtreecommitdiffstats
path: root/src/H5EAcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5EAcache.c')
-rw-r--r--src/H5EAcache.c699
1 files changed, 398 insertions, 301 deletions
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index 2a3153c..eeac1a2 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -221,12 +221,13 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_hdr_cache_ud_t *udata = (H5EA_hdr_cache_ud_t *)_udata; /* User data for callback */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->f);
@@ -235,7 +236,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_HEADER_SIZE_FILE(udata->f);
-END_FUNC(STATIC) /* end H5EA__cache_hdr_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_verify_chksum
@@ -250,13 +252,15 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -267,7 +271,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5EA__cache_hdr_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_deserialize
@@ -282,16 +287,17 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_cls_id_t id; /* ID of extensible array class, as found in file */
H5EA_hdr_t * hdr = NULL; /* Extensible array info */
H5EA_hdr_cache_ud_t *udata = (H5EA_hdr_cache_ud_t *)_udata;
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(image);
@@ -301,24 +307,25 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate space for the extensible array data structure */
if (NULL == (hdr = H5EA__hdr_alloc(udata->f)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array shared header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array shared header")
/* Set the extensible array header's address */
hdr->addr = udata->addr;
/* Magic number */
if (HDmemcmp(image, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header signature")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_HDR_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array header version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array header version")
/* Extensible array class */
id = (H5EA_cls_id_t)*image++;
if (id >= H5EA_NUM_CLS_ID)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
hdr->cparam.cls = H5EA_client_class_g[id];
/* General array creation/configuration information */
@@ -379,20 +386,20 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Finish initializing extensible array header */
if (H5EA__hdr_init(hdr, udata->ctx_udata) < 0)
- H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTINIT, NULL, "initialization failed for extensible array header")
HDassert(hdr->size == len);
/* Set return value */
ret_value = hdr;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (hdr && H5EA__hdr_dest(hdr) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array header")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array header")
-END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_image_len
@@ -406,12 +413,13 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_hdr_t *hdr = (const H5EA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -419,7 +427,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = hdr->size;
-END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_serialize
@@ -433,14 +442,15 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the extensible array header */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ FUNC_ENTER_STATIC_NOERR
+
/* check arguments */
HDassert(f);
HDassert(image);
@@ -488,7 +498,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5EA__cache_hdr_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_hdr_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_notify
@@ -502,11 +513,13 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_hdr_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_hdr_t *hdr = (H5EA_hdr_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(hdr);
@@ -538,23 +551,24 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on object header proxy */
if (H5AC_proxy_entry_remove_child((H5AC_proxy_entry_t *)hdr->parent,
(void *)hdr->top_proxy) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between extensible array and proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between extensible array and proxy")
hdr->parent = NULL;
} /* end if */
/* Detach from 'top' proxy for extensible array */
if (hdr->top_proxy) {
if (H5AC_proxy_entry_remove_child(hdr->top_proxy, hdr) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between header and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between header and "
+ "extensible array 'top' proxy")
/* Don't reset hdr->top_proxy here, it's destroyed when the header is freed -QAK */
} /* end if */
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
@@ -563,9 +577,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
else
HDassert(NULL == hdr->parent);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_hdr_free_icr
@@ -580,18 +594,23 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_hdr_free_icr(void *thing))
+static herr_t
+H5EA__cache_hdr_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array header */
if (H5EA__hdr_dest((H5EA_hdr_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array header")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array header")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_hdr_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_get_initial_load_size
@@ -605,13 +624,14 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_hdr_t * hdr = (H5EA_hdr_t *)_udata; /* User data for callback */
H5EA_iblock_t iblock; /* Fake index block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(hdr);
HDassert(image_len);
@@ -626,7 +646,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_IBLOCK_SIZE(&iblock);
-END_FUNC(STATIC) /* end H5EA__cache_iblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_iblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_verify_chksum
@@ -641,13 +662,15 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -658,7 +681,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_deserialize
@@ -673,17 +697,18 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_iblock_t *iblock = NULL; /* Index block info */
H5EA_hdr_t * hdr = (H5EA_hdr_t *)_udata; /* User data for callback */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
size_t u; /* Local index variable */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(image);
@@ -691,28 +716,29 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array index block */
if (NULL == (iblock = H5EA__iblock_alloc(hdr)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array index block")
/* Set the extensible array index block's address */
iblock->addr = hdr->idx_blk_addr;
/* Magic number */
if (HDmemcmp(image, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong extensible array index block signature")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array index block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_IBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array index block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array index block version")
/* Extensible array type */
if (*image++ != (uint8_t)hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Internal information */
@@ -721,7 +747,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((hdr->cparam.cls->decode)(image, iblock->elmts, (size_t)hdr->cparam.idx_blk_elmts, hdr->cb_ctx) <
0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array index elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array index elements")
image += (hdr->cparam.idx_blk_elmts * hdr->cparam.raw_elmt_size);
} /* end if */
@@ -757,14 +783,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = iblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (iblock && H5EA__iblock_dest(iblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array index block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array index block")
-END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_image_len
@@ -778,12 +804,13 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_iblock_t *iblock = (const H5EA_iblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(iblock);
HDassert(image_len);
@@ -791,7 +818,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = iblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_iblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_serialize
@@ -805,14 +833,15 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(f);
@@ -843,7 +872,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((iblock->hdr->cparam.cls->encode)(image, iblock->elmts, (size_t)iblock->hdr->cparam.idx_blk_elmts,
iblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array index elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array index elements")
image += (iblock->hdr->cparam.idx_blk_elmts * iblock->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -874,9 +903,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_notify
@@ -890,11 +919,13 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_iblock_t *iblock = (H5EA_iblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(iblock);
@@ -905,9 +936,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on extensible array header */
if (H5EA__create_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between index block and header, address = %llu",
- (unsigned long long)iblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between index block and header, address = %llu",
+ (unsigned long long)iblock->addr)
break;
case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
@@ -923,30 +955,32 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on extensible array header */
if (H5EA__destroy_flush_depend((H5AC_info_t *)iblock->hdr, (H5AC_info_t *)iblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between index block and header, address = %llu",
- (unsigned long long)iblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between index block and header, address = %llu",
+ (unsigned long long)iblock->addr)
/* Detach from 'top' proxy for extensible array */
if (iblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(iblock->top_proxy, iblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between index block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between index block and "
+ "extensible array 'top' proxy")
iblock->top_proxy = NULL;
} /* end if */
break;
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_iblock_free_icr
@@ -961,18 +995,23 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_iblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_iblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array index block */
if (H5EA__iblock_dest((H5EA_iblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array index block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array index block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_iblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_get_initial_load_size
@@ -986,13 +1025,14 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */
H5EA_sblock_t sblock; /* Fake super block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1026,7 +1066,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_SBLOCK_SIZE(&sblock);
-END_FUNC(STATIC) /* end H5EA__cache_sblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_verify_chksum
@@ -1041,13 +1082,15 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_sblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1058,7 +1101,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_deserialize
@@ -1073,17 +1117,18 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_sblock_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_sblock_t * sblock = NULL; /* Super block info */
H5EA_sblock_cache_ud_t *udata = (H5EA_sblock_cache_ud_t *)_udata; /* User data */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
size_t u; /* Local index variable */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -1094,28 +1139,29 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array super block */
if (NULL == (sblock = H5EA__sblock_alloc(udata->hdr, udata->parent, udata->sblk_idx)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array super block")
/* Set the extensible array super block's address */
sblock->addr = udata->sblk_addr;
/* Magic number */
if (HDmemcmp(image, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong extensible array super block signature")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array super block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_SBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array super block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array super block version")
/* Extensible array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Offset of block within the array's address space */
UINT64DECODE_VAR(image, sblock->block_off, udata->hdr->arr_off_size);
@@ -1154,14 +1200,14 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = sblock;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (sblock && H5EA__sblock_dest(sblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array super block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array super block")
-END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_image_len
@@ -1175,12 +1221,13 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_sblock_t *sblock = (const H5EA_sblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(sblock);
HDassert(image_len);
@@ -1188,7 +1235,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = sblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_serialize
@@ -1202,16 +1250,16 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_sblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
size_t u; /* Local index variable */
+ FUNC_ENTER_STATIC_NOERR
+
/* check arguments */
HDassert(f);
HDassert(image);
@@ -1260,7 +1308,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
-END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_sblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_notify
@@ -1274,11 +1323,13 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_sblock_t *sblock = (H5EA_sblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(sblock);
@@ -1289,8 +1340,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on index block */
if (H5EA__create_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between super block and index block, address = %llu",
(unsigned long long)sblock->addr)
break;
@@ -1299,8 +1350,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on extensible array header, if set */
if (sblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and header, address = %llu",
(unsigned long long)sblock->addr)
sblock->has_hdr_depend = FALSE;
@@ -1310,16 +1361,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on index block */
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->parent, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and index block, address = %llu",
(unsigned long long)sblock->addr)
/* Destroy flush dependency on extensible array header, if set */
if (sblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)sblock->hdr, (H5AC_info_t *)sblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between super block and header, address = %llu",
(unsigned long long)sblock->addr)
sblock->has_hdr_depend = FALSE;
@@ -1328,8 +1379,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for extensible array */
if (sblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(sblock->top_proxy, sblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between super block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between super block and "
+ "extensible array 'top' proxy")
sblock->top_proxy = NULL;
} /* end if */
break;
@@ -1345,15 +1397,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_sblock_free_icr
@@ -1368,18 +1420,23 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_sblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_sblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array super block */
if (H5EA__sblock_dest((H5EA_sblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array super block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array super block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_get_initial_load_size
@@ -1393,13 +1450,14 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */
H5EA_dblock_t dblock; /* Fake data block for computing size */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1434,7 +1492,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = H5EA_DBLOCK_PREFIX_SIZE(&dblock);
-END_FUNC(STATIC) /* end H5EA__cache_dblock_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_verify_chksum
@@ -1449,13 +1508,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_dblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1466,7 +1527,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_sblock_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_deserialize
@@ -1481,16 +1543,18 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata,
+ hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_dblock_t * dblock = NULL; /* Data block info */
H5EA_dblock_cache_ud_t *udata = (H5EA_dblock_cache_ud_t *)_udata; /* User data */
const uint8_t * image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
haddr_t arr_addr; /* Address of array header in the file */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_PACKAGE
/* Check arguments */
HDassert(udata);
@@ -1501,7 +1565,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array data block */
if (NULL == (dblock = H5EA__dblock_alloc(udata->hdr, udata->parent, udata->nelmts)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block")
HDassert(((!dblock->npages) && (len == H5EA_DBLOCK_SIZE(dblock))) ||
(len == H5EA_DBLOCK_PREFIX_SIZE(dblock)));
@@ -1511,21 +1576,21 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Magic number */
if (HDmemcmp(image, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC) != 0)
- H5E_THROW(H5E_BADVALUE, "wrong extensible array data block signature")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array data block signature")
image += H5_SIZEOF_MAGIC;
/* Version */
if (*image++ != H5EA_DBLOCK_VERSION)
- H5E_THROW(H5E_VERSION, "wrong extensible array data block version")
+ HGOTO_ERROR(H5E_EARRAY, H5E_VERSION, NULL, "wrong extensible array data block version")
/* Extensible array type */
if (*image++ != (uint8_t)udata->hdr->cparam.cls->id)
- H5E_THROW(H5E_BADTYPE, "incorrect extensible array class")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADTYPE, NULL, "incorrect extensible array class")
/* Address of header for array that owns this block (just for file integrity checks) */
H5F_addr_decode(udata->hdr->f, &image, &arr_addr);
if (H5F_addr_ne(arr_addr, udata->hdr->addr))
- H5E_THROW(H5E_BADVALUE, "wrong extensible array header address")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, NULL, "wrong extensible array header address")
/* Offset of block within the array's address space */
UINT64DECODE_VAR(image, dblock->block_off, udata->hdr->arr_off_size);
@@ -1537,7 +1602,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Decode elements in data block */
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblock->elmts, udata->nelmts, udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array data elements")
image += (udata->nelmts * udata->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -1560,14 +1625,15 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblock;
- CATCH
+done:
/* Release resources */
if (!ret_value)
if (dblock && H5EA__dblock_dest(dblock) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block")
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block")
-END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5EA__cache_dblock_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_image_len
@@ -1581,12 +1647,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(image_len);
@@ -1597,7 +1664,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
else
*image_len = (size_t)H5EA_DBLOCK_PREFIX_SIZE(dblock);
-END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_serialize
@@ -1611,14 +1679,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len,
- void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)
+{
H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* check arguments */
HDassert(f);
@@ -1651,7 +1720,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblock->hdr->cparam.cls->encode)(image, dblock->elmts, dblock->nelmts, dblock->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array data elements")
image += (dblock->nelmts * dblock->hdr->cparam.raw_elmt_size);
} /* end if */
@@ -1664,9 +1733,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_notify
@@ -1680,11 +1749,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing))
+static herr_t
+H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
- /* Local variables */
- H5EA_dblock_t *dblock = (H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(dblock);
@@ -1695,17 +1766,17 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5EA__create_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTDEPEND,
- "unable to create flush dependency between data block and parent, address = %llu",
- (unsigned long long)dblock->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDEPEND, FAIL,
+ "unable to create flush dependency between data block and parent, address = %llu",
+ (unsigned long long)dblock->addr)
break;
case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
/* Destroy flush dependency on extensible array header, if set */
if (dblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between direct block and header, address = %llu",
(unsigned long long)dblock->addr)
dblock->has_hdr_depend = FALSE;
@@ -1715,15 +1786,16 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->parent, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block and parent, address = %llu",
- (unsigned long long)dblock->addr)
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block and parent, address = %llu",
+ (unsigned long long)dblock->addr)
/* Destroy flush dependency on extensible array header, if set */
if (dblock->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblock->hdr, (H5AC_info_t *)dblock) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between data block and header, address = %llu",
(unsigned long long)dblock->addr)
dblock->has_hdr_depend = FALSE;
@@ -1732,8 +1804,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Detach from 'top' proxy for extensible array */
if (dblock->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblock->top_proxy, dblock) < 0)
- H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency between data block and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block and "
+ "extensible array 'top' proxy")
dblock->top_proxy = NULL;
} /* end if */
break;
@@ -1749,15 +1822,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_free_icr
@@ -1772,18 +1845,23 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblock_free_icr(void *thing))
+static herr_t
+H5EA__cache_dblock_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array data block */
if (H5EA__dblock_dest((H5EA_dblock_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array data block")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array data block")
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblock_free_icr() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblock_fsf_size
@@ -1814,12 +1892,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblock_fsf_size(const void *_thing, hsize_t *fsf_size)
+{
const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblock);
HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
@@ -1828,7 +1907,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
*fsf_size = dblock->size;
-END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblock_fsf_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_get_initial_load_size
@@ -1842,12 +1922,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_fsf_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_get_initial_load_size(void *_udata, size_t *image_len)
+{
H5EA_dblk_page_cache_ud_t *udata = (H5EA_dblk_page_cache_ud_t *)_udata; /* User data */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(udata);
HDassert(udata->hdr);
@@ -1856,7 +1937,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = (size_t)H5EA_DBLK_PAGE_SIZE(udata->hdr);
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_get_initial_load_size() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblk_page_get_initial_load_size() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_verify_chksum
@@ -1871,13 +1953,15 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_get_initial_load_size() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
- H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata))
-
- /* Local variables */
+static htri_t
+H5EA__cache_dblk_page_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSED *_udata)
+{
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
uint32_t computed_chksum; /* Computed metadata checksum value */
+ htri_t ret_value = TRUE;
+
+ FUNC_ENTER_STATIC_NOERR
/* Check arguments */
HDassert(image);
@@ -1888,7 +1972,8 @@ BEGIN_FUNC(STATIC, NOERR, htri_t, TRUE, -,
if (stored_chksum != computed_chksum)
ret_value = FALSE;
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_verify_chksum() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_deserialize
@@ -1903,16 +1988,17 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_verify_chksum() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
- H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata,
- hbool_t H5_ATTR_UNUSED *dirty))
-
- /* Local variables */
+static void *
+H5EA__cache_dblk_page_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)
+{
H5EA_dblk_page_t * dblk_page = NULL; /* Data block page info */
H5EA_dblk_page_cache_ud_t *udata =
(H5EA_dblk_page_cache_ud_t *)_udata; /* User data for loading data block page */
const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t stored_chksum; /* Stored metadata checksum value */
+ void * ret_value = NULL;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(udata);
@@ -1922,7 +2008,8 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Allocate the extensible array data block page */
if (NULL == (dblk_page = H5EA__dblk_page_alloc(udata->hdr, udata->parent)))
- H5E_THROW(H5E_CANTALLOC, "memory allocation failed for extensible array data block page")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTALLOC, NULL,
+ "memory allocation failed for extensible array data block page")
/* Set the extensible array data block page's information */
dblk_page->addr = udata->dblk_page_addr;
@@ -1933,7 +2020,7 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Convert from raw elements on disk into native elements in memory */
if ((udata->hdr->cparam.cls->decode)(image, dblk_page->elmts, udata->hdr->dblk_page_nelmts,
udata->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTDECODE, "can't decode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTDECODE, NULL, "can't decode extensible array data elements")
image += (udata->hdr->dblk_page_nelmts * udata->hdr->cparam.raw_elmt_size);
/* Sanity check */
@@ -1954,14 +2041,13 @@ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL,
/* Set return value */
ret_value = dblk_page;
- CATCH
-
+done:
/* Release resources */
if (!ret_value)
if (dblk_page && H5EA__dblk_page_dest(dblk_page) < 0)
- H5E_THROW(H5E_CANTFREE, "unable to destroy extensible array data block page")
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
+ HDONE_ERROR(H5E_EARRAY, H5E_CANTFREE, NULL, "unable to destroy extensible array data block page")
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_deserialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_image_len
@@ -1975,12 +2061,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
- H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len)
+{
const H5EA_dblk_page_t *dblk_page = (const H5EA_dblk_page_t *)_thing; /* Pointer to the object */
+ FUNC_ENTER_STATIC_NOERR
+
/* Check arguments */
HDassert(dblk_page);
HDassert(image_len);
@@ -1988,7 +2075,8 @@ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -,
/* Set the image length size */
*image_len = dblk_page->size;
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5EA__cache_dblk_page_image_len() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_serialize
@@ -2002,14 +2090,16 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image,
- size_t H5_ATTR_UNUSED len, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len,
+ void *_thing)
+{
H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object to serialize */
uint8_t * image = (uint8_t *)_image; /* Pointer into raw data buffer */
uint32_t metadata_chksum; /* Computed metadata checksum value */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(f);
@@ -2024,7 +2114,7 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Convert from native elements in memory into raw elements on disk */
if ((dblk_page->hdr->cparam.cls->encode)(image, dblk_page->elmts, dblk_page->hdr->dblk_page_nelmts,
dblk_page->hdr->cb_ctx) < 0)
- H5E_THROW(H5E_CANTENCODE, "can't encode extensible array data elements")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTENCODE, FAIL, "can't encode extensible array data elements")
image += (dblk_page->hdr->dblk_page_nelmts * dblk_page->hdr->cparam.raw_elmt_size);
/* Compute metadata checksum */
@@ -2036,9 +2126,9 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Sanity check */
HDassert((size_t)(image - (uint8_t *)_image) == len);
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_serialize() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_notify
@@ -2052,11 +2142,13 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_serialize() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
- H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing))
-
- /* Local variables */
+static herr_t
+H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *_thing)
+{
H5EA_dblk_page_t *dblk_page = (H5EA_dblk_page_t *)_thing; /* Pointer to the object */
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(dblk_page);
@@ -2067,8 +2159,8 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_AFTER_LOAD:
/* Create flush dependency on parent */
if (H5EA__create_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(
- H5E_CANTDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTDEPEND, FAIL,
"unable to create flush dependency between data block page and parent, address = %llu",
(unsigned long long)dblk_page->addr)
break;
@@ -2077,10 +2169,10 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
/* Destroy flush dependency on extensible array header, if set */
if (dblk_page->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->hdr, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and header, "
- "address = %llu",
- (unsigned long long)dblk_page->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and header, "
+ "address = %llu",
+ (unsigned long long)dblk_page->addr)
dblk_page->has_hdr_depend = FALSE;
} /* end if */
break;
@@ -2088,27 +2180,27 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
/* Destroy flush dependency on parent */
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->parent, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(
- H5E_CANTUNDEPEND,
+ HGOTO_ERROR(
+ H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
"unable to destroy flush dependency between data block page and parent, address = %llu",
(unsigned long long)dblk_page->addr)
/* Destroy flush dependency on extensible array header, if set */
if (dblk_page->has_hdr_depend) {
if (H5EA__destroy_flush_depend((H5AC_info_t *)dblk_page->hdr, (H5AC_info_t *)dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and header, "
- "address = %llu",
- (unsigned long long)dblk_page->addr)
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and header, "
+ "address = %llu",
+ (unsigned long long)dblk_page->addr)
dblk_page->has_hdr_depend = FALSE;
} /* end if */
/* Detach from 'top' proxy for extensible array */
if (dblk_page->top_proxy) {
if (H5AC_proxy_entry_remove_child(dblk_page->top_proxy, dblk_page) < 0)
- H5E_THROW(H5E_CANTUNDEPEND,
- "unable to destroy flush dependency between data block page and "
- "extensible array 'top' proxy")
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTUNDEPEND, FAIL,
+ "unable to destroy flush dependency between data block page and "
+ "extensible array 'top' proxy")
dblk_page->top_proxy = NULL;
} /* end if */
break;
@@ -2124,15 +2216,15 @@ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL,
default:
#ifdef NDEBUG
- H5E_THROW(H5E_BADVALUE, "unknown action from metadata cache")
+ HGOTO_ERROR(H5E_EARRAY, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
#else /* NDEBUG */
HDassert(0 && "Unknown action?!?");
#endif /* NDEBUG */
} /* end switch */
- CATCH
-
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_notify() */
/*-------------------------------------------------------------------------
* Function: H5EA__cache_dblk_page_free_icr
@@ -2147,15 +2239,20 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_notify() */
*
*-------------------------------------------------------------------------
*/
-BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, H5EA__cache_dblk_page_free_icr(void *thing))
+static herr_t
+H5EA__cache_dblk_page_free_icr(void *thing)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_STATIC
/* Check arguments */
HDassert(thing);
/* Release the extensible array data block page */
if (H5EA__dblk_page_dest((H5EA_dblk_page_t *)thing) < 0)
- H5E_THROW(H5E_CANTFREE, "can't free extensible array data block page")
-
- CATCH
+ HGOTO_ERROR(H5E_EARRAY, H5E_CANTFREE, FAIL, "can't free extensible array data block page")
-END_FUNC(STATIC) /* end H5EA__cache_dblk_page_free_icr() */
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5EA__cache_dblk_page_free_icr() */