summaryrefslogtreecommitdiffstats
path: root/src/H5Distore.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>1998-07-09 21:21:50 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>1998-07-09 21:21:50 (GMT)
commit26d0f66a4530fdfc6c2bafe465a6ce1a9b67604b (patch)
tree62e721ee40ba1678d46634268070e98e443185d9 /src/H5Distore.c
parent6ac0688ab4cf54e545703453dc6f1437d9e8d282 (diff)
downloadhdf5-26d0f66a4530fdfc6c2bafe465a6ce1a9b67604b.zip
hdf5-26d0f66a4530fdfc6c2bafe465a6ce1a9b67604b.tar.gz
hdf5-26d0f66a4530fdfc6c2bafe465a6ce1a9b67604b.tar.bz2
[svn-r477] Changed the way file-space allocation for the data part of a dataset.
H5D.c: Created a new function H5D_allocation to do allocation of all datasets. According to the storage layout, it calls the appropriate function. H5Fprivate.h: H5Fistore.c: H5F_istore_allocation now takes a dimension array, (old version used a space pointer) to determine how many chunks to allocate. Changed H5F_istore_get_addr to a private (static) function. No one outside of H5Fistore.c is calling it. Removed three forward declarations now that they are not needed. Tested platform: O2K
Diffstat (limited to 'src/H5Distore.c')
-rw-r--r--src/H5Distore.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/H5Distore.c b/src/H5Distore.c
index c78e44e..8c9d22e 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -63,6 +63,10 @@ static herr_t H5F_istore_encode_key(H5F_t *f, H5B_t *bt, uint8 *raw,
void *_key);
static herr_t H5F_istore_debug_key (FILE *stream, intn indent, intn fwidth,
const void *key, const void *udata);
+#ifdef HAVE_PARALLEL
+static herr_t H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
+ const hssize_t offset[], void *_udata/*out*/);
+#endif
/*
* B-tree key. A key contains the minimum logical N-dimensional address and
@@ -1753,10 +1757,11 @@ H5F_istore_debug(H5F_t *f, const haddr_t *addr, FILE * stream, intn indent,
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
- const hssize_t offset[], H5F_istore_ud1_t *udata/*out*/)
+ const hssize_t offset[], void *_udata/*out*/)
{
+ H5F_istore_ud1_t *udata = _udata;
intn i;
herr_t status; /*func return status */
@@ -1807,11 +1812,9 @@ H5F_istore_get_addr (H5F_t *f, const H5O_layout_t *layout,
*-------------------------------------------------------------------------
*/
herr_t
-H5F_istore_allocate (H5D_t *dataset, H5F_t *f, const H5O_layout_t *layout,
- const H5S_t *space, const H5O_compress_t *comp)
+H5F_istore_allocate (H5F_t *f, const H5O_layout_t *layout,
+ const hsize_t *space_dim, const H5O_compress_t *comp)
{
- hsize_t space_dim[H5O_LAYOUT_NDIMS];
- intn space_ndims;
intn i, carry;
hssize_t chunk_offset[H5O_LAYOUT_NDIMS];
@@ -1826,26 +1829,13 @@ H5F_istore_allocate (H5D_t *dataset, H5F_t *f, const H5O_layout_t *layout,
#endif
/* Check args */
- assert(dataset);
- assert(layout);
assert(f);
- assert(space);
-
- if (layout->type != H5D_CHUNKED)
- HRETURN(SUCCEED); /*nothing to do or should we FAIL? */
-
+ assert(space_dim);
+ assert(comp);
+ assert(layout && H5D_CHUNKED==layout->type);
assert(layout->ndims>0 && layout->ndims<=H5O_LAYOUT_NDIMS);
assert(H5F_addr_defined(&(layout->addr)));
- /* get current dims of dataset */
- if ((space_ndims=H5S_get_dims(space, space_dim, NULL)) <= 0 ||
- space_ndims+1 != layout->ndims){
- HRETURN_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL,
- "unable to allocate chunk storage");
- }
- /* copy the element size over */
- space_dim[space_ndims] = layout->dim[space_ndims];
-
/*
* Setup indice to go through all chunks. (Future improvement
* should allocate only chunks that have no file space assigned yet.