summaryrefslogtreecommitdiffstats
path: root/src/H5Doh.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-06-09 22:09:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-06-09 22:09:08 (GMT)
commit005bf26ff83fcd28255a77fb9bbb4a64495cb4a2 (patch)
treecbaf52a8a57f0fb6ad45c74b3193e6ee55ecbc78 /src/H5Doh.c
parenteaedb70001536ae6c2a7f753c3a358f0e8ce5011 (diff)
downloadhdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.zip
hdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.tar.gz
hdf5-005bf26ff83fcd28255a77fb9bbb4a64495cb4a2.tar.bz2
Revert "Merge pull request #567 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop to develop"
This reverts commit 4242753848c44ab3b5d226e66225eac2f64db314, reversing changes made to b0e79fe6dd20ec7aa1b3e5f0f8b370639a4ef5bd.
Diffstat (limited to 'src/H5Doh.c')
-rw-r--r--src/H5Doh.c46
1 files changed, 19 insertions, 27 deletions
diff --git a/src/H5Doh.c b/src/H5Doh.c
index b371519..9abbdff 100644
--- a/src/H5Doh.c
+++ b/src/H5Doh.c
@@ -87,9 +87,6 @@ const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{
/* Declare a free list to manage the H5D_copy_file_ud_t struct */
H5FL_DEFINE(H5D_copy_file_ud_t);
-/* Declare a free list to manage the H5O_layout_t struct */
-H5FL_EXTERN(H5O_layout_t);
-
/*-------------------------------------------------------------------------
* Function: H5O__dset_get_copy_file_udata
@@ -362,12 +359,12 @@ done:
static herr_t
H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info)
{
- H5O_layout_t *layout = NULL; /* Data storage layout message */
- H5O_efl_t efl; /* External File List message */
+ H5O_layout_t layout; /* Data storage layout message */
+ H5O_efl_t efl; /* External File List message */
hbool_t layout_read = FALSE; /* Whether the layout message was read */
hbool_t efl_read = FALSE; /* Whether the external file list message was read */
- htri_t exists; /* Flag if header message of interest exists */
- herr_t ret_value = SUCCEED; /* Return value */
+ htri_t exists; /* Flag if header message of interest exists */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
@@ -379,24 +376,22 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *
HDassert(bh_info);
/* Get the layout message from the object header */
- if(NULL == (layout = H5FL_CALLOC(H5O_layout_t)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't get memory for layout")
- if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, layout))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message")
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_LAYOUT_ID, &layout))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message")
layout_read = TRUE;
/* Check for chunked dataset storage */
- if(layout->type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&(layout->storage))) {
+ if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) {
/* Get size of chunk index */
- if(H5D__chunk_bh_info(loc, dxpl_id, oh, layout, &(bh_info->index_size)) < 0)
+ if(H5D__chunk_bh_info(loc, dxpl_id, oh, &layout, &(bh_info->index_size)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info")
} /* end if */
- else if(layout->type == H5D_VIRTUAL
- && (layout->storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) {
+ else if(layout.type == H5D_VIRTUAL
+ && (layout.storage.u.virt.serial_list_hobjid.addr != HADDR_UNDEF)) {
size_t virtual_heap_size;
/* Get size of global heap object for virtual dataset */
- if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout->storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0)
+ if(H5HG_get_obj_size(loc->file, dxpl_id, &(layout.storage.u.virt.serial_list_hobjid), &virtual_heap_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get global heap size for virtual dataset mapping")
/* Return heap size */
@@ -405,32 +400,29 @@ H5O__dset_bh_info(const H5O_loc_t *loc, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *
/* Check for External File List message in the object header */
if((exists = H5O_msg_exists_oh(oh, H5O_EFL_ID)) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message")
+ HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message")
- if(exists && H5D__efl_is_space_alloc(&(layout->storage))) {
+ if(exists && H5D__efl_is_space_alloc(&layout.storage)) {
/* Start with clean EFL info */
HDmemset(&efl, 0, sizeof(efl));
- /* Get External File List message from the object header */
- if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl))
- HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message")
+ /* Get External File List message from the object header */
+ if(NULL == H5O_msg_read_oh(loc->file, dxpl_id, oh, H5O_EFL_ID, &efl))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find EFL message")
efl_read = TRUE;
- /* Get size of local heap for EFL message's file list */
- if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0)
+ /* Get size of local heap for EFL message's file list */
+ if(H5D__efl_bh_info(loc->file, dxpl_id, &efl, &(bh_info->heap_size)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info")
} /* end if */
done:
/* Free messages, if they've been read in */
- if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, layout) < 0)
+ if(layout_read && H5O_msg_reset(H5O_LAYOUT_ID, &layout) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset data storage layout message")
if(efl_read && H5O_msg_reset(H5O_EFL_ID, &efl) < 0)
HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message")
- if(layout)
- layout = H5FL_FREE(H5O_layout_t, layout);
-
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__dset_bh_info() */