summaryrefslogtreecommitdiffstats
path: root/src/H5MFsection.c
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2023-08-03 12:57:29 (GMT)
committerGitHub <noreply@github.com>2023-08-03 12:57:29 (GMT)
commit7fc8531b767855e69fb4016783a1131ba581fd5b (patch)
treea243310b99da59c858ae4eaeed8c452e0177bba4 /src/H5MFsection.c
parenta77d8bfcd7d066c6759b0346c02cbd612f90b7c2 (diff)
downloadhdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.zip
hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.gz
hdf5-7fc8531b767855e69fb4016783a1131ba581fd5b.tar.bz2
Merge Made HGOTO_ERROR a do-while loop changes from develop (#3334)
Diffstat (limited to 'src/H5MFsection.c')
-rw-r--r--src/H5MFsection.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/H5MFsection.c b/src/H5MFsection.c
index b5255b1..ede7912 100644
--- a/src/H5MFsection.c
+++ b/src/H5MFsection.c
@@ -192,7 +192,7 @@ H5MF__sect_new(unsigned ctype, haddr_t sect_off, hsize_t sect_size)
/* Create free space section node */
if (NULL == (sect = H5FL_MALLOC(H5MF_free_section_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL,
- "memory allocation failed for direct block free list section")
+ "memory allocation failed for direct block free list section");
/* Set the information passed in */
sect->sect_info.addr = sect_off;
@@ -261,7 +261,7 @@ H5MF__sect_deserialize(const H5FS_section_class_t *cls, const uint8_t H5_ATTR_UN
/* Create free space section for block */
if (NULL == (sect = H5MF__sect_new(cls->type, sect_addr, sect_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section");
/* Set return value */
ret_value = (H5FS_section_info_t *)sect;
@@ -319,7 +319,7 @@ H5MF__sect_split(H5FS_section_info_t *sect, hsize_t frag_size)
/* Allocate space for new section */
if (NULL == (ret_value = H5MF__sect_new(sect->type, sect->addr, frag_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't initialize free space section");
/* Set new section's info */
sect->addr += frag_size;
@@ -401,7 +401,7 @@ H5MF__sect_simple_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect
/* Get rid of second section */
if (H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -435,7 +435,7 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Retrieve the end of the file's address space */
if (HADDR_UNDEF == (eoa = H5F_get_eoa(udata->f, udata->alloc_type)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed");
/* Compute address of end of section to check */
end = sect->sect_info.addr + sect->sect_info.size;
@@ -464,7 +464,8 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* See if section can absorb the aggregator & vice versa */
if ((status = H5MF__aggr_can_absorb(udata->f, &(udata->f->shared->meta_aggr), sect,
&(udata->shrink))) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "error merging section with aggregation block")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL,
+ "error merging section with aggregation block");
else if (status > 0) {
/* Set the aggregator to operate on */
udata->aggr = &(udata->f->shared->meta_aggr);
@@ -485,7 +486,8 @@ H5MF__sect_simple_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* See if section can absorb the aggregator & vice versa */
if ((status = H5MF__aggr_can_absorb(udata->f, &(udata->f->shared->sdata_aggr), sect,
&(udata->shrink))) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "error merging section with aggregation block")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL,
+ "error merging section with aggregation block");
else if (status > 0) {
/* Set the aggregator to operate on */
udata->aggr = &(udata->f->shared->sdata_aggr);
@@ -539,7 +541,7 @@ H5MF__sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
/* Release section's space at EOA */
if (H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr, (*sect)->sect_info.size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed");
} /* end if */
else {
/* Sanity check */
@@ -548,14 +550,14 @@ H5MF__sect_simple_shrink(H5FS_section_info_t **_sect, void *_udata)
/* Absorb the section into the aggregator or vice versa */
if (H5MF__aggr_absorb(udata->f, udata->aggr, *sect, udata->allow_sect_absorb) < 0)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL,
- "can't absorb section into aggregator or vice versa")
+ "can't absorb section into aggregator or vice versa");
} /* end else */
/* Check for freeing section */
if (udata->shrink != H5MF_SHRINK_SECT_ABSORB_AGGR) {
/* Free section */
if (H5MF__sect_free((H5FS_section_info_t *)*sect) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node");
/* Mark section as freed, for free space manager */
*sect = NULL;
@@ -610,7 +612,7 @@ H5MF__sect_small_add(H5FS_section_info_t **_sect, unsigned *flags, void *_udata)
if (!rem && (*sect)->sect_info.size <= H5F_PGEND_META_THRES(udata->f) &&
(*flags & H5FS_ADD_RETURNED_SPACE)) {
if (H5MF__sect_free((H5FS_section_info_t *)(*sect)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node");
*sect = NULL;
*flags &= (unsigned)~H5FS_ADD_RETURNED_SPACE;
*flags |= H5FS_PAGE_END_NO_ADD;
@@ -711,7 +713,7 @@ H5MF__sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2
if ((*sect1)->sect_info.size == udata->f->shared->fs_page_size) {
if (H5MF_xfree(udata->f, udata->alloc_type, (*sect1)->sect_info.addr, (*sect1)->sect_info.size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section");
/* Need to free possible metadata page in the PB cache */
/* This is in response to the data corruption bug from fheap.c with page buffering + page strategy */
@@ -719,16 +721,16 @@ H5MF__sect_small_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2
/* Note: Update of raw data page (large or small sized) is handled by the PB cache */
if (udata->f->shared->page_buf != NULL && udata->alloc_type != H5FD_MEM_DRAW)
if (H5PB_remove_entry(udata->f->shared, (*sect1)->sect_info.addr) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't free merged section");
if (H5MF__sect_free((H5FS_section_info_t *)(*sect1)) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node");
*sect1 = NULL;
} /* end if */
/* Get rid of second section */
if (H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -808,7 +810,7 @@ H5MF__sect_large_merge(H5FS_section_info_t **_sect1, H5FS_section_info_t *_sect2
/* Get rid of second section */
if (H5MF__sect_free((H5FS_section_info_t *)sect2) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free section node");
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -843,7 +845,7 @@ H5MF__sect_large_can_shrink(const H5FS_section_info_t *_sect, void *_udata)
/* Retrieve the end of the file's address space */
if (HADDR_UNDEF == (eoa = H5FD_get_eoa(udata->f->shared->lf, udata->alloc_type)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed");
/* Compute address of end of section to check */
end = sect->sect_info.addr + sect->sect_info.size;
@@ -901,14 +903,14 @@ H5MF__sect_large_shrink(H5FS_section_info_t **_sect, void *_udata)
/* Retain partial page in the free-space manager so as to keep EOA at page boundary */
if (H5F__free(udata->f, udata->alloc_type, (*sect)->sect_info.addr + frag_size,
(*sect)->sect_info.size - frag_size) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "driver free request failed");
if (frag_size) /* Adjust section size for the partial page */
(*sect)->sect_info.size = frag_size;
else {
/* Free section */
if (H5MF__sect_free((H5FS_section_info_t *)*sect) < 0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node");
/* Mark section as freed, for free space manager */
*sect = NULL;