summaryrefslogtreecommitdiffstats
path: root/src/H5Dchunk.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-10-01 16:12:02 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-10-01 16:12:02 (GMT)
commit8d131aca15bca2d042ef175af5cf5a642d4c1152 (patch)
tree50a5b1c6dbfd137a0795ca47dc7ee84a6e903101 /src/H5Dchunk.c
parenta31524e4aee50324ccbc6707584b1758279f984e (diff)
parent4dc2218ab5622f81c3dd9d68020ac7357f413c50 (diff)
downloadhdf5-8d131aca15bca2d042ef175af5cf5a642d4c1152.zip
hdf5-8d131aca15bca2d042ef175af5cf5a642d4c1152.tar.gz
hdf5-8d131aca15bca2d042ef175af5cf5a642d4c1152.tar.bz2
[svn-r27929] merge from trunk.
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r--src/H5Dchunk.c160
1 files changed, 80 insertions, 80 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index ca7bda5..a0cd399 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -44,9 +44,8 @@
/* Module Setup */
/****************/
-#define H5D_PACKAGE /*suppress error about including H5Dpkg */
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
-
+#include "H5Dmodule.h" /* This source code file is part of the H5D module */
+#define H5F_FRIEND /*suppress error about including H5Fpkg */
/***********/
/* Headers */
@@ -194,6 +193,8 @@ typedef struct H5D_chunk_coll_info_t {
/* Chunked layout operation callbacks */
static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset);
+static herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset,
+ hid_t dapl_id);
static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info,
const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space,
const H5S_t *mem_space, H5D_chunk_map_t *fm);
@@ -205,6 +206,7 @@ static herr_t H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *ty
H5D_chunk_map_t *fm);
static herr_t H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id);
static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm);
+static herr_t H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id);
/* "Nonexistent" layout operation callback */
static ssize_t
@@ -268,7 +270,8 @@ const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{
NULL,
NULL,
H5D__chunk_flush,
- H5D__chunk_io_term
+ H5D__chunk_io_term,
+ H5D__chunk_dest
}};
@@ -291,6 +294,7 @@ const H5D_layout_ops_t H5D_LOPS_NONEXISTENT[1] = {{
H5D__nonexistent_readvv,
NULL,
NULL,
+ NULL,
NULL
}};
@@ -587,7 +591,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id)
{
H5D_chk_idx_info_t idx_info; /* Chunked index info */
@@ -595,7 +599,7 @@ H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id)
H5P_genplist_t *dapl; /* Data access property list object pointer */
herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_PACKAGE
+ FUNC_ENTER_STATIC
/* Sanity check */
HDassert(f);
@@ -683,7 +687,7 @@ done:
hbool_t
H5D__chunk_is_space_alloc(const H5O_storage_t *storage)
{
- hbool_t ret_value; /* Return value */
+ hbool_t ret_value = FALSE; /* Return value */
FUNC_ENTER_PACKAGE_NOERR
@@ -2120,10 +2124,6 @@ H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id)
/* Sanity check */
HDassert(dset);
- /* Flush any data caught in sieve buffer */
- if(H5D__flush_sieve_buf(dset, dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer")
-
/* Fill the DXPL cache values for later use */
if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
@@ -2194,6 +2194,72 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5D__chunk_dest
+ *
+ * Purpose: Destroy the entire chunk cache by flushing dirty entries,
+ * preempting all entries, and freeing the cache itself.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Thursday, May 21, 1998
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D__chunk_dest(H5D_t *dset, hid_t dxpl_id)
+{
+ H5D_chk_idx_info_t idx_info; /* Chunked index info */
+ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
+ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
+ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */
+ H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */
+ int nerrors = 0; /* Accumulated count of errors */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL)
+
+ /* Sanity check */
+ HDassert(dset);
+
+ /* Fill the DXPL cache values for later use */
+ if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
+ nerrors++;
+
+ /* Flush all the cached chunks */
+ for(ent = rdcc->head; ent; ent = next) {
+ next = ent->next;
+ if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0)
+ nerrors++;
+ } /* end for */
+
+ /* Continue even if there are failures. */
+ if(nerrors)
+ HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
+
+ /* Release cache structures */
+ if(rdcc->slot)
+ rdcc->slot = H5FL_SEQ_FREE(H5D_rdcc_ent_ptr_t, rdcc->slot);
+ HDmemset(rdcc, 0, sizeof(H5D_rdcc_t));
+
+ /* Compose chunked index info struct */
+ idx_info.f = dset->oloc.file;
+ idx_info.dxpl_id = dxpl_id;
+ idx_info.pline = &dset->shared->dcpl_cache.pline;
+ idx_info.layout = &dset->shared->layout.u.chunk;
+ idx_info.storage = &dset->shared->layout.storage.u.chunk;
+
+ /* Free any index structures */
+ if(dset->shared->layout.storage.u.chunk.ops->dest &&
+ (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
+
+done:
+ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
+} /* end H5D__chunk_dest() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5D_chunk_idx_reset
*
* Purpose: Reset index information
@@ -2405,7 +2471,7 @@ H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled)
{
hsize_t val; /* Intermediate value */
unsigned ndims = shared->ndims; /* Rank of dataset */
- unsigned ret; /* Value to return */
+ unsigned ret = 0; /* Value to return */
FUNC_ENTER_STATIC_NOERR
@@ -2918,7 +2984,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata,
H5D_rdcc_ent_t *ent; /*cache entry */
size_t chunk_size; /*size of a chunk */
void *chunk = NULL; /*the file chunk */
- void *ret_value; /*return value */
+ void *ret_value = NULL; /* Return value */
FUNC_ENTER_PACKAGE
@@ -5182,72 +5248,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D__chunk_dump_index() */
-
-/*-------------------------------------------------------------------------
- * Function: H5D__chunk_dest
- *
- * Purpose: Destroy the entire chunk cache by flushing dirty entries,
- * preempting all entries, and freeing the cache itself.
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * Thursday, May 21, 1998
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset)
-{
- H5D_chk_idx_info_t idx_info; /* Chunked index info */
- H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
- H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */
- H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Dataset's chunk cache */
- H5D_rdcc_ent_t *ent = NULL, *next = NULL; /* Pointer to current & next cache entries */
- int nerrors = 0; /* Accumulated count of errors */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL)
-
- HDassert(f);
- HDassert(dset);
-
- /* Fill the DXPL cache values for later use */
- if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache")
-
- /* Flush all the cached chunks */
- for(ent = rdcc->head; ent; ent = next) {
- next = ent->next;
- if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0)
- nerrors++;
- } /* end for */
-
- /* Continue even if there are failures. */
- if(nerrors)
- HDONE_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
-
- /* Release cache structures */
- if(rdcc->slot)
- rdcc->slot = H5FL_SEQ_FREE(H5D_rdcc_ent_ptr_t, rdcc->slot);
- HDmemset(rdcc, 0, sizeof(H5D_rdcc_t));
-
- /* Compose chunked index info struct */
- idx_info.f = f;
- idx_info.dxpl_id = dxpl_id;
- idx_info.pline = &dset->shared->dcpl_cache.pline;
- idx_info.layout = &dset->shared->layout.u.chunk;
- idx_info.storage = &dset->shared->layout.storage.u.chunk;
-
- /* Free any index structures */
- if(dset->shared->layout.storage.u.chunk.ops->dest &&
- (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
-
-done:
- FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
-} /* end H5D__chunk_dest() */
-
#ifdef H5D_CHUNK_DEBUG
/*-------------------------------------------------------------------------
@@ -5388,7 +5388,7 @@ H5D__nonexistent_readvv(const H5D_io_info_t *io_info,
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[])
{
H5D_chunk_readvv_ud_t udata; /* User data for H5VM_opvv() operator */
- ssize_t ret_value; /* Return value */
+ ssize_t ret_value = -1; /* Return value */
FUNC_ENTER_STATIC