diff options
-rw-r--r-- | src/H5P.c | 108 | ||||
-rw-r--r-- | src/H5Ppublic.h | 5 |
2 files changed, 113 insertions, 0 deletions
@@ -3501,6 +3501,113 @@ done: FUNC_LEAVE(ret_value); } +#ifdef H5_WANT_H5_V1_4_COMPAT + +/*------------------------------------------------------------------------- + * 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: + * + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_meta_block_size(hid_t plist_id, hsize_t _size) +{ + H5P_genplist_t *plist; /* Property list pointer */ + size_t size=(size_t)_size; /* Work around parameter size difference */ + herr_t ret_value=SUCCEED; /* return value */ + + FUNC_ENTER (H5Pset_meta_block_size, FAIL); + H5TRACE2("e","iz",plist_id,size); + + /* Check args */ + if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + + /* Get the plist structure */ + if(NULL == (plist = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Set values */ + if(H5P_set(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set meta data block size"); + +done: + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- + * 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: + * + * Raymond Lu + * Tuesday, Oct 23, 2001 + * Changed the file access list to the new generic property + * list. + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_meta_block_size(hid_t plist_id, hsize_t *_size/*out*/) +{ + H5P_genplist_t *plist; /* Property list pointer */ + size_t size; /* Work around parameter size difference */ + herr_t ret_value=SUCCEED; /* return value */ + + FUNC_ENTER (H5Pget_meta_block_size, FAIL); + H5TRACE2("e","ix",plist_id,size); + + /* Check args */ + if(TRUE != H5P_isa_class(plist_id, H5P_FILE_ACCESS)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); + + /* Get the plist structure */ + if(NULL == (plist = H5I_object(plist_id))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + /* Get values */ + if (_size) { + if(H5P_get(plist, H5F_ACS_META_BLOCK_SIZE_NAME, &size) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get meta data block size"); + *_size=size; + } /* end if */ + +done: + FUNC_LEAVE(ret_value); +} +#else /* H5_WANT_H5_V1_4_COMPAT */ /*------------------------------------------------------------------------- * Function: H5Pset_meta_block_size @@ -3602,6 +3709,7 @@ H5Pget_meta_block_size(hid_t plist_id, size_t *size/*out*/) done: FUNC_LEAVE(ret_value); } +#endif /* H5_WANT_H5_V1_4_COMPAT */ /*------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index bd908f4..bca20bf 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -232,8 +232,13 @@ __DLL__ herr_t H5Pget_vlen_mem_manager(hid_t plist_id, void **alloc_info, H5MM_free_t *free_func, void **free_info); +#ifdef H5_WANT_H5_V1_4_COMPAT +__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*/); +#else /* H5_WANT_H5_V1_4_COMPAT */ __DLL__ herr_t H5Pset_meta_block_size(hid_t fapl_id, size_t size); __DLL__ herr_t H5Pget_meta_block_size(hid_t fapl_id, size_t *size/*out*/); +#endif /* H5_WANT_H5_V1_4_COMPAT */ __DLL__ herr_t H5Pset_sieve_buf_size(hid_t fapl_id, size_t size); __DLL__ herr_t H5Pget_sieve_buf_size(hid_t fapl_id, size_t *size/*out*/); __DLL__ herr_t H5Pset_hyper_vector_size(hid_t fapl_id, size_t size); |