From 7e7b6854e63f185fcddd9158a2c67450c4d94e0c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 31 Aug 2000 14:24:36 -0500 Subject: [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. --- src/H5P.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/H5Ppublic.h | 2 ++ 2 files changed, 84 insertions(+) diff --git a/src/H5P.c b/src/H5P.c index f6bbe8f..c60ad6c 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -2907,6 +2907,88 @@ H5Pget_vlen_mem_manager(hid_t plist_id, H5MM_allocate_t *alloc_func/*out*/, } +/*------------------------------------------------------------------------- + * 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 H5P_copy_prop diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index b84ea14..0ae36aa 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -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 } -- cgit v0.12