summaryrefslogtreecommitdiffstats
path: root/src/H5Fcontig.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-04-14 04:46:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-04-14 04:46:56 (GMT)
commitf37cc250264ad00bb69e454676f8bc81fd454d40 (patch)
tree6ca23fb166d4c1563aba380d4d6d525af7d2b4d4 /src/H5Fcontig.c
parent4a0a933366d33a330ad603701445aca727899de7 (diff)
downloadhdf5-f37cc250264ad00bb69e454676f8bc81fd454d40.zip
hdf5-f37cc250264ad00bb69e454676f8bc81fd454d40.tar.gz
hdf5-f37cc250264ad00bb69e454676f8bc81fd454d40.tar.bz2
[svn-r6653] Purpose:
New feature. Description: Added ability to free space used for storing raw data for both contiguous and chunked datasets. Platforms tested: FreeBSD 4.8 (sleipnir) w/C++ Linux 2.4 (burrwhite) w/FORTRAN Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/parallel & FORTRAN (h5committest not run due to my ongoing difficulties with C++ on burrwhite).
Diffstat (limited to 'src/H5Fcontig.c')
-rw-r--r--src/H5Fcontig.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/H5Fcontig.c b/src/H5Fcontig.c
index 82de6fb..a9fe574 100644
--- a/src/H5Fcontig.c
+++ b/src/H5Fcontig.c
@@ -31,6 +31,7 @@
#include "H5Fpkg.h"
#include "H5FDprivate.h" /*file driver */
#include "H5FLprivate.h" /*Free Lists */
+#include "H5MFprivate.h" /*file memory management */
#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Vprivate.h" /* Vector and array functions */
@@ -267,6 +268,51 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5F_contig_delete
+ *
+ * Purpose: Delete the file space for a contiguously stored dataset
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Quincey Koziol
+ * March 20, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_contig_delete(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout)
+{
+ hsize_t size; /* Size of contiguous block of data */
+ unsigned u; /* Local index variable */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5O_contig_delete, FAIL);
+
+ /* check args */
+ assert(f);
+ assert(layout);
+
+ /* Compute size */
+ size=layout->dim[0];
+ for (u = 1; u < layout->ndims; u++)
+ size *= layout->dim[u];
+
+ /* Check for overlap with the sieve buffer and reset it */
+ if (H5F_sieve_overlap_clear(f, layout->addr, size)<0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to clear sieve buffer");
+
+ /* Free the file space for the chunk */
+ if (H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, layout->addr, size)<0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header");
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5F_contig_delete */
+
+
+/*-------------------------------------------------------------------------
* Function: H5F_contig_read
*
* Purpose: Reads some data from a dataset into a buffer.