diff options
Diffstat (limited to 'src/H5Dint.c')
-rw-r--r-- | src/H5Dint.c | 361 |
1 files changed, 183 insertions, 178 deletions
diff --git a/src/H5Dint.c b/src/H5Dint.c index c9e64cb..1086c98 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -20,7 +20,7 @@ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D_init_interface +#define H5_INTERFACE_INIT_FUNC H5D__init_interface /***********/ @@ -57,19 +57,19 @@ typedef struct { /********************/ /* General stuff */ -static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, - hsize_t old_dim[], hid_t dxpl_id); -static herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); -static H5D_shared_t *H5D_new(hid_t dcpl_id, hbool_t creating, +static herr_t H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static herr_t H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, +static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type); -static herr_t H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); -static herr_t H5D_swmr_setup(const H5D_t *dset, hid_t dxpl_id); -static herr_t H5D_swmr_teardown(const H5D_t *dataset, hid_t dxpl_id); -static herr_t H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); +static herr_t H5D__swmr_setup(const H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__swmr_teardown(const H5D_t *dataset, hid_t dxpl_id); +static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__init_storage(H5D_t *dataset, hbool_t full_overwrite, + hsize_t old_dim[], hid_t dxpl_id); /*********************/ @@ -108,6 +108,15 @@ H5FL_EXTERN(H5D_chunk_info_t); /* Define a static "default" dataset structure to use to initialize new datasets */ static H5D_shared_t H5D_def_dset; +/* Dataset ID class */ +static const H5I_class_t H5I_DATASET_CLS[1] = {{ + H5I_DATASET, /* ID class value */ + 0, /* Class flags */ + 64, /* Minimum hash size for class */ + 0, /* # of reserved IDs for class */ + (H5I_free_t)H5D_close /* Callback routine for closing objects of this class */ +}}; + /*------------------------------------------------------------------------- @@ -127,7 +136,7 @@ static H5D_shared_t H5D_def_dset; herr_t H5D_init(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ @@ -139,9 +148,9 @@ done: /*-------------------------------------------------------------------------- NAME - H5D_init_interface -- Initialize interface-specific information + H5D__init_interface -- Initialize interface-specific information USAGE - herr_t H5D_init_interface() + herr_t H5D__init_interface() RETURNS Non-negative on success/Negative on failure @@ -153,15 +162,15 @@ NOTES --------------------------------------------------------------------------*/ static herr_t -H5D_init_interface(void) +H5D__init_interface(void) { H5P_genplist_t *def_dcpl; /* Default Dataset Creation Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Initialize the atom group for the dataset IDs */ - if(H5I_register_type(H5I_DATASET, (size_t)H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<H5I_FILE) + if(H5I_register_type(H5I_DATASET_CLS) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface") /* Reset the "default dataset" information */ @@ -189,12 +198,12 @@ H5D_init_interface(void) HDmemset(&H5D_def_dxpl_cache, 0, sizeof(H5D_dxpl_cache_t)); /* Get the default DXPL cache information */ - if(H5D_get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0) + if(H5D__get_dxpl_cache_real(H5P_DATASET_XFER_DEFAULT, &H5D_def_dxpl_cache) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve default DXPL info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_init_interface() */ +} /* end H5D__init_interface() */ /*------------------------------------------------------------------------- @@ -256,11 +265,11 @@ H5D_term_interface(void) /*-------------------------------------------------------------------------- NAME - H5D_get_dxpl_cache_real + H5D__get_dxpl_cache_real PURPOSE Get all the values for the DXPL cache. USAGE - herr_t H5D_get_dxpl_cache_real(dxpl_id, cache) + herr_t H5D__get_dxpl_cache_real(dxpl_id, cache) hid_t dxpl_id; IN: DXPL to query H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values RETURNS @@ -274,12 +283,12 @@ H5D_term_interface(void) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) +H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) { H5P_genplist_t *dx_plist; /* Data transfer property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(cache); @@ -334,16 +343,16 @@ H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_get_dxpl_cache_real() */ +} /* end H5D__get_dxpl_cache_real() */ /*-------------------------------------------------------------------------- NAME - H5D_get_dxpl_cache + H5D__get_dxpl_cache PURPOSE Get all the values for the DXPL cache. USAGE - herr_t H5D_get_dxpl_cache(dxpl_id, cache) + herr_t H5D__get_dxpl_cache(dxpl_id, cache) hid_t dxpl_id; IN: DXPL to query H5D_dxpl_cache_t *cache;IN/OUT: DXPL cache to fill with values RETURNS @@ -360,11 +369,11 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) +H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ assert(cache); @@ -373,12 +382,12 @@ H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache) if(dxpl_id==H5P_DATASET_XFER_DEFAULT) *cache=&H5D_def_dxpl_cache; else - if(H5D_get_dxpl_cache_real(dxpl_id,*cache) < 0) + if(H5D__get_dxpl_cache_real(dxpl_id,*cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "Can't retrieve DXPL values") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_get_dxpl_cache() */ +} /* H5D__get_dxpl_cache() */ /*------------------------------------------------------------------------- @@ -441,7 +450,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_get_space_status + * Function: H5D__get_space_status * * Purpose: Returns the status of data space allocation. * @@ -455,7 +464,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) +H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) { H5S_t *space; /* Dataset's dataspace */ hsize_t space_allocated; /* The number of bytes allocated for chunks */ @@ -465,7 +474,7 @@ H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) hsize_t full_size; /* The number of bytes in the dataset when fully populated */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(dset); @@ -490,7 +499,8 @@ H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) HGOTO_ERROR(H5E_DATASET, H5E_OVERFLOW, FAIL, "size of dataset's storage overflowed") /* Difficult to error check, since the error value is 0 and 0 is a valid value... :-/ */ - space_allocated = H5D_get_storage_size(dset, dxpl_id); + if(H5D__get_storage_size(dset, dxpl_id, &space_allocated) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of dataset's storage") /* Decide on how much of the space is allocated */ if(space_allocated == 0) @@ -506,11 +516,11 @@ H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_space_status() */ +} /* end H5D__get_space_status() */ /*------------------------------------------------------------------------- - * Function: H5D_new + * Function: H5D__new * * Purpose: Creates a new, empty dataset structure * @@ -524,13 +534,13 @@ done: *------------------------------------------------------------------------- */ static H5D_shared_t * -H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) +H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) { H5D_shared_t *new_dset = NULL; /* New dataset object */ H5P_genplist_t *plist; /* Property list created */ H5D_shared_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate new shared dataset structure */ if(NULL == (new_dset = H5FL_MALLOC(H5D_shared_t))) @@ -567,11 +577,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_new() */ +} /* end H5D__new() */ /*------------------------------------------------------------------------- - * Function: H5D_init_type + * Function: H5D__init_type * * Purpose: Copy a datatype for a dataset's use, performing all the * necessary adjustments, etc. @@ -585,14 +595,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) +H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) { htri_t relocatable; /* Flag whether the type is relocatable */ htri_t immutable; /* Flag whether the type is immutable */ hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(file); @@ -641,11 +651,11 @@ H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_init_type() */ +} /* end H5D__init_type() */ /*------------------------------------------------------------------------- - * Function: H5D_init_space + * Function: H5D__init_space * * Purpose: Copy a dataspace for a dataset's use, performing all the * necessary adjustments, etc. @@ -659,12 +669,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) +H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) { hbool_t use_latest_format; /* Flag indicating the newest file format should be used */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(file); @@ -689,11 +699,11 @@ H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_init_space() */ +} /* end H5D__init_space() */ /*------------------------------------------------------------------------- - * Function: H5D_swmr_setup + * Function: H5D__swmr_setup * * Purpose: Set up SWMR access for a chunked dataset, if possible * @@ -706,11 +716,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_swmr_setup(const H5D_t *dataset, hid_t dxpl_id) +H5D__swmr_setup(const H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(dataset); @@ -747,11 +757,11 @@ H5D_swmr_setup(const H5D_t *dataset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_swmr_setup() */ +} /* end H5D__swmr_setup() */ /*------------------------------------------------------------------------- - * Function: H5D_swmr_teardown + * Function: H5D__swmr_teardown * * Purpose: Tear down SWMR access for a chunked dataset. * @@ -764,11 +774,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_swmr_teardown(const H5D_t *dataset, hid_t dxpl_id) +H5D__swmr_teardown(const H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(dataset); @@ -788,11 +798,11 @@ H5D_swmr_teardown(const H5D_t *dataset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_swmr_teardown() */ +} /* end H5D__swmr_teardown() */ /*------------------------------------------------------------------------- - * Function: H5D_update_oh_info + * Function: H5D__update_oh_info * * Purpose: Create and fill object header for dataset * @@ -805,7 +815,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) +H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */ @@ -819,7 +829,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checking */ HDassert(file); @@ -927,7 +937,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) } /* end if */ /* Update/create the layout (and I/O pipeline & EFL) messages */ - if(H5D_layout_oh_create(file, dxpl_id, oh, dset, dapl_id) < 0) + if(H5D__layout_oh_create(file, dxpl_id, oh, dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout/pline/efl header message") /* Indicate that the layout information was initialized */ @@ -965,7 +975,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") /* Set up SWMR writes to the dataset, if possible */ - if(H5D_swmr_setup(dset, dxpl_id) < 0) + if(H5D__swmr_setup(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up SWMR access for dataset") done: @@ -977,17 +987,17 @@ done: /* Error cleanup */ if(ret_value < 0) { if(dset->shared->layout.type == H5D_CHUNKED && layout_init) { - if(H5D_chunk_dest(file, dxpl_id, dset) < 0) + if(H5D__chunk_dest(file, dxpl_id, dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_update_oh_info() */ +} /* end H5D__update_oh_info() */ /*------------------------------------------------------------------------- - * Function: H5D_create + * Function: H5D__create * * Purpose: Creates a new dataset with name NAME in file F and associates * with it a datatype TYPE for each element as stored in the @@ -1007,7 +1017,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, +H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id) { const H5T_t *type; /* Datatype for dataset */ @@ -1018,7 +1028,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, H5G_loc_t dset_loc; /* Dataset location */ H5D_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(file); @@ -1053,15 +1063,15 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, H5G_loc_reset(&dset_loc); /* Initialize the shared dataset space */ - if(NULL == (new_dset->shared = H5D_new(dcpl_id, TRUE, has_vl_type))) + if(NULL == (new_dset->shared = H5D__new(dcpl_id, TRUE, has_vl_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy & initialize datatype for dataset */ - if(H5D_init_type(file, new_dset, type_id, type) < 0) + if(H5D__init_type(file, new_dset, type_id, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy datatype") /* Copy & initialize dataspace for dataset */ - if(H5D_init_space(file, new_dset, space) < 0) + if(H5D__init_space(file, new_dset, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy dataspace") /* Set the dataset's checked_filters flag to enable writing */ @@ -1126,12 +1136,12 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value") /* Set the latest version for the layout message */ - if(H5D_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) + if(H5D__layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout") } /* end if */ else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) { /* Use latest indexing type for layout message version >= 4 */ - if(H5D_layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) + if(H5D__layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing") } /* end if */ @@ -1140,7 +1150,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, new_dset->shared->dcpl_cache.fill.alloc_time = H5D_ALLOC_TIME_EARLY; /* Set the dataset's I/O operations */ - if(H5D_layout_set_io_ops(new_dset) < 0) + if(H5D__layout_set_io_ops(new_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize I/O operations") /* Create the layout information for the new dataset */ @@ -1148,7 +1158,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information") /* Update the dataset's object header info. */ - if(H5D_update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) + if(H5D__update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache") /* Indicate that the layout information was initialized */ @@ -1168,7 +1178,7 @@ done: if(!ret_value && new_dset && new_dset->shared) { if(new_dset->shared) { if(new_dset->shared->layout.type == H5D_CHUNKED && layout_init) { - if(H5D_chunk_dest(file, dxpl_id, new_dset) < 0) + if(H5D__chunk_dest(file, dxpl_id, new_dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "unable to destroy chunk cache") } /* end if */ if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0) @@ -1194,7 +1204,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create() */ +} /* end H5D__create() */ /* @@ -1242,7 +1252,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the dataset object */ - if(H5D_open_oid(dataset, dapl_id, dxpl_id) < 0) + if(H5D__open_oid(dataset, dapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") /* Add the dataset to the list of opened objects in the file */ @@ -1298,7 +1308,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_open_oid + * Function: H5D__open_oid * * Purpose: Opens a dataset for access. * @@ -1310,7 +1320,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) +H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) { H5P_genplist_t *plist; /* Property list */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ @@ -1318,13 +1328,13 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset); /* (Set the 'vl_type' parameter to FALSE since it doesn't matter from here) */ - if(NULL == (dataset->shared = H5D_new(H5P_DATASET_CREATE_DEFAULT, FALSE, FALSE))) + if(NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, FALSE, FALSE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Open the dataset object */ @@ -1350,7 +1360,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the layout/pline/efl message information */ - if(H5D_layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) + if(H5D__layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info") /* Point at dataset's copy, to cache it for later */ @@ -1419,12 +1429,12 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) if((H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR) && !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) && H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_ALLOCATE_EARLY)) { - if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0) + if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") } /* end if */ /* Set up SWMR writes to the dataset, if possible */ - if(H5D_swmr_setup(dataset, dxpl_id) < 0) + if(H5D__swmr_setup(dataset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up SWMR access for dataset") done: @@ -1448,7 +1458,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_open_oid() */ +} /* end H5D__open_oid() */ /*------------------------------------------------------------------------- @@ -1479,13 +1489,13 @@ H5D_close(H5D_t *dataset) /* Dump debugging info */ #ifdef H5D_CHUNK_DEBUG - H5D_chunk_stats(dataset, FALSE); + H5D__chunk_stats(dataset, FALSE); #endif /* H5D_CHUNK_DEBUG */ dataset->shared->fo_count--; if(dataset->shared->fo_count == 0) { /* Flush the dataset's information. Continue to close even if it fails. */ - if(H5D_flush_real(dataset, H5AC_dxpl_id) < 0) + if(H5D__flush_real(dataset, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") /* Free the data sieve buffer, if it's been allocated */ @@ -1522,7 +1532,7 @@ H5D_close(H5D_t *dataset) /* Flush and destroy chunks in the cache. Continue to close even if * it fails. */ - if(H5D_chunk_dest(dataset->oloc.file, H5AC_dxpl_id, dataset) < 0) + if(H5D__chunk_dest(dataset->oloc.file, H5AC_dxpl_id, dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") break; @@ -1542,7 +1552,7 @@ H5D_close(H5D_t *dataset) /* If the dataset is opened for SWMR access, shut that down */ if(dataset->shared->is_swimming) - if(H5D_swmr_teardown(dataset, H5AC_dxpl_id) < 0) + if(H5D__swmr_teardown(dataset, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to shut down SWMR access") /* @@ -1680,7 +1690,7 @@ H5D_typeof(const H5D_t *dset) /*------------------------------------------------------------------------- - * Function: H5D_alloc_storage + * Function: H5D__alloc_storage * * Purpose: Allocate storage for the raw data of a dataset. * @@ -1692,7 +1702,7 @@ H5D_typeof(const H5D_t *dset) *------------------------------------------------------------------------- */ herr_t -H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5D__alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ @@ -1701,7 +1711,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(dset); @@ -1721,7 +1731,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al /* Check if we have a zero-sized dataset */ if(layout->storage.u.contig.size > 0) { /* Reserve space in the file for the entire array */ - if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) + if(H5D__contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") /* Indicate that we should initialize storage space */ @@ -1738,7 +1748,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al case H5D_CHUNKED: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Create the root of the B-tree that describes chunked storage */ - if(H5D_chunk_create(dset /*in,out*/, dxpl_id) < 0) + if(H5D__chunk_create(dset /*in,out*/, dxpl_id) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Indicate that we set the storage addr */ @@ -1802,7 +1812,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al * this is icky. -QAK */ if(!(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_INCR && time_alloc == H5D_ALLOC_WRITE)) - if(H5D_init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) + if(H5D__init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") } /* end if */ else { @@ -1816,7 +1826,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al * the fill value _is_ set, do that now */ if(dset->shared->dcpl_cache.fill.fill_time == H5D_FILL_TIME_ALLOC || (dset->shared->dcpl_cache.fill.fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) { - if(H5D_init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) + if(H5D__init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") } /* end if */ } /* end else */ @@ -1831,17 +1841,17 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al */ if(time_alloc != H5D_ALLOC_CREATE && addr_set) /* Mark the layout as dirty, for later writing to the file */ - if(H5D_mark(dset, dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, dxpl_id, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_alloc_storage() */ +} /* end H5D__alloc_storage() */ /*------------------------------------------------------------------------- - * Function: H5D_init_storage + * Function: H5D__init_storage * * Purpose: Initialize the data for a new dataset. If a selection is * defined for SPACE then initialize only that part of the @@ -1855,12 +1865,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], +H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(dset); @@ -1869,7 +1879,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], /* If we will be immediately overwriting the values, don't bother to clear them */ if(!full_overwrite) { /* Fill the compact dataset storage */ - if(H5D_compact_fill(dset, dxpl_id) < 0) + if(H5D__compact_fill(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize compact dataset storage") } /* end if */ break; @@ -1878,7 +1888,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], /* Don't write default fill values to external files */ /* If we will be immediately overwriting the values, don't bother to clear them */ if((dset->shared->dcpl_cache.efl.nused == 0 || dset->shared->dcpl_cache.fill.buf) && !full_overwrite) - if(H5D_contig_fill(dset, dxpl_id) < 0) + if(H5D__contig_fill(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") break; @@ -1894,7 +1904,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], if(old_dim == NULL) old_dim = zero_dim; - if(H5D_chunk_allocate(dset, dxpl_id, full_overwrite, old_dim) < 0) + if(H5D__chunk_allocate(dset, dxpl_id, full_overwrite, old_dim) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") break; } /* end block */ @@ -1910,68 +1920,66 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_init_storage() */ +} /* end H5D__init_storage() */ /*------------------------------------------------------------------------- - * Function: H5D_get_storage_size + * Function: H5D__get_storage_size * * Purpose: Determines how much space has been reserved to store the raw * data of a dataset. * - * Return: Success: Number of bytes reserved to hold raw data. - * - * Failure: 0 + * Return: Non-negative on success, negative on failure * * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- */ -hsize_t -H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) +herr_t +H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) { - hsize_t ret_value; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, 0) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) switch(dset->shared->layout.type) { case H5D_CHUNKED: if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - if(H5D_chunk_allocated(dset, dxpl_id, &ret_value) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve chunked dataset allocated size") + if(H5D__chunk_allocated(dset, dxpl_id, storage_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve chunked dataset allocated size") } /* end if */ else - ret_value = 0; + *storage_size = 0; break; case H5D_CONTIGUOUS: /* Datasets which are not allocated yet are using no space on disk */ if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) - ret_value = dset->shared->layout.storage.u.contig.size; + *storage_size = dset->shared->layout.storage.u.contig.size; else - ret_value = 0; + *storage_size = 0; break; case H5D_COMPACT: - ret_value = dset->shared->layout.storage.u.compact.size; + *storage_size = dset->shared->layout.storage.u.compact.size; break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, 0) -} /* end H5D_get_storage_size() */ +} /* end H5D__get_storage_size() */ /*------------------------------------------------------------------------- - * Function: H5D_get_offset + * Function: H5D__get_offset * - * Purpose: Private function for H5D_get_offset. Returns the address + * Purpose: Private function for H5D__get_offset. Returns the address * of dataset in file. * * Return: Success: the address of dataset @@ -1984,11 +1992,11 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5D_get_offset(const H5D_t *dset) +H5D__get_offset(const H5D_t *dset) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(dset); @@ -2013,11 +2021,11 @@ H5D_get_offset(const H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_offset() */ +} /* end H5D__get_offset() */ /*------------------------------------------------------------------------- - * Function: H5D_iterate + * Function: H5D__iterate * * Purpose: Internal version of H5Diterate() * @@ -2031,12 +2039,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, +H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, void *operator_data) { herr_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(buf); @@ -2048,7 +2056,7 @@ H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, ret_value = H5S_select_iterate(buf, type_id, space, op, operator_data); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_iterate() */ +} /* end H5D__iterate() */ /*------------------------------------------------------------------------- @@ -2085,8 +2093,8 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") - /* Call H5D_iterate with args, etc. */ - ret_value = H5D_iterate(buf, type_id, space ,H5T_vlen_reclaim, vl_alloc_info); + /* Call H5D__iterate with args, etc. */ + ret_value = H5D__iterate(buf, type_id, space ,H5T_vlen_reclaim, vl_alloc_info); done: FUNC_LEAVE_NOAPI(ret_value) @@ -2094,7 +2102,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_vlen_get_buf_size_alloc + * Function: H5D__vlen_get_buf_size_alloc * * Purpose: This routine makes certain there is enough space in the temporary * buffer for the new data to read in. All the VL data read in is actually @@ -2109,12 +2117,12 @@ done: *------------------------------------------------------------------------- */ void * -H5D_vlen_get_buf_size_alloc(size_t size, void *info) +H5D__vlen_get_buf_size_alloc(size_t size, void *info) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)info; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Get a temporary pointer to space for the VL data */ if((vlen_bufsize->vl_tbuf = H5FL_BLK_REALLOC(vlen_vl_buf, vlen_bufsize->vl_tbuf, size)) != NULL) @@ -2124,11 +2132,11 @@ H5D_vlen_get_buf_size_alloc(size_t size, void *info) ret_value = vlen_bufsize->vl_tbuf; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_vlen_get_buf_size_alloc() */ +} /* end H5D__vlen_get_buf_size_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_vlen_get_buf_size + * Function: H5D__vlen_get_buf_size * * Purpose: This routine checks the number of bytes required to store a single * element from a dataset in memory, creating a selection with just the @@ -2154,13 +2162,13 @@ H5D_vlen_get_buf_size_alloc(size_t size, void *info) */ /* ARGSUSED */ herr_t -H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) +H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(op_data); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -2183,11 +2191,11 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, co done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_vlen_get_buf_size() */ +} /* end H5D__vlen_get_buf_size() */ /*------------------------------------------------------------------------- - * Function: H5D_check_filters + * Function: H5D__check_filters * * Purpose: Check if the filters have be initialized for the dataset * @@ -2199,12 +2207,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_check_filters(H5D_t *dataset) +H5D__check_filters(H5D_t *dataset) { H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dataset); @@ -2237,14 +2245,14 @@ H5D_check_filters(H5D_t *dataset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_check_filters() */ +} /* end H5D__check_filters() */ /*------------------------------------------------------------------------- - * Function: H5D_set_extent + * Function: H5D__set_extent * * Purpose: Based on H5D_extend, allows change to a lower dimension, - * calls H5S_set_extent and H5D_chunk_prune_by_extent instead + * calls H5S_set_extent and H5D__chunk_prune_by_extent instead * * Return: Non-negative on success, negative on failure * @@ -2254,7 +2262,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) +H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) { H5S_t *space; /* Dataset's dataspace */ int rank; /* Dataspace # of dimensions */ @@ -2262,7 +2270,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) htri_t changed; /* Whether the dataspace changed size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Check args */ HDassert(dset); @@ -2279,7 +2287,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "dataset has contiguous storage") /* Check if the filters in the DCPL will need to encode, and if so, can they? */ - if(H5D_check_filters(dset) < 0) + if(H5D__check_filters(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") /* Get the data space */ @@ -2313,15 +2321,15 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) */ /* Update the index values for the cached chunks for this dataset */ if(H5D_CHUNKED == dset->shared->layout.type) { - if(H5D_chunk_set_info(dset) < 0) + if(H5D__chunk_set_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - if(H5D_chunk_update_cache(dset, dxpl_id) < 0) + if(H5D__chunk_update_cache(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ if(expand && dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY) - if(H5D_alloc_storage(dset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) + if(H5D__alloc_storage(dset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset storage") /*------------------------------------------------------------------------- @@ -2331,34 +2339,31 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) *------------------------------------------------------------------------- */ if(H5D_CHUNKED == dset->shared->layout.type) { - if(shrink && (*dset->shared->layout.ops->is_space_alloc)( - &dset->shared->layout.storage)) + if(shrink && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) /* Remove excess chunks */ - if(H5D_chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks") /* Update chunks that are no longer edge chunks as a result of * expansion */ - if(expand && (dset->shared->layout.u.chunk.flags - & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) + if(expand && (dset->shared->layout.u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) && (dset->shared->dcpl_cache.pline.nused > 0)) - if(H5D_chunk_update_old_edge_chunks(dset, dxpl_id, curr_dims) - < 0) + if(H5D__chunk_update_old_edge_chunks(dset, dxpl_id, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to do update old edge chunks") } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D_mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_set_extent() */ +} /* end H5D__set_extent() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_sieve_buf + * Function: H5D__flush_sieve_buf * * Purpose: Flush any dataset sieve buffer info cached in memory * @@ -2371,11 +2376,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dataset); @@ -2395,11 +2400,11 @@ H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush_sieve_buf() */ +} /* end H5D__flush_sieve_buf() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_real + * Function: H5D__flush_real * * Purpose: Flush any dataset information cached in memory * @@ -2412,12 +2417,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* Check args */ HDassert(dataset); @@ -2432,7 +2437,7 @@ H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) /* Update the layout on disk, if it's been changed */ if(dataset->shared->layout_dirty) { - if(H5D_layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) + if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info") dataset->shared->layout_dirty = FALSE; @@ -2466,11 +2471,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_flush_real() */ +} /* end H5D__flush_real() */ /*------------------------------------------------------------------------- - * Function: H5D_mark + * Function: H5D__mark * * Purpose: Mark some aspect of a dataset as dirty * @@ -2483,11 +2488,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) +H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(dataset); @@ -2500,11 +2505,11 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) dataset->shared->layout_dirty = TRUE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mark() */ +} /* end H5D__mark() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_cb + * Function: H5D__flush_cb * * Purpose: Flush any dataset information cached in memory * @@ -2517,13 +2522,13 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) *------------------------------------------------------------------------- */ static int -H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) +H5D__flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) { H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); @@ -2531,13 +2536,13 @@ H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) /* Check for dataset in same file */ if(udata->f == dataset->oloc.file) { /* Flush the dataset's information */ - if(H5D_flush_real(dataset, udata->dxpl_id) < 0) + if(H5D__flush_real(dataset, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to flush cached dataset info") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush_cb() */ +} /* end H5D__flush_cb() */ /*------------------------------------------------------------------------- @@ -2569,7 +2574,7 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) udata.dxpl_id = dxpl_id; /* Iterate over all the open datasets */ - if(H5I_iterate(H5I_DATASET, H5D_flush_cb, &udata, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5D__flush_cb, &udata, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info") done: |