diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-12-14 15:22:29 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-12-14 15:22:29 (GMT) |
commit | 7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a (patch) | |
tree | 6bd24199653eff3e99f312d748ba4909686bef61 /src/H5Doh.c | |
parent | 8e9b142d9cd347432d400b4f9b3b88a3f047c06d (diff) | |
parent | 2cb441c507dfbd4437ccf29e232a9b730e6e1003 (diff) | |
download | hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.zip hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.gz hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.bz2 |
[svn-r28636] merge from trunk.
Diffstat (limited to 'src/H5Doh.c')
-rw-r--r-- | src/H5Doh.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/src/H5Doh.c b/src/H5Doh.c index f8a733d..8b70362 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -53,7 +53,7 @@ static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); static H5O_loc_t *H5O__dset_get_oloc(hid_t obj_id); -static herr_t H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +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); static herr_t H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id); @@ -359,13 +359,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +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; /* Data storage layout message */ - H5O_pline_t pline; /* I/O pipeline message */ H5O_efl_t efl; /* External File List message */ hbool_t layout_read = FALSE; /* Whether the layout message was read */ - hbool_t pline_read = FALSE; /* Whether the I/O pipeline 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 */ @@ -373,29 +371,21 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) FUNC_ENTER_STATIC /* Sanity check */ - HDassert(f); + HDassert(loc); + HDassert(loc->file); + HDassert(H5F_addr_defined(loc->addr)); HDassert(oh); HDassert(bh_info); /* Get the layout message from the object header */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_LAYOUT_ID, &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") layout_read = TRUE; /* Check for chunked dataset storage */ if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { - /* Check for I/O pipeline message */ - if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header") - else if(exists) { - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_PLINE_ID, &pline)) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find I/O pipeline message") - pline_read = TRUE; - } /* end else if */ - else - HDmemset(&pline, 0, sizeof(pline)); - - if(H5D__chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size)) < 0) + /* Get size of chunk index */ + 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 @@ -403,7 +393,7 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) size_t virtual_heap_size; /* Get size of global heap object for virtual dataset */ - if(H5HG_get_obj_size(f, 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 */ @@ -419,12 +409,12 @@ H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HDmemset(&efl, 0, sizeof(efl)); /* Get External File List message from the object header */ - if(NULL == H5O_msg_read_oh(f, dxpl_id, oh, H5O_EFL_ID, &efl)) + 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(f, dxpl_id, &efl, &(bh_info->heap_size)) < 0) + 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 */ @@ -432,8 +422,6 @@ done: /* Free messages, if they've been read in */ 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(pline_read && H5O_msg_reset(H5O_PLINE_ID, &pline) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset I/O pipeline 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") @@ -458,8 +446,8 @@ static herr_t H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) { H5D_t *dset = NULL; /* Dataset opened */ - H5O_type_t obj_type; /* Type of object at location */ - herr_t ret_value = SUCCEED; /* Return value */ + H5O_type_t obj_type; /* Type of object at location */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -469,7 +457,6 @@ H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) /* Check that the object found is the correct type */ if(H5O_obj_type(obj_loc->oloc, &obj_type, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") - if(obj_type != H5O_TYPE_DATASET) HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") |