mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-09 07:32:32 +08:00
[svn-r2493] Added a set/get pair of property modifiers to allows users to set/query the
metadata allocation size for file access property lists. These are new API functions and should be documented for the next release.
This commit is contained in:
parent
d2b293884e
commit
7e7b6854e6
82
src/H5P.c
82
src/H5P.c
@ -2906,6 +2906,88 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/,
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pset_meta_block_size
|
||||
*
|
||||
* Purpose: Sets the minimum size of metadata block allocations when
|
||||
* the H5FD_FEAT_AGGREGATE_METADATA is set by a VFL driver.
|
||||
* Each "raw" metadata block is allocated to be this size and then
|
||||
* specific pieces of metadata (object headers, local heaps, B-trees, etc)
|
||||
* are sub-allocated from this block.
|
||||
*
|
||||
* The default value is set to 2048 (bytes), indicating that metadata
|
||||
* will be attempted to be bunched together in (at least) 2K blocks in
|
||||
* the file. Setting the value to 0 with this API function will
|
||||
* turn off the metadata aggregation, even if the VFL driver attempts to
|
||||
* use that strategy.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, August 25, 2000
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Pset_meta_block_size(hid_t fapl_id, hsize_t size)
|
||||
{
|
||||
H5F_access_t *fapl = NULL;
|
||||
|
||||
FUNC_ENTER (H5Pset_meta_block_size, FAIL);
|
||||
|
||||
/* Check args */
|
||||
if (H5P_FILE_ACCESS != H5P_get_class (fapl_id) ||
|
||||
NULL == (fapl = H5I_object (fapl_id))) {
|
||||
HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL,
|
||||
"not a file access property list");
|
||||
}
|
||||
|
||||
/* Set values */
|
||||
fapl->meta_block_size = size;
|
||||
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_meta_block_size
|
||||
*
|
||||
* Purpose: Returns the current settings for the metadata block allocation
|
||||
* property from a file access property list.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, August 29, 2000
|
||||
*
|
||||
* Modifications:
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/)
|
||||
{
|
||||
H5F_access_t *fapl = NULL;
|
||||
|
||||
FUNC_ENTER (H5Pget_meta_block_size, FAIL);
|
||||
|
||||
/* Check args */
|
||||
if (H5P_FILE_ACCESS != H5P_get_class (fapl_id) ||
|
||||
NULL == (fapl = H5I_object (fapl_id))) {
|
||||
HRETURN_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL,
|
||||
"not a file access property list");
|
||||
}
|
||||
|
||||
/* Get values */
|
||||
if (size)
|
||||
*size = fapl->meta_block_size;
|
||||
|
||||
FUNC_LEAVE (SUCCEED);
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
NAME
|
||||
|
@ -179,6 +179,8 @@ __DLL__ herr_t H5Pget_vlen_mem_manager(hid_t plist_id,
|
||||
void **alloc_info,
|
||||
H5MM_free_t *free_func,
|
||||
void **free_info);
|
||||
__DLL__ herr_t H5Pset_meta_block_size(hid_t fapl_id, hsize_t size);
|
||||
__DLL__ herr_t H5Pget_meta_block_size(hid_t fapl_id, hsize_t *size/*out*/);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user