summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-12-05 18:45:31 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-12-05 18:45:31 (GMT)
commitbfbac647b03b135de5eb683f012ef3453aeac1d3 (patch)
tree507764ae5158fcb43e6b973058979ab393542f33 /src
parentb46e9055944a06b642b1ff1a200aea84cdfb34a6 (diff)
downloadhdf5-bfbac647b03b135de5eb683f012ef3453aeac1d3.zip
hdf5-bfbac647b03b135de5eb683f012ef3453aeac1d3.tar.gz
hdf5-bfbac647b03b135de5eb683f012ef3453aeac1d3.tar.bz2
[svn-r4674] Purpose:
Backward Compatibility Fix Description: One of H5P[gs]et_meta_block_size's parameters changed between v1.4 and the development branch. Solution: Added v1.4 compat stuff around H5P[gs]et_meta_block_size implementation and testing to allow v1.4.x users to continue to use their source code without modification. There are no C++ or FORTRAN wrappers for these functions. There are also no tests for these API functions currently... :-( Platforms tested: FreeBSD 4.4 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5P.c108
-rw-r--r--src/H5Ppublic.h5
2 files changed, 113 insertions, 0 deletions
diff --git a/src/H5P.c b/src/H5P.c
index f26b0a2..723f09e 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -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);