summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2000-08-31 19:24:36 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2000-08-31 19:24:36 (GMT)
commit7e7b6854e63f185fcddd9158a2c67450c4d94e0c (patch)
treebdcedead9912e4b8168ab5a2c0680f054856e946
parentd2b293884ee923b1116c51e4c10667aff379b4ed (diff)
downloadhdf5-7e7b6854e63f185fcddd9158a2c67450c4d94e0c.zip
hdf5-7e7b6854e63f185fcddd9158a2c67450c4d94e0c.tar.gz
hdf5-7e7b6854e63f185fcddd9158a2c67450c4d94e0c.tar.bz2
[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.
-rw-r--r--src/H5P.c82
-rw-r--r--src/H5Ppublic.h2
2 files changed, 84 insertions, 0 deletions
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
}