summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-11-21 22:48:03 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-11-21 22:48:03 (GMT)
commit72ecaf0940f8d6df7bedf14376ea3f2224efc0c6 (patch)
treec132b19e6aa22c42dd53bb532abf534e6ffa58bf
parent88b6f2e24cafcfaffe7d99ab6c5afc2290ce93b4 (diff)
parentf6ad126673553838df0dec514c5d2c1b4b70df1a (diff)
downloadhdf5-72ecaf0940f8d6df7bedf14376ea3f2224efc0c6.zip
hdf5-72ecaf0940f8d6df7bedf14376ea3f2224efc0c6.tar.gz
hdf5-72ecaf0940f8d6df7bedf14376ea3f2224efc0c6.tar.bz2
Merge branch 'develop' into eoc_valgrind_bugfix
-rw-r--r--src/H5AC.c8
-rw-r--r--src/H5ACprivate.h3
-rw-r--r--src/H5B2cache.c35
-rw-r--r--src/H5Bcache.c7
-rw-r--r--src/H5C.c258
-rw-r--r--src/H5Cepoch.c25
-rw-r--r--src/H5Cprivate.h416
-rw-r--r--src/H5EAcache.c40
-rw-r--r--src/H5FAcache.c23
-rw-r--r--src/H5FScache.c26
-rw-r--r--src/H5Fsuper_cache.c26
-rw-r--r--src/H5Gcache.c7
-rw-r--r--src/H5HFcache.c176
-rw-r--r--src/H5HGcache.c7
-rw-r--r--src/H5HLcache.c24
-rw-r--r--src/H5Ocache.c306
-rw-r--r--src/H5SMcache.c22
-rw-r--r--test/cache_common.c327
-rw-r--r--test/earray.c63
-rw-r--r--testpar/t_cache.c98
-rw-r--r--tools/test/h5dump/h5dumpgentest.c136
21 files changed, 592 insertions, 1441 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 3b19db4..764dfcd 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -567,7 +567,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
#ifdef H5_HAVE_PARALLEL
/* destroying the cache, so clear all collective entries */
- if(H5C_clear_coll_entries(f->shared->cache, 0) < 0)
+ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache);
@@ -726,7 +726,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
#ifdef H5_HAVE_PARALLEL
/* flushing the cache, so clear all collective entries */
- if(H5C_clear_coll_entries(f->shared->cache, 0) < 0)
+ if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
@@ -1639,11 +1639,9 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
* the entry.
*/
if(dirtied && !deleted) {
- hbool_t curr_compressed = FALSE; /* dummy for call */
size_t curr_size = 0;
- size_t curr_compressed_size = 0; /* dummy for call */
- if((type->image_len)(thing, &curr_size, &curr_compressed, &curr_compressed_size) < 0)
+ if((type->image_len)(thing, &curr_size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
if(((H5AC_info_t *)thing)->size != curr_size)
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 01b7125..3a260d0 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -142,7 +142,6 @@ typedef enum {
#define H5AC__SERIALIZE_RESIZED_FLAG H5C__SERIALIZE_RESIZED_FLAG
#define H5AC__SERIALIZE_MOVED_FLAG H5C__SERIALIZE_MOVED_FLAG
-#define H5AC__SERIALIZE_COMPRESSED_FLAG H5C__SERIALIZE_COMPRESSED_FLAG
/* Cork actions: cork/uncork/get cork status of an object */
#define H5AC__SET_CORK H5C__SET_CORK
@@ -171,7 +170,6 @@ typedef H5C_notify_action_t H5AC_notify_action_t;
#define H5AC__CLASS_NO_FLAGS_SET H5C__CLASS_NO_FLAGS_SET
#define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG
-#define H5AC__CLASS_COMPRESSED_FLAG H5C__CLASS_COMPRESSED_FLAG
/* The following flags should only appear in test code */
#define H5AC__CLASS_SKIP_READS H5C__CLASS_SKIP_READS
@@ -189,7 +187,6 @@ typedef H5C_pre_serialize_func_t H5AC_pre_serialize_func_t;
typedef H5C_serialize_func_t H5AC_serialize_func_t;
typedef H5C_notify_func_t H5AC_notify_func_t;
typedef H5C_free_icr_func_t H5AC_free_icr_func_t;
-typedef H5C_clear_func_t H5AC_clear_func_t;
typedef H5C_get_fsf_size_t H5AC_get_fsf_size_t;
typedef H5C_class_t H5AC_class_t;
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index b899f6a..32db4b0 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -68,8 +68,7 @@
static herr_t H5B2__cache_hdr_get_load_size(const void *udata, size_t *image_len);
static void *H5B2__cache_hdr_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5B2__cache_hdr_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5B2__cache_hdr_image_len(const void *thing, size_t *image_len);
static herr_t H5B2__cache_hdr_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5B2__cache_hdr_free_icr(void *thing);
@@ -77,8 +76,7 @@ static herr_t H5B2__cache_hdr_free_icr(void *thing);
static herr_t H5B2__cache_int_get_load_size(const void *udata, size_t *image_len);
static void *H5B2__cache_int_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5B2__cache_int_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5B2__cache_int_image_len(const void *thing, size_t *image_len);
static herr_t H5B2__cache_int_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5B2__cache_int_free_icr(void *thing);
@@ -86,8 +84,7 @@ static herr_t H5B2__cache_int_free_icr(void *thing);
static herr_t H5B2__cache_leaf_get_load_size(const void *udata, size_t *image_len);
static void *H5B2__cache_leaf_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5B2__cache_leaf_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5B2__cache_leaf_image_len(const void *thing, size_t *image_len);
static herr_t H5B2__cache_leaf_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5B2__cache_leaf_free_icr(void *thing);
@@ -109,7 +106,6 @@ const H5AC_class_t H5AC_BT2_HDR[1] = {{
H5B2__cache_hdr_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5B2__cache_hdr_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -126,7 +122,6 @@ const H5AC_class_t H5AC_BT2_INT[1] = {{
H5B2__cache_int_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5B2__cache_int_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -143,7 +138,6 @@ const H5AC_class_t H5AC_BT2_LEAF[1] = {{
H5B2__cache_leaf_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5B2__cache_leaf_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -310,8 +304,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5B2__cache_hdr_image_len(const void *_thing, size_t *image_len)
{
const H5B2_hdr_t *hdr = (const H5B2_hdr_t *)_thing; /* Pointer to the B-tree header */
@@ -601,8 +594,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__cache_int_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5B2__cache_int_image_len(const void *_thing, size_t *image_len)
{
const H5B2_internal_t *internal = (const H5B2_internal_t *)_thing; /* Pointer to the B-tree internal node */
@@ -721,17 +713,18 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__cache_int_free_icr(void *thing)
+H5B2__cache_int_free_icr(void *_thing)
{
+ H5B2_internal_t *internal = (H5B2_internal_t *)_thing;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Check arguments */
- HDassert(thing);
+ HDassert(internal);
/* Release v2 B-tree internal node */
- if(H5B2__internal_free((H5B2_internal_t *)thing) < 0)
+ if(H5B2__internal_free(internal) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to release v2 B-tree internal node")
done:
@@ -890,8 +883,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5B2__cache_leaf_image_len(const void *_thing, size_t *image_len)
{
const H5B2_leaf_t *leaf = (const H5B2_leaf_t *)_thing; /* Pointer to the B-tree leaf node */
@@ -996,17 +988,18 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B2__cache_leaf_free_icr(void *thing)
+H5B2__cache_leaf_free_icr(void *_thing)
{
+ H5B2_leaf_t *leaf = (H5B2_leaf_t *)_thing;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
/* Check arguments */
- HDassert(thing);
+ HDassert(leaf);
/* Destroy v2 B-tree leaf node */
- if(H5B2__leaf_free((H5B2_leaf_t *)thing) < 0)
+ if(H5B2__leaf_free(leaf) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node")
done:
diff --git a/src/H5Bcache.c b/src/H5Bcache.c
index 8354e8e..44c5e62 100644
--- a/src/H5Bcache.c
+++ b/src/H5Bcache.c
@@ -57,8 +57,7 @@
static herr_t H5B__get_load_size(const void *udata, size_t *image_len);
static void *H5B__deserialize(const void *image, size_t len, void *udata,
hbool_t *dirty);
-static herr_t H5B__image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5B__image_len(const void *thing, size_t *image_len);
static herr_t H5B__serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5B__free_icr(void *thing);
@@ -81,7 +80,6 @@ const H5AC_class_t H5AC_BT[1] = {{
H5B__serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5B__free_icr, /* 'free_icr' callback */
- NULL, /* 'clear" callback */
NULL, /* 'fsf_size' callback */
}};
@@ -248,8 +246,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B__image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5B__image_len(const void *_thing, size_t *image_len)
{
const H5B_t *bt = (const H5B_t *)_thing; /* Pointer to the B-tree node */
H5B_shared_t *shared; /* Pointer to shared B-tree info */
diff --git a/src/H5C.c b/src/H5C.c
index d2812b3..a1477d4 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -776,8 +776,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type,
#if H5C_DO_EXTREME_SANITY_CHECKS
if(H5C_validate_lru_list(cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
- "LRU extreme sanity check failed on entry.\n");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry.\n");
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
/* Look for entry in cache */
@@ -806,7 +805,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type,
* This will clear the entry, and then delete it from the cache.
*/
- /* Pass along 'free file space' flag to cache client. */
+ /* Pass along 'free file space' flag */
flush_flags |= (flags & H5C__FREE_FILE_SPACE_FLAG);
/* Delete the entry from the skip list on destroy */
@@ -1273,24 +1272,10 @@ H5C_insert_entry(H5F_t * f,
/* not protected, so can't be dirtied */
entry_ptr->dirtied = FALSE;
- /* Retrieve the size of the thing. Set the compressed field to FALSE
- * and the compressed_size field to zero first, as they may not be
- * initialized by the image_len call.
- */
- entry_ptr->compressed = FALSE;
- entry_ptr->compressed_size = 0;
- if((type->image_len)(thing, &(entry_ptr->size), &(entry_ptr->compressed), &(entry_ptr->compressed_size)) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "Can't get size of thing")
+ /* Retrieve the size of the thing */
+ if((type->image_len)(thing, &(entry_ptr->size)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTGETSIZE, FAIL, "can't get size of thing")
HDassert(entry_ptr->size > 0 && entry_ptr->size < H5C_MAX_ENTRY_SIZE);
- HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) ||
- (entry_ptr->compressed == FALSE));
-
- /* entry has just been inserted -- thus compressed size cannot have
- * been computed yet. Thus if entry_ptr->compressed is TRUE,
- * entry_ptr->size must equal entry_ptr->compressed_size.
- */
- HDassert(!entry_ptr->compressed || (entry_ptr->size == entry_ptr->compressed_size));
- HDassert(entry_ptr->compressed || (entry_ptr->compressed_size == 0));
entry_ptr->in_slist = FALSE;
@@ -2119,22 +2104,14 @@ H5C_protect(H5F_t * f,
if(entry_ptr->image_ptr == NULL) {
int mpi_rank;
- size_t image_size;
if((mpi_rank = H5F_mpi_get_rank(f)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "Can't get MPI rank")
- if(entry_ptr->compressed)
- image_size = entry_ptr->compressed_size;
- else
- image_size = entry_ptr->size;
- HDassert(image_size > 0);
-
- if(NULL == (entry_ptr->image_ptr = H5MM_malloc(image_size + H5C_IMAGE_EXTRA_SPACE)))
+ if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, NULL, "memory allocation failed for on disk image buffer")
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + image_size,
- H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
+ HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
if(0 == mpi_rank)
if(H5C__generate_image(f, cache_ptr, entry_ptr, dxpl_id) < 0)
@@ -5862,19 +5839,10 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
#endif /* H5C_DO_SANITY_CHECKS */
if(NULL == entry_ptr->image_ptr) {
- size_t image_size;
-
- if(entry_ptr->compressed)
- image_size = entry_ptr->compressed_size;
- else
- image_size = entry_ptr->size;
- HDassert(image_size > 0);
-
-
- if(NULL == (entry_ptr->image_ptr = H5MM_malloc(image_size + H5C_IMAGE_EXTRA_SPACE)))
+ if(NULL == (entry_ptr->image_ptr = H5MM_malloc(entry_ptr->size + H5C_IMAGE_EXTRA_SPACE)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer")
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + image_size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
+ HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
} /* end if */
@@ -5890,19 +5858,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* in the entry's type, we silently skip the write. This
* flag should only be used in test code.
*/
- if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0)
- {
- /* If compression is not enabled, the size of the entry on
- * disk is entry_prt->size. However if entry_ptr->compressed
- * is TRUE, the on disk size is entry_ptr->compressed_size.
- */
- size_t image_size;
-
- if(entry_ptr->compressed)
- image_size = entry_ptr->compressed_size;
- else
- image_size = entry_ptr->size;
-
+ if(((entry_ptr->type->flags) & H5C__CLASS_SKIP_WRITES) == 0) {
#ifdef H5_HAVE_PARALLEL
if(collective_write_list) {
H5C_collective_write_t *item;
@@ -5910,7 +5866,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
if(NULL == (item = (H5C_collective_write_t *)H5FL_MALLOC(H5C_collective_write_t)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "unable to allocate skip list item")
- item->length = image_size;
+ item->length = entry_ptr->size;
item->free_buf = FALSE;
item->buf = entry_ptr->image_ptr;
item->offset = entry_ptr->addr;
@@ -5922,10 +5878,9 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
} /* end if */
else
#endif /* H5_HAVE_PARALLEL */
- if(H5F_block_write(f, entry_ptr->type->mem_type, entry_ptr->addr,
- image_size, dxpl_id, entry_ptr->image_ptr) < 0)
+ if(H5F_block_write(f, entry_ptr->type->mem_type, entry_ptr->addr, entry_ptr->size, dxpl_id, entry_ptr->image_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't write image to file.")
- }
+ } /* end if */
/* if the entry has a notify callback, notify it that we have
* just flushed the entry.
@@ -6004,7 +5959,7 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
/* verify that the entry is no longer part of any flush dependencies */
HDassert(entry_ptr->flush_dep_nparents == 0);
HDassert(entry_ptr->flush_dep_nchildren == 0);
- }
+ } /* end if */
else {
HDassert(clear_only || write_entry);
HDassert(entry_ptr->is_dirty);
@@ -6031,9 +5986,6 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN(cache_ptr, entry_ptr);
- if(entry_ptr->type->clear && (entry_ptr->type->clear)(f, (void *)entry_ptr, FALSE) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to clear entry")
-
/* Check for entry changing status and do notifications, etc. */
if(was_dirty) {
/* If the entry's type has a 'notify' callback send a 'entry cleaned'
@@ -6082,30 +6034,22 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
HDassert(!H5F_IS_TMP_ADDR(f, entry_ptr->addr));
#ifndef NDEBUG
{
- hbool_t curr_compressed = FALSE;
size_t curr_len;
- size_t curr_compressed_len = 0;
/* Get the actual image size for the thing again */
- entry_ptr->type->image_len((void *)entry_ptr, &curr_len, &curr_compressed, &curr_compressed_len);
+ entry_ptr->type->image_len((void *)entry_ptr, &curr_len);
HDassert(curr_len == entry_ptr->size);
- HDassert(curr_compressed == entry_ptr->compressed);
- HDassert(curr_compressed_len == entry_ptr->compressed_size);
}
#endif /* NDEBUG */
- /* if the file space free size callback is defined, use
+ /* If the file space free size callback is defined, use
* it to get the size of the block of file space to free.
- * Otherwise use entry_ptr->compressed_size if
- * entry_ptr->compressed == TRUE, and entry_ptr->size
- * if entry_ptr->compressed == FALSE.
+ * Otherwise use entry_ptr->size.
*/
if(entry_ptr->type->fsf_size) {
if((entry_ptr->type->fsf_size)((void *)entry_ptr, &fsf_size) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "unable to get file space free size")
} /* end if */
- else if(entry_ptr->compressed) /* use compressed size */
- fsf_size = entry_ptr->compressed_size;
else /* no file space free size callback -- use entry size */
fsf_size = entry_ptr->size;
@@ -6140,19 +6084,10 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
/* Check for actually destroying the entry in memory */
/* (As opposed to taking ownership of it) */
if(destroy_entry) {
- /* if the entry is dirty and it has a clear callback,
- * call this callback now. Since this callback exists,
- * it follows tht the client maintains its own dirty bits,
- * which must be cleared before the entry is freed to avoid
- * sanity check failures. Also clear the dirty flag for
- * the same reason.
- */
if(entry_ptr->is_dirty) {
+ /* Reset dirty flag */
entry_ptr->is_dirty = FALSE;
- if(entry_ptr->type->clear && (entry_ptr->type->clear)(f, (void *)entry_ptr, TRUE) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to clear entry")
-
/* If the entry's type has a 'notify' callback send a 'entry cleaned'
* notice now that the entry is fully integrated into the cache.
*/
@@ -6228,14 +6163,6 @@ H5C_load_entry(H5F_t * f,
void * udata)
{
hbool_t dirty = FALSE; /* Flag indicating whether thing was dirtied during deserialize */
- hbool_t compressed = FALSE; /* flag indicating whether thing */
- /* will be run through filters on */
- /* on read and write. Usually FALSE */
- /* set to true if appropriate. */
- size_t compressed_size = 0; /* entry compressed size if */
- /* known -- otherwise uncompressed. */
- /* Zero indicates compression not */
- /* enabled. */
void * image = NULL; /* Buffer for disk image */
void * thing = NULL; /* Pointer to thing loaded */
H5C_cache_entry_t *entry = NULL; /* Alias for thing loaded, as cache entry */
@@ -6254,17 +6181,11 @@ H5C_load_entry(H5F_t * f,
HDassert(f->shared->cache);
HDassert(type);
- /* for now, we do not combine the speculative load and compressed flags */
- HDassert(!((type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) &&
- (type->flags & H5C__CLASS_COMPRESSED_FLAG)));
-
/* Can't see how skip reads could be usefully combined with
- * either the speculative read or compressed flags. Hence disallow.
+ * the speculative read flag. Hence disallow.
*/
HDassert(!((type->flags & H5C__CLASS_SKIP_READS) &&
(type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG)));
- HDassert(!((type->flags & H5C__CLASS_SKIP_READS) &&
- (type->flags & H5C__CLASS_COMPRESSED_FLAG)));
HDassert(H5F_addr_defined(addr));
HDassert(type->get_load_size);
@@ -6378,54 +6299,19 @@ H5C_load_entry(H5F_t * f,
entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC;
entry->type = type;
- /* verify that compressed and compressed_len are initialized */
- HDassert(compressed == FALSE);
- HDassert(compressed_size == 0);
-
/* Get the actual image size for the thing */
- if(type->image_len(thing, &new_len, &compressed, &compressed_size) < 0)
+ if(type->image_len(thing, &new_len) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "can't retrieve image length")
if(new_len == 0)
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, NULL, "image length is 0")
- HDassert(((type->flags & H5C__CLASS_COMPRESSED_FLAG) != 0) ||
- ((compressed == FALSE) && (compressed_size == 0)));
- HDassert((compressed == TRUE) || (compressed_size == 0));
-
if(new_len != len) {
- if(type->flags & H5C__CLASS_COMPRESSED_FLAG) {
-
- /* if new_len != len, then compression must be
- * enabled on the entry. In this case, the image_len
- * callback should have set compressed to TRUE, set
- * new_len equal to the uncompressed size of the
- * entry, and compressed_len equal to the compressed
- * size -- which must equal len.
- *
- * We can't verify the uncompressed size, but we can
- * verify the rest with the following assertions.
- */
- HDassert(compressed);
- HDassert(compressed_size == len);
-
- /* new_len should contain the uncompressed size. Set len
- * equal to new_len, so that the cache will use the
- * uncompressed size for purposes of space allocation, etc.
- */
- len = new_len;
-
- } else if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) {
+ if (type->flags & H5C__CLASS_SPECULATIVE_LOAD_FLAG) {
void *new_image; /* Buffer for disk image */
- /* compressed must be FALSE, and compressed_size
- * must be zero.
- */
- HDassert(!compressed);
- HDassert(compressed_size == 0);
-
/* Adjust the size of the image to match new_len */
if(NULL == (new_image = H5MM_realloc(image,
new_len + H5C_IMAGE_EXTRA_SPACE)))
@@ -6486,13 +6372,6 @@ H5C_load_entry(H5F_t * f,
#ifndef NDEBUG
{
- /* new_compressed and new_compressed_size must be
- * initialize to FALSE / 0 respectively, as clients
- * that don't use compression may ignore these two
- * parameters.
- */
- hbool_t new_compressed = FALSE;
- size_t new_compressed_size = 0;
size_t new_new_len;
/* Get the actual image size for the thing again. Note
@@ -6504,10 +6383,8 @@ H5C_load_entry(H5F_t * f,
entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC;
entry->type = type;
- type->image_len(thing, &new_new_len, &new_compressed, &new_compressed_size);
+ type->image_len(thing, &new_new_len);
HDassert(new_new_len == new_len);
- HDassert(!new_compressed);
- HDassert(new_compressed_size == 0);
} /* end block */
#endif /* NDEBUG */
} /* end if (new_len > len) */
@@ -6518,7 +6395,7 @@ H5C_load_entry(H5F_t * f,
} else { /* throw an error */
HGOTO_ERROR(H5E_CACHE, H5E_UNSUPPORTED, NULL, \
- "size of non-speculative, non-compressed object changed")
+ "size of non-speculative object changed")
}
} /* end if (new_len != len) */
} /* end if */
@@ -6551,8 +6428,6 @@ H5C_load_entry(H5F_t * f,
entry->addr = addr;
entry->size = len;
HDassert(entry->size < H5C_MAX_ENTRY_SIZE);
- entry->compressed = compressed;
- entry->compressed_size = compressed_size;
entry->image_ptr = image;
entry->image_up_to_date = TRUE;
entry->type = type;
@@ -7710,7 +7585,6 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
haddr_t new_addr = HADDR_UNDEF;
haddr_t old_addr = HADDR_UNDEF;
size_t new_len = 0;
- size_t new_compressed_len = 0;
unsigned serialize_flags = H5C__SERIALIZE_NO_FLAGS_SET;
herr_t ret_value = SUCCEED;
@@ -7724,18 +7598,15 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
/* Call client's pre-serialize callback, if there's one */
if(entry_ptr->type->pre_serialize &&
- (entry_ptr->type->pre_serialize)(f, dxpl_id,
- (void *)entry_ptr, entry_ptr->addr, entry_ptr->size,
- entry_ptr->compressed_size, &new_addr, &new_len,
- &new_compressed_len, &serialize_flags) < 0)
+ (entry_ptr->type->pre_serialize)(f, dxpl_id, (void *)entry_ptr,
+ entry_ptr->addr, entry_ptr->size, &new_addr, &new_len, &serialize_flags) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to pre-serialize entry")
/* Check for any flags set in the pre-serialize callback */
if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) {
/* Check for unexpected flags from serialize callback */
if(serialize_flags & ~(H5C__SERIALIZE_RESIZED_FLAG |
- H5C__SERIALIZE_MOVED_FLAG |
- H5C__SERIALIZE_COMPRESSED_FLAG))
+ H5C__SERIALIZE_MOVED_FLAG))
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unknown serialize flag(s)")
#ifdef H5_HAVE_PARALLEL
@@ -7769,49 +7640,31 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "resize/move in serialize occured in parallel case.")
#endif
- /* Resize the buffer if required */
- if(((!entry_ptr->compressed) && (serialize_flags & H5C__SERIALIZE_RESIZED_FLAG)) ||
- ((entry_ptr->compressed) && (serialize_flags & H5C__SERIALIZE_COMPRESSED_FLAG))) {
- size_t new_image_size;
-
- if(entry_ptr->compressed)
- new_image_size = new_compressed_len;
- else
- new_image_size = new_len;
- HDassert(new_image_size > 0);
-
- /* Release the current image */
- if(entry_ptr->image_ptr)
- entry_ptr->image_ptr = H5MM_xfree(entry_ptr->image_ptr);
-
+ /* If required, resize the buffer and update the entry and the cache
+ * data structures */
+ if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) {
/* Allocate a new image buffer */
- if(NULL == (entry_ptr->image_ptr = H5MM_malloc(new_image_size + H5C_IMAGE_EXTRA_SPACE)))
+ if(NULL == (entry_ptr->image_ptr = H5MM_realloc(entry_ptr->image_ptr, new_len + H5C_IMAGE_EXTRA_SPACE)))
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed for on disk image buffer")
-
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + new_image_size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
+ HDmemcpy(((uint8_t *)entry_ptr->image_ptr) + new_len, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE);
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
- } /* end if */
- /* If required, update the entry and the cache data structures
- * for a resize.
- */
- if(serialize_flags & H5C__SERIALIZE_RESIZED_FLAG) {
+ /* Update statistics for resizing the entry */
H5C__UPDATE_STATS_FOR_ENTRY_SIZE_CHANGE(cache_ptr, entry_ptr, new_len);
- /* update the hash table for the size change*/
+ /* update the hash table for the size change */
H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(cache_ptr, entry_ptr->size, \
new_len, entry_ptr, !(entry_ptr->is_dirty));
- /* The entry can't be protected since we are
- * in the process of flushing it. Thus we must
- * update the replacement policy data
- * structures for the size change. The macro
- * deals with the pinned case.
+ /* The entry can't be protected since we are in the process of
+ * flushing it. Thus we must update the replacement policy data
+ * structures for the size change. The macro deals with the pinned
+ * case.
*/
H5C__UPDATE_RP_FOR_SIZE_CHANGE(cache_ptr, entry_ptr, new_len);
- /* as we haven't updated the cache data structures for
+ /* As we haven't updated the cache data structures for
* for the flush or flush destroy yet, the entry should
* be in the slist. Thus update it for the size change.
*/
@@ -7828,12 +7681,9 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
if(serialize_flags & H5C__SERIALIZE_MOVED_FLAG) {
H5C__UPDATE_STATS_FOR_MOVE(cache_ptr, entry_ptr);
+ /* We must update cache data structures for the change in address */
if(entry_ptr->addr == old_addr) {
- /* we must update cache data structures for the
- * change in address.
- */
-
- /* delete the entry from the hash table and the slist */
+ /* Delete the entry from the hash table and the slist */
H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr);
H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE);
@@ -7847,35 +7697,15 @@ H5C__generate_image(const H5F_t *f, H5C_t *cache_ptr, H5C_cache_entry_t *entry_p
else /* move is already done for us -- just do sanity checks */
HDassert(entry_ptr->addr == new_addr);
} /* end if */
-
- if(serialize_flags & H5C__SERIALIZE_COMPRESSED_FLAG) {
- /* just save the new compressed entry size in
- * entry_ptr->compressed_size. We don't need to
- * do more, as compressed size is only used for I/O.
- */
- HDassert(entry_ptr->compressed);
- entry_ptr->compressed_size = new_compressed_len;
- } /* end if */
} /* end if(serialize_flags != H5C__SERIALIZE_NO_FLAGS_SET) */
/* Serialize object into buffer */
- {
- size_t image_len;
-
- if(entry_ptr->compressed)
- image_len = entry_ptr->compressed_size;
- else
- image_len = entry_ptr->size;
-
- if(entry_ptr->type->serialize(f, entry_ptr->image_ptr, image_len, (void *)entry_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry")
-
+ if(entry_ptr->type->serialize(f, entry_ptr->image_ptr, entry_ptr->size, (void *)entry_ptr) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to serialize entry")
#if H5C_DO_MEMORY_SANITY_CHECKS
- HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + image_len,
- H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE));
+ HDassert(0 == HDmemcmp(((uint8_t *)entry_ptr->image_ptr) + entry_ptr->size, H5C_IMAGE_SANITY_VALUE, H5C_IMAGE_EXTRA_SPACE));
#endif /* H5C_DO_MEMORY_SANITY_CHECKS */
- entry_ptr->image_up_to_date = TRUE;
- } /* end block */
+ entry_ptr->image_up_to_date = TRUE;
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Cepoch.c b/src/H5Cepoch.c
index 7c5e441..eacb247 100644
--- a/src/H5Cepoch.c
+++ b/src/H5Cepoch.c
@@ -68,17 +68,14 @@ static herr_t H5C__epoch_marker_get_load_size(const void *udata_ptr,
static void * H5C__epoch_marker_deserialize(const void * image_ptr,
size_t len, void * udata, hbool_t * dirty_ptr);
static herr_t H5C__epoch_marker_image_len(const void * thing,
- size_t *image_len_ptr, hbool_t *compressed_ptr, size_t *compressed_len_ptr);
+ size_t *image_len_ptr);
static herr_t H5C__epoch_marker_pre_serialize(const H5F_t *f,
hid_t dxpl_id, void * thing, haddr_t addr, size_t len,
- size_t compressed_len, haddr_t * new_addr_ptr, size_t * new_len_ptr,
- size_t * new_compressed_len_ptr, unsigned * flags_ptr);
+ haddr_t * new_addr_ptr, size_t * new_len_ptr, unsigned * flags_ptr);
static herr_t H5C__epoch_marker_serialize(const H5F_t *f,
void * image_ptr, size_t len, void * thing);
static herr_t H5C__epoch_marker_notify(H5C_notify_action_t action, void *thing);
static herr_t H5C__epoch_marker_free_icr(void * thing);
-static herr_t H5C__epoch_marker_clear(const H5F_t *f, void * thing,
- hbool_t about_to_destroy);
static herr_t H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing,
size_t H5_ATTR_UNUSED * fsf_size_ptr);
@@ -111,7 +108,6 @@ const H5C_class_t H5C__epoch_marker_class =
/* serialize = */ H5C__epoch_marker_serialize,
/* notify = */ H5C__epoch_marker_notify,
/* free_icr = */ H5C__epoch_marker_free_icr,
- /* clear = */ H5C__epoch_marker_clear,
/* fsf_size = */ H5C__epoch_marker_fsf_size,
};
@@ -152,8 +148,7 @@ H5C__epoch_marker_deserialize(const void H5_ATTR_UNUSED * image_ptr, size_t H5_A
static herr_t
H5C__epoch_marker_image_len(const void H5_ATTR_UNUSED *thing,
- size_t H5_ATTR_UNUSED *image_len_ptr, hbool_t H5_ATTR_UNUSED *compressed_ptr,
- size_t H5_ATTR_UNUSED *compressed_len_ptr)
+ size_t H5_ATTR_UNUSED *image_len_ptr)
{
FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */
@@ -166,8 +161,7 @@ H5C__epoch_marker_image_len(const void H5_ATTR_UNUSED *thing,
static herr_t
H5C__epoch_marker_pre_serialize(const H5F_t H5_ATTR_UNUSED *f, hid_t H5_ATTR_UNUSED dxpl_id,
void H5_ATTR_UNUSED *thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len,
- size_t H5_ATTR_UNUSED compressed_len, haddr_t H5_ATTR_UNUSED *new_addr_ptr,
- size_t H5_ATTR_UNUSED *new_len_ptr, size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
+ haddr_t H5_ATTR_UNUSED *new_addr_ptr, size_t H5_ATTR_UNUSED *new_len_ptr,
unsigned H5_ATTR_UNUSED *flags_ptr)
{
FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */
@@ -214,17 +208,6 @@ H5C__epoch_marker_free_icr(void H5_ATTR_UNUSED * thing)
static herr_t
-H5C__epoch_marker_clear(const H5F_t H5_ATTR_UNUSED *f, void H5_ATTR_UNUSED * thing, hbool_t H5_ATTR_UNUSED about_to_destroy)
-{
- FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */
-
- HERROR(H5E_CACHE, H5E_SYSTEM, "called unreachable fcn.");
-
- FUNC_LEAVE_NOAPI(FAIL)
-} /* end H5C__epoch_marker_clear() */
-
-
-static herr_t
H5C__epoch_marker_fsf_size(const void H5_ATTR_UNUSED * thing, size_t H5_ATTR_UNUSED *fsf_size_ptr)
{
FUNC_ENTER_STATIC_NOERR /* Yes, even though this pushes an error on the stack */
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index e98bc07..c4037b0 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -68,16 +68,14 @@
/* Flags for cache client class behavior */
#define H5C__CLASS_NO_FLAGS_SET ((unsigned)0x0)
#define H5C__CLASS_SPECULATIVE_LOAD_FLAG ((unsigned)0x1)
-#define H5C__CLASS_COMPRESSED_FLAG ((unsigned)0x2)
/* The following flags may only appear in test code */
-#define H5C__CLASS_SKIP_READS ((unsigned)0x4)
-#define H5C__CLASS_SKIP_WRITES ((unsigned)0x8)
+#define H5C__CLASS_SKIP_READS ((unsigned)0x2)
+#define H5C__CLASS_SKIP_WRITES ((unsigned)0x4)
/* Flags for pre-serialize callback */
#define H5C__SERIALIZE_NO_FLAGS_SET ((unsigned)0)
#define H5C__SERIALIZE_RESIZED_FLAG ((unsigned)0x1)
#define H5C__SERIALIZE_MOVED_FLAG ((unsigned)0x2)
-#define H5C__SERIALIZE_COMPRESSED_FLAG ((unsigned)0x4)
/* Upper and lower limits on cache size. These limits are picked
* out of a hat -- you should be able to change them as necessary.
@@ -286,19 +284,12 @@ typedef struct H5C_t H5C_t;
*
* flags: Flags indicating class-specific behavior.
*
- * Whoever created the flags field neglected to document the meanings
- * of the flags he created. Hence the following discussion of the
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG and (to a lesser extent)
- * H5C__CLASS_COMPRESSED_FLAG should be viewed with suspicion,
- * as the meanings are divined from the source code, and thus may be
- * inaccurate. Please correct any errors you find.
- *
* Possible flags are:
*
* H5C__CLASS_NO_FLAGS_SET: No special processing.
*
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag appears to be used
- * only in H5C_load_entry(). When it is set, entries are
+ * H5C__CLASS_SPECULATIVE_LOAD_FLAG: This flag is used only in
+ * H5C_load_entry(). When it is set, entries are
* permitted to change their sizes on the first attempt
* to load.
*
@@ -312,56 +303,15 @@ typedef struct H5C_t H5C_t;
* entry in the cache.
*
* If the new size is smaller than the old, no new loads
- * or desearializes are performed, but the new size becomes
+ * or deserializes are performed, but the new size becomes
* the size of the entry in the cache.
*
* When this flag is set, an attempt to read past the
- * end of file is pemitted. In this case, if the size
+ * end of file could occur. In this case, if the size
* returned get_load_size callback would result in a
- * read past the end of file, the size is trunkated to
+ * read past the end of file, the size is truncated to
* avoid this, and processing proceeds as normal.
*
- * H5C__CLASS_COMPRESSED_FLAG: This flags indicates that the entry
- * may be compressed -- i.e. its on disk image is run through
- * filters on the way to and from disk. Thus the uncompressed
- * (or unfiltered) size of the entry may be different from the
- * size of the entry in file.
- *
- * This has the following implications:
- *
- * On load, uncompressed size and load size may be different.
- * Presumably, load size will be smaller than uncompressed
- * size, but there is no requirement for this in the code
- * (but note that I have inserted an assertion to this effect,
- * which has not been triggered to date).
- *
- * On insertion, compressed (AKA filtered, AKA on disk) size
- * is unknown, as the entry has yet to be run through filters.
- * Compressed size is computed whenever the entry is
- * written (or the image is updated -- not relevant until
- * journaling is brought back).
- *
- * On dirty (of a clean entry), compressed (AKA filtered,
- * AKA on disk) size becomes unknown. Thus, compressed size
- * must be computed by the pre-serialize callback before the
- * entry may be written.
- *
- * Once the compressed size becomes unknown, it remains so
- * until the on disk image is constructed.
- *
- * Observe that the cache needs to know the size of the entry
- * for space allocation purposes. Since the compressed size
- * can change or become unknown, it uses the uncompressed
- * size which may change, but which should always be known.
- * The compressed size is used only for journaling and disk I/O.
- *
- * While there is no logical reason why they could not be
- * combined, due to absence of need and for simplicity of code,
- * the cache does not permit both the the
- * H5C__CLASS_COMPRESSED_FLAG and the
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG to be set in the same
- * instance of H5C_class_t.
- *
* The following flags may only appear in test code.
*
* H5C__CLASS_SKIP_READS: This flags is intended only for use in test
@@ -379,14 +329,10 @@ typedef struct H5C_t H5C_t;
* a metadata cache entry, given the 'udata' that will be passed to the
* 'deserialize' callback.
*
- * Note that if either the H5C__CLASS_SPECULATIVE_LOAD_FLAG or
- * the H5C__CLASS_COMPRESSED_FLAG is set, the disk image size
- * returned by this callback is either a first guess (if the
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG is set) or (if the
- * H5C__CLASS_COMPRESSED_FLAG is set), the exact on disk size
- * of the entry whether it has been run through filters or not.
- * In all other cases, the value returned should be the correct
- * uncompressed size of the entry.
+ * Note that if either the H5C__CLASS_SPECULATIVE_LOAD_FLAG is set, the disk image size
+ * returned by this callback is a first guess.
+ * In other cases, the value returned should be the correct
+ * size of the entry.
*
* The typedef for the deserialize callback is as follows:
*
@@ -499,37 +445,16 @@ typedef struct H5C_t H5C_t;
* and load a new buffer of the correct size from file, and then call
* the deserialize callback again.
*
- * If the H5C__CLASS_COMPRESSED_FLAG is set, exceptions are as per the
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG, save that only oversized buffers
- * are permitted.
- *
*
* IMAGE_LEN: Pointer to the image length callback.
*
- * This callback exists primarily to support
- * H5C__CLASS_SPECULATIVE_LOAD_FLAG and H5C__CLASS_COMPRESSED_FLAG
- * discussed above, although it is also used to obtain the size of
- * newly inserted entries.
- *
- * In the case of the H5C__CLASS_SPECULATIVE_LOAD_FLAG, it is used to
- * allow the client to change the size of an entry in the deserialize
- * callback.
- *
- * For the H5C__CLASS_COMPRESSED_FLAG, it is used to allow the client
- * to indicate whether the entry is compressed (i.e. whether entries
- * are run through filters) and if so, to report both the uncompressed
- * and the compressed entry size (i.e. the actual on disk size after
- * the entry has been run through filters) if that value is known.
- *
- * The callback is also used in H5C_insert_entry() to obtain the
- * size of the newly inserted entry.
+ * The image_len callback is used to obtain the size of newly inserted
+ * entries and assert verification.
*
* The typedef for the image_len callback is as follows:
*
* typedef herr_t (*H5C_image_len_func_t)(void *thing,
- * size_t *image_len_ptr,
- * hbool_t *compressed_ptr,
- * size_t *compressed_image_len_ptr);
+ * size_t *image_len_ptr);
*
* The parameters of the image_len callback are as follows:
*
@@ -538,84 +463,15 @@ typedef struct H5C_t H5C_t;
* image_len_ptr: Pointer to size_t in which the callback will return
* the length (in bytes) of the cache entry.
*
- * If the H5C__CLASS_COMPRESSED_FLAG is not set in the
- * associated instance of H5C_class_t, or if the flag is
- * set, and the callback sets *compressed_ptr to FALSE,
- * this size is the actual size of the entry on disk.
- *
- * Otherwise, this size is the uncompressed size of the
- * entry -- which the cache will use for all purposes OTHER
- * than journal writes and disk I/O.
- *
- * compressed_ptr: Pointer to a boolean flag indicating whether
- * the cache entry will be compressed / uncompressed on
- * disk writes / reads.
- *
- * If the H5C__CLASS_COMPRESSED_FLAG is not set in the
- * associated instance of H5C_class_t, *compressed_ptr
- * must be set to FALSE.
- *
- * If the H5C__CLASS_COMPRESSED_FLAG is set in the
- * associated instance of H5C_class_t, and filters are
- * not enabled, *compressed_ptr must be set to FALSE.
- *
- * If the H5C__CLASS_COMPRESSED_FLAG is set in the
- * associated instance of H5C_class_t, and filters are
- * enabled, the callback must set *compressed_ptr to TRUE.
- *
- * Note that *compressed_ptr will always be set to FALSE
- * by the caller prior to invocation of the callback. Thus
- * callbacks for clients that don't set the
- * H5C__CLASS_COMPRESSED_FLAG can ignore this parameter.
- *
- * compressed_image_len_ptr: Pointer to size_t in which the callback
- * may return the length (in bytes) of the compressed on
- * disk image of the entry, or the uncompressed size if the
- * compressed size has not yet been calculated.
- *
- * Since computing the compressed image len is expensive,
- * the callback should only report the most recently computed
- * value -- which will typically be incorrect if the entry
- * is dirty.
- *
- * If *compressed_ptr is set to FALSE, *compressed_image_len_ptr
- * should be set to zero. However, as *compressed_image_len_ptr
- * will be initialize to zero prior to the call, the callback
- * need not modify it if the H5C__CLASS_COMPRESSED_FLAG is
- * not set.
- *
- * If the H5C__CLASS_COMPRESSED_FLAG is not set in the associated
- * instance of H5C_class_t, processing in the image_len function
- * should proceed as follows:
+ * Processing in the image_len function should proceed as follows:
*
* If successful, the function will place the length of the on disk
* image associated with the in core representation provided in the
- * thing parameter in *image_len_ptr, and then return SUCCEED. Since
- * *compressed_ptr and *compressed_image_len_ptr will be initialized to
- * FALSE and zero respectively before the call, the callback need not
- * modify these values, and may declare the associated parameters as
- * UNUSED.
- *
- * If the H5C__CLASS_COMPRESSED_FLAG is set in the associated
- * instance of H5C_class_t, processing in the image_len function
- * should proceed as follows:
- *
- * If successful, the function will place the uncompressed length of
- * the on disk image associated with the in core representation
- * provided in the thing parameter in *image_len_ptr. If filters
- * are not enabled for the entry, it will set *compressed_ptr to FALSE,
- * and *compressed_image_len_ptr to zero. If filters are enabled,
- * it will set *compressed_ptr to TRUE. In this case, it must set
- * *compressed_image_len_ptr equal to the last computed compressed
- * if the compressed size, or to the uncompressed size if that value
- * is yet to be computed. In all cases, it will return SUCCEED if
- * successful.
- *
- * In either case, if the function fails, it must return FAIL and
- * push error information onto the error stack with the error API
- * routines, and return without modifying the values pointed to by
- * the image_len_ptr, compressed_ptr, and compressed_image_len_ptr
- * parameters.
+ * thing parameter in *image_len_ptr, and then return SUCCEED.
+ *
+ * If the function fails, it must return FAIL and push error information
+ * onto the error stack with the error API routines, and return without
+ * modifying the values pointed to by the image_len_ptr parameter.
*
* PRE_SERIALIZE: Pointer to the pre-serialize callback.
*
@@ -623,11 +479,11 @@ typedef struct H5C_t H5C_t;
* it needs a current on-disk image of the metadata entry for purposes
* either constructing a journal or flushing the entry to disk.
*
- * If the client needs to change the address or compressed or
- * uncompressed length of the entry prior to flush, the pre-serialize
- * callback is responsible for these actions, so that the actual
- * serialize callback (described below) is only responsible for
- * serializing the data structure, not moving it on disk or resizing it.
+ * If the client needs to change the address or length of the entry prior
+ * to flush, the pre-serialize callback is responsible for these actions,
+ * so that the actual serialize callback (described below) is only
+ * responsible for serializing the data structure, not moving it on disk
+ * or resizing it.
*
* In addition, the client may use the pre-serialize callback to
* ensure that the entry is ready to be flushed -- in particular,
@@ -641,7 +497,7 @@ typedef struct H5C_t H5C_t;
* However, that need not be the case as free space section info
* entries will change size (and possibly location) depending on the
* number of blocks of free space being manages, and fractal heap
- * direct blocks can change compressed size (and possibly location)
+ * direct blocks can change compressed size (and possibly location)
* on serialization if compression is enabled. Similarly, it may
* be necessary to move entries from temporary to real file space.
*
@@ -655,10 +511,8 @@ typedef struct H5C_t H5C_t;
* void * thing,
* haddr_t addr,
* size_t len,
- * size_t compressed_len,
* haddr_t * new_addr_ptr,
* size_t * new_len_ptr,
- * size_t * new_compressed_len_ptr,
* unsigned * flags_ptr);
*
* The parameters of the pre-serialize callback are as follows:
@@ -686,22 +540,8 @@ typedef struct H5C_t H5C_t;
*
* len: Length in bytes of the in file image of the entry to be
* serialized. Also the size the image passed to the
- * serialize callback (discussed below) unless either that
- * value is altered by this function, or the entry will be
- * compressed. In the latter case, the compressed size
- * of the entry will be reported in *new_compressed_len_ptr.
- *
- * This parameter is supplied mainly for sanity checking.
- * Sanity checks should be performed when compiled in debug
- * mode, but the parameter may be unused when compiled in
- * production mode.
- *
- * compressed_len: If the entry is to be compressed (i.e. run through
- * filters) prior to flush, Length in bytes of the last know
- * compressed size of the entry -- or the uncompressed size
- * if no such value exists (i.e. the entry has been inserted,
- * but never flushed). This parameter should be set to zero
- * in all other cases.
+ * serialize callback (discussed below) unless that
+ * value is altered by this function.
*
* This parameter is supplied mainly for sanity checking.
* Sanity checks should be performed when compiled in debug
@@ -726,20 +566,12 @@ typedef struct H5C_t H5C_t;
* *new_len_ptr is undefined on pre-serialize callback
* return.
*
- * new_compressed_len_ptr: Pointer to size_t. If the image will be
- * compressed (i.e. run through filters) prior to being
- * written to disk, the compressed size (in bytes) of the
- * on disk image must be stored in *new_compressed_len_ptr,
- * and the appropriate flag set in *flags_ptr.
- *
* flags_ptr: Pointer to an unsigned integer used to return flags
* indicating whether the preserialize function resized or moved
- * the entry, or computed its compressed size. If the entry was
- * neither resized or moved, nor will be compressed,
- * the serialize function must set *flags_ptr to zero.
- * H5C__SERIALIZE_RESIZED_FLAG, H5C__SERIALIZE_MOVED_FLAG
- * and H5C__SERIALIZE_COMPRESSED_FLAG must be set to indicate
- * a resize, a move, or compression respectively.
+ * the entry. If the entry was neither resized or moved, the
+ * serialize function must set *flags_ptr to zero. The
+ * H5C__SERIALIZE_RESIZED_FLAG or H5C__SERIALIZE_MOVED_FLAG must
+ * be set to indicate a resize or move respectively.
*
* If the H5C__SERIALIZE_RESIZED_FLAG is set, the new length
* must be stored in *new_len_ptr.
@@ -747,40 +579,21 @@ typedef struct H5C_t H5C_t;
* If the H5C__SERIALIZE_MOVED_FLAG flag is set, the
* new image base address must be stored in *new_addr_ptr.
*
- * If the H5C__SERIALIZE_COMPRESSED_FLAG is set, the
- * compressed size of the new image must be stored in
- * *new_compressed_len_ptr.
- *
* Processing in the pre-serialize function should proceed as follows:
*
* The pre-serialize function must examine the in core representation
* indicated by the thing parameter, if the pre-serialize function does
- * not need to change the size or location of the on-disk image, or
- * compute its compress size, it must set *flags_ptr to zero.
+ * not need to change the size or location of the on-disk image, it must
+ * set *flags_ptr to zero.
*
- * If the (uncompressed) size of the on-disk image must be changed,
- * the pre-serialize function must load the length of the new image
- * into *new_len_ptr, and set the H5C__SERIALIZE_RESIZED_FLAG in
- * *flags_ptr.
+ * If the size of the on-disk image must be changed, the pre-serialize
+ * function must load the length of the new image into *new_len_ptr, and
+ * set the H5C__SERIALIZE_RESIZED_FLAG in *flags_ptr.
*
* If the base address of the on disk image must be changed, the
* pre-serialize function must set *new_addr_ptr to the new base address,
* and set the H5C__SERIALIZE_MOVED_FLAG in *flags_ptr.
*
- * If the H5C__CLASS_COMPRESSED_FLAG is set in the assocated instance
- * of H5C_class_t, and filters (i.e. compression) are enabled, the
- * pre-serialize function must compute the compressed size of the
- * on disk image, and if it has changed, load this value into
- * *new_compressed_len_ptr, and set H5C__SERIALIZE_COMPRESSED_FLAG in
- * *flags_ptr.
- *
- * Note that to do this, the preserialize function will typically have
- * to serialize the entry, and run it through the filters to obtain
- * the compressed size. For efficiency, the compressed image may
- * be stored to be copied into the supplied buffer by the
- * serialize callback. Needless to say this is awkward. We may
- * want to re-work the API for cache clients to simplify this.
- *
* In addition, the pre-serialize callback may perform any other
* processing required before the entry is written to disk
*
@@ -829,11 +642,7 @@ typedef struct H5C_t H5C_t;
* the buffer.
*
* len: Length in bytes of the in file image of the entry to be
- * serialized. Also the size of *image_ptr (below). If
- * compression is not enabled, this value is simply the
- * uncompressed size of the entry's image on disk. If
- * compression is enabled, this value is the size of the
- * compressed image.
+ * serialized. Also the size of *image_ptr (below).
*
* This parameter is supplied mainly for sanity checking.
* Sanity checks should be performed when compiled in debug
@@ -852,8 +661,7 @@ typedef struct H5C_t H5C_t;
*
* The serialize function must then examine the in core
* representation indicated by the thing parameter, and write a
- * serialized (and possibly compressed) image of its contents into
- * the provided buffer.
+ * serialized image of its contents into the provided buffer.
*
* If it is successful, the function must return SUCCEED.
*
@@ -925,65 +733,7 @@ typedef struct H5C_t H5C_t;
*
* At least when compiled with debug, it would be useful if the
* free ICR call would fail if the in core representation has been
- * modified since the last serialize of clear callback.
- *
- * CLEAR: Pointer to the clear callback.
- *
- * In principle, there should be no need for the clear callback,
- * as the dirty flag should be maintained by the metadata cache.
- *.
- * However, some clients maintain dirty bits on internal data,
- * and we need some way of keeping these dirty bits in sync with
- * those maintained by the metadata cache. This callback exists
- * to serve this purpose. If defined, it is called whenever the
- * cache marks dirty entry clean, or when the cache is about to
- * discard a dirty entry without writing it to disk (This
- * happens as the result of an unprotect call with the
- * H5AC__DELETED_FLAG set, and the H5C__TAKE_OWNERSHIP_FLAG not
- * set.)
- *
- * Arguably, this functionality should be in the NOTIFY callback.
- * However, this callback is specific to only a few clients, and
- * it will be called relatively frequently. Hence it is made its
- * own callback to minimize overhead.
- *
- * The typedef for the clear callback is as follows:
- *
- * typedef herr_t (*H5C_clear_func_t)(const H5F_t *f,
- * void * thing,
- * hbool_t about_to_destroy);
- *
- * The parameters of the clear callback are as follows:
- *
- * f: File pointer.
- *
- * thing: Pointer to void containing the address of the in core
- * representation of the target metadata cache entry. This
- * is the same pointer that would be returned by a protect()
- * call of the associated addr and len.
- *
- * about_to_destroy: Boolean flag used to indicate whether the
- * metadata cache is about to destroy the target metadata
- * cache entry. The callback may use this flag to omit
- * operations that are irrelevant it the entry is about
- * to be destroyed.
- *
- * Processing in the clear function should proceed as follows:
- *
- * Reset all internal dirty bits in the target metadata cache entry.
- *
- * If the about_to_destroy flag is TRUE, the clear function may
- * ommit any dirty bit that will not trigger a sanity check failure
- * or otherwise cause problems in the subsequent free icr call.
- * In particular, the call must ensure that the free icr call will
- * not fail due to changes prior to this call, and after the
- * last serialize or clear call.
- *
- * If the function is successful, it must return SUCCEED.
- *
- * If it fails for any reason, the function must return FAIL and
- * push error information on the error stack with the error API
- * routines.
+ * modified since the last serialize callback.
*
* GET_FSF_SIZE: Pointer to the get file space free size callback.
*
@@ -1019,12 +769,12 @@ typedef struct H5C_t H5C_t;
* At present this callback is used only by the H5FA and H5EA dblock
* and dblock page client classes.
*
- * The typedef for the clear callback is as follows:
+ * The typedef for the get_fsf_size callback is as follows:
*
* typedef herr_t (*H5C_get_fsf_size_t)(const void * thing,
* size_t *fsf_size_ptr);
*
- * The parameters of the clear callback are as follows:
+ * The parameters of the get_fsf_size callback are as follows:
*
* thing: Pointer to void containing the address of the in core
* representation of the target metadata cache entry. This
@@ -1072,18 +822,14 @@ typedef herr_t (*H5C_get_load_size_func_t)(const void *udata_ptr,
size_t *image_len_ptr);
typedef void *(*H5C_deserialize_func_t)(const void *image_ptr,
size_t len, void *udata_ptr, hbool_t *dirty_ptr);
-typedef herr_t (*H5C_image_len_func_t)(const void *thing,
- size_t *image_len_ptr, hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+typedef herr_t (*H5C_image_len_func_t)(const void *thing, size_t *image_len_ptr);
typedef herr_t (*H5C_pre_serialize_func_t)(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr_ptr, size_t *new_len_ptr, size_t *new_compressed_len_ptr,
- unsigned *flags_ptr);
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
typedef herr_t (*H5C_serialize_func_t)(const H5F_t *f, void *image_ptr,
size_t len, void *thing);
typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing);
typedef herr_t (*H5C_free_icr_func_t)(void *thing);
-typedef herr_t (*H5C_clear_func_t)(const H5F_t *f, void * thing,
- hbool_t about_to_destroy);
typedef herr_t (*H5C_get_fsf_size_t)(const void * thing, size_t *fsf_size_ptr);
/* Metadata cache client class definition */
@@ -1099,7 +845,6 @@ typedef struct H5C_class_t {
H5C_serialize_func_t serialize;
H5C_notify_func_t notify;
H5C_free_icr_func_t free_icr;
- H5C_clear_func_t clear;
H5C_get_fsf_size_t fsf_size;
} H5C_class_t;
@@ -1204,51 +949,11 @@ typedef int H5C_ring_t;
*
* addr: Base address of the cache entry on disk.
*
- * size: Length of the cache entry on disk in bytes(exception: if
- * the entry is compressed on disk, this field contains the
- * uncompressed size of the entry -- see discussion of
- * compressed entries below). Note that unlike normal
- * caches, the entries in this cache are of arbitrary size.
- *
- * With the exception of compressed entries, the file space
- * allocations for cache entries implied by the addr and size
- * fields must be disjoint. For compressed entries,
- * the size field contains the uncompressed size -- thus in
- * in this case, substitution of compressed size for size
- * must result in disjoint file space allocations. However,
- * as discussed below, the compressed size may not be know.
- *
- * Any entry whose associated instance of H5C_class_t has the
- * H5C__CLASS_COMPRESSED_FLAG set may be compressed. When
- * an entry is compressed (that is, when filters are enabled
- * on it), the compressed flag (see below) must be set, and
- * the compressed size (if known), must be stored in
- * the compressed_size field.
- *
- * Since the compressed size will be unknown unless the
- * entry is clean, or has an up to date image (see the
- * image_ptr and image_up_to_date fields below), we use the
- * uncompressed size for all purposes other than disk I/O.
- *
- * compressed: Boolean flag that is set iff the instance of H5C_class_t
- * associated with the entry has the H5C__CLASS_COMPRESSED_FLAG
- * set, and filters are enabled on the entry.
- *
- * compressed_size: If compressed is TRUE, this field contains the actual
- * compressed size of the entry in bytes, which is also its
- * true size on disk -- or the uncompressed size if the
- * compressed size is unknown (i.e. the entry has been
- * inserted in the cache, but it has not been compressed yet).
- * Note that this value will usually be incorrect if the
- * entry is dirty.
- *
- * Since this value is frequently out of date and expensive to
- * compute, it is used only for disk I/O. The uncompressed
- * size of the entry (stored in the size field above) is used
- * for all other purposes (i.e. computing the sum of the sizes
- * of all entries in the cache, etc.).
- *
- * If compressed is FALSE, this field should contain 0.
+ * size: Length of the cache entry on disk in bytes Note that unlike
+ * normal caches, the entries in this cache are of arbitrary size.
+ *
+ * The file space allocations for cache entries implied by the
+ * addr and size fields must be disjoint.
*
* image_ptr: Pointer to void. When not NULL, this field points to a
* dynamically allocated block of size bytes in which the
@@ -1273,25 +978,6 @@ typedef int H5C_ring_t;
* entry has been modified since the last time it was written
* to disk.
*
- * NOTE: For historical reasons, this field is not maintained
- * by the cache. Instead, the module using the cache
- * sets this flag when it modifies the entry, and the
- * flush and clear functions supplied by that module
- * reset the dirty when appropriate.
- *
- * This is a bit quirky, so we may want to change this
- * someday. However it will require a change in the
- * cache interface.
- *
- * Update: Management of the is_dirty field has been largely
- * moved into the cache. The only remaining exceptions
- * are the flush and clear functions supplied by the
- * modules using the cache. These still clear the
- * is_dirty field as before. -- JRM 7/5/05
- *
- * Update: Management of the is_dirty field is now entirely
- * in the cache. -- JRM 7/5/07
- *
* dirtied: Boolean flag used to indicate that the entry has been
* dirtied while protected.
*
@@ -1604,8 +1290,6 @@ typedef struct H5C_cache_entry_t {
H5C_t * cache_ptr;
haddr_t addr;
size_t size;
- hbool_t compressed;
- size_t compressed_size;
void * image_ptr;
hbool_t image_up_to_date;
const H5C_class_t * type;
diff --git a/src/H5EAcache.c b/src/H5EAcache.c
index ea8bd0e..4a53b5c 100644
--- a/src/H5EAcache.c
+++ b/src/H5EAcache.c
@@ -76,8 +76,7 @@
static herr_t H5EA__cache_hdr_get_load_size(const void *udata, size_t *image_len);
static void *H5EA__cache_hdr_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5EA__cache_hdr_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5EA__cache_hdr_image_len(const void *thing, size_t *image_len);
static herr_t H5EA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5EA__cache_hdr_free_icr(void *thing);
@@ -85,9 +84,7 @@ static herr_t H5EA__cache_hdr_free_icr(void *thing);
static herr_t H5EA__cache_iblock_get_load_size(const void *udata, size_t *image_len);
static void *H5EA__cache_iblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5EA__cache_iblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5EA__cache_iblock_image_len(const void *thing, size_t *image_len);
static herr_t H5EA__cache_iblock_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5EA__cache_iblock_notify(H5AC_notify_action_t action, void *thing);
@@ -96,9 +93,7 @@ static herr_t H5EA__cache_iblock_free_icr(void *thing);
static herr_t H5EA__cache_sblock_get_load_size(const void *udata, size_t *image_len);
static void *H5EA__cache_sblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5EA__cache_sblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5EA__cache_sblock_image_len(const void *thing, size_t *image_len);
static herr_t H5EA__cache_sblock_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5EA__cache_sblock_notify(H5AC_notify_action_t action, void *thing);
@@ -107,9 +102,7 @@ static herr_t H5EA__cache_sblock_free_icr(void *thing);
static herr_t H5EA__cache_dblock_get_load_size(const void *udata, size_t *image_len);
static void *H5EA__cache_dblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5EA__cache_dblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5EA__cache_dblock_image_len(const void *thing, size_t *image_len);
static herr_t H5EA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5EA__cache_dblock_notify(H5AC_notify_action_t action, void *thing);
@@ -120,8 +113,7 @@ static herr_t H5EA__cache_dblk_page_get_load_size(const void *udata, size_t *ima
static void *H5EA__cache_dblk_page_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
static herr_t H5EA__cache_dblk_page_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+ size_t *image_len);
static herr_t H5EA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5EA__cache_dblk_page_notify(H5AC_notify_action_t action, void *thing);
@@ -145,7 +137,6 @@ const H5AC_class_t H5AC_EARRAY_HDR[1] = {{
H5EA__cache_hdr_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5EA__cache_hdr_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -162,7 +153,6 @@ const H5AC_class_t H5AC_EARRAY_IBLOCK[1] = {{
H5EA__cache_iblock_serialize, /* 'serialize' callback */
H5EA__cache_iblock_notify, /* 'notify' callback */
H5EA__cache_iblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -179,7 +169,6 @@ const H5AC_class_t H5AC_EARRAY_SBLOCK[1] = {{
H5EA__cache_sblock_serialize, /* 'serialize' callback */
H5EA__cache_sblock_notify, /* 'notify' callback */
H5EA__cache_sblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -196,7 +185,6 @@ const H5AC_class_t H5AC_EARRAY_DBLOCK[1] = {{
H5EA__cache_dblock_serialize, /* 'serialize' callback */
H5EA__cache_dblock_notify, /* 'notify' callback */
H5EA__cache_dblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
H5EA__cache_dblock_fsf_size, /* 'fsf_size' callback */
}};
@@ -213,7 +201,6 @@ const H5AC_class_t H5AC_EARRAY_DBLK_PAGE[1] = {{
H5EA__cache_dblk_page_serialize, /* 'serialize' callback */
H5EA__cache_dblk_page_notify, /* 'notify' callback */
H5EA__cache_dblk_page_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -408,8 +395,7 @@ END_FUNC(STATIC) /* end H5EA__cache_hdr_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5EA__cache_hdr_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5EA_hdr_t *hdr = (const H5EA_hdr_t *)_thing; /* Pointer to the object */
@@ -690,8 +676,7 @@ END_FUNC(STATIC) /* end H5EA__cache_iblock_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5EA__cache_iblock_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5EA_iblock_t *iblock = (const H5EA_iblock_t *)_thing; /* Pointer to the object */
@@ -1061,8 +1046,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5EA__cache_sblock_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5EA_sblock_t *sblock = (const H5EA_sblock_t *)_thing; /* Pointer to the object */
@@ -1434,8 +1418,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5EA__cache_dblock_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5EA_dblock_t *dblock = (const H5EA_dblock_t *)_thing; /* Pointer to the object */
@@ -1632,7 +1615,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblock_free_icr() */
* file space block set.
*
* This function is needed when the data block is paged, as
- * the datablock header and all its pages are allocted as a
+ * the datablock header and all its pages are allocated as a
* single contiguous chunk of file space, and must be
* deallocated the same way.
*
@@ -1797,8 +1780,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5EA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5EA_dblk_page_t *dblk_page = (const H5EA_dblk_page_t *)_thing; /* Pointer to the object */
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 540004a..9574c9f 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -74,8 +74,7 @@
static herr_t H5FA__cache_hdr_get_load_size(const void *udata, size_t *image_len);
static void *H5FA__cache_hdr_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5FA__cache_hdr_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5FA__cache_hdr_image_len(const void *thing, size_t *image_len);
static herr_t H5FA__cache_hdr_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5FA__cache_hdr_free_icr(void *thing);
@@ -83,9 +82,7 @@ static herr_t H5FA__cache_hdr_free_icr(void *thing);
static herr_t H5FA__cache_dblock_get_load_size(const void *udata, size_t *image_len);
static void *H5FA__cache_dblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5FA__cache_dblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5FA__cache_dblock_image_len(const void *thing, size_t *image_len);
static herr_t H5FA__cache_dblock_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5FA__cache_dblock_free_icr(void *thing);
@@ -94,9 +91,7 @@ static herr_t H5FA__cache_dblock_fsf_size(const void *thing, size_t *fsf_size);
static herr_t H5FA__cache_dblk_page_get_load_size(const void *udata, size_t *image_len);
static void *H5FA__cache_dblk_page_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5FA__cache_dblk_page_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5FA__cache_dblk_page_image_len(const void *thing, size_t *image_len);
static herr_t H5FA__cache_dblk_page_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5FA__cache_dblk_page_free_icr(void *thing);
@@ -119,7 +114,6 @@ const H5AC_class_t H5AC_FARRAY_HDR[1] = {{
H5FA__cache_hdr_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5FA__cache_hdr_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -136,7 +130,6 @@ const H5AC_class_t H5AC_FARRAY_DBLOCK[1] = {{
H5FA__cache_dblock_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5FA__cache_dblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
H5FA__cache_dblock_fsf_size, /* 'fsf_size' callback */
}};
@@ -153,7 +146,6 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
H5FA__cache_dblk_page_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5FA__cache_dblk_page_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -336,8 +328,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5FA__cache_hdr_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5FA_hdr_t *hdr = (const H5FA_hdr_t *)_thing; /* Pointer to the object */
@@ -618,8 +609,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5FA__cache_dblock_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5FA_dblock_t *dblock = (const H5FA_dblock_t *)_thing; /* Pointer to the object */
@@ -915,8 +905,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_deserialize() */
*/
BEGIN_FUNC(STATIC, NOERR,
herr_t, SUCCEED, -,
-H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr))
+H5FA__cache_dblk_page_image_len(const void *_thing, size_t *image_len))
/* Local variables */
const H5FA_dblk_page_t *dblk_page = (const H5FA_dblk_page_t *)_thing; /* Pointer to the object */
diff --git a/src/H5FScache.c b/src/H5FScache.c
index c04ac7c..b403a69 100644
--- a/src/H5FScache.c
+++ b/src/H5FScache.c
@@ -81,11 +81,9 @@ static herr_t H5FS__sinfo_serialize_node_cb(void *_item, void H5_ATTR_UNUSED *ke
static herr_t H5FS__cache_hdr_get_load_size(const void *udata, size_t *image_len);
static void *H5FS__cache_hdr_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len);
static herr_t H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len,
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len,
unsigned *flags);
static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
@@ -94,11 +92,9 @@ static herr_t H5FS__cache_hdr_free_icr(void *thing);
static herr_t H5FS__cache_sinfo_get_load_size(const void *udata, size_t *image_len);
static void *H5FS__cache_sinfo_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5FS__cache_sinfo_image_len(const void *thing, size_t *image_len);
static herr_t H5FS__cache_sinfo_pre_serialize(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len,
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len,
unsigned *flags);
static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
@@ -122,7 +118,6 @@ const H5AC_class_t H5AC_FSPACE_HDR[1] = {{
H5FS__cache_hdr_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5FS__cache_hdr_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -139,7 +134,6 @@ const H5AC_class_t H5AC_FSPACE_SINFO[1] = {{
H5FS__cache_sinfo_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5FS__cache_sinfo_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -326,8 +320,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len)
{
const H5FS_t *fspace = (const H5FS_t *)_thing; /* Pointer to the object */
@@ -375,8 +368,7 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len,
*/
static herr_t
H5FS__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
- haddr_t addr, size_t H5_ATTR_UNUSED len, size_t H5_ATTR_UNUSED compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t H5_ATTR_UNUSED *new_compressed_len,
+ haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len,
unsigned *flags)
{
H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */
@@ -990,8 +982,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len)
{
const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; /* Pointer to the object */
const H5FS_t *fspace; /* Free space header */
@@ -1033,8 +1024,7 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len,
*/
static herr_t
H5FS__cache_sinfo_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
- haddr_t addr, size_t len, size_t H5_ATTR_UNUSED compressed_len, haddr_t *new_addr,
- size_t *new_len, size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags)
+ haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags)
{
H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */
H5FS_t *fspace; /* Free space header */
diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c
index 2592b90..d863159 100644
--- a/src/H5Fsuper_cache.c
+++ b/src/H5Fsuper_cache.c
@@ -70,13 +70,10 @@
static herr_t H5F__cache_superblock_get_load_size(const void *udata, size_t *image_len);
static void *H5F__cache_superblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5F__cache_superblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5F__cache_superblock_image_len(const void *thing, size_t *image_len);
static herr_t H5F__cache_superblock_pre_serialize(const H5F_t *f,
hid_t dxpl_id, void *thing, haddr_t addr, size_t len,
- size_t compressed_len, haddr_t *new_addr, size_t *new_len,
- size_t *new_compressed_len, unsigned *flags);
+ haddr_t *new_addr, size_t *new_len, unsigned *flags);
static herr_t H5F__cache_superblock_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5F__cache_superblock_free_icr(void *thing);
@@ -84,9 +81,7 @@ static herr_t H5F__cache_superblock_free_icr(void *thing);
static herr_t H5F__cache_drvrinfo_get_load_size(const void *udata, size_t *image_len);
static void *H5F__cache_drvrinfo_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5F__cache_drvrinfo_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5F__cache_drvrinfo_image_len(const void *thing, size_t *image_len);
static herr_t H5F__cache_drvrinfo_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
static herr_t H5F__cache_drvrinfo_free_icr(void *thing);
@@ -109,7 +104,6 @@ const H5AC_class_t H5AC_SUPERBLOCK[1] = {{
H5F__cache_superblock_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5F__cache_superblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -126,7 +120,6 @@ const H5AC_class_t H5AC_DRVRINFO[1] = {{
H5F__cache_drvrinfo_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5F__cache_drvrinfo_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -453,7 +446,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__cache_superblock_image_len(const void *_thing, size_t *image_len, hbool_t *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5F__cache_superblock_image_len(const void *_thing, size_t *image_len)
{
const H5F_super_t *sblock = (const H5F_super_t *)_thing; /* Pointer to the object */
@@ -464,14 +457,10 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len, hbool_t *
HDassert(sblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(sblock->cache_info.type == H5AC_SUPERBLOCK);
HDassert(image_len);
- HDassert(compressed_ptr);
/* Set the image length size */
*image_len = (size_t)H5F_SUPERBLOCK_SIZE(sblock);
- /* Set *compressed_ptr to FALSE unconditionally */
- *compressed_ptr = FALSE;
-
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5F__cache_superblock_image_len() */
@@ -511,8 +500,7 @@ H5F__cache_superblock_image_len(const void *_thing, size_t *image_len, hbool_t *
static herr_t
H5F__cache_superblock_pre_serialize(const H5F_t *f, hid_t dxpl_id,
void *_thing, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED len,
- size_t H5_ATTR_UNUSED compressed_len, haddr_t H5_ATTR_UNUSED *new_addr,
- size_t H5_ATTR_UNUSED *new_len, size_t H5_ATTR_UNUSED *new_compressed_len,
+ haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len,
unsigned H5_ATTR_UNUSED *flags)
{
H5P_genplist_t *dxpl = NULL; /* DXPL for setting ring */
@@ -909,8 +897,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len)
{
const H5O_drvinfo_t *drvinfo = (const H5O_drvinfo_t *)_thing; /* Pointer to the object */
@@ -921,7 +908,6 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len,
HDassert(drvinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(drvinfo->cache_info.type == H5AC_DRVRINFO);
HDassert(image_len);
- HDassert(compressed_ptr);
/* Set the image length size */
*image_len = (size_t)(H5F_DRVINFOBLOCK_HDR_SIZE + /* Fixed-size portion of driver info block */
diff --git a/src/H5Gcache.c b/src/H5Gcache.c
index e3303d1..c3e1c12 100644
--- a/src/H5Gcache.c
+++ b/src/H5Gcache.c
@@ -66,8 +66,7 @@
static herr_t H5G__cache_node_get_load_size(const void *udata, size_t *image_len);
static void *H5G__cache_node_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5G__cache_node_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5G__cache_node_image_len(const void *thing, size_t *image_len);
static herr_t H5G__cache_node_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5G__cache_node_free_icr(void *thing);
@@ -100,7 +99,6 @@ const H5AC_class_t H5AC_SNODE[1] = {{
H5G__cache_node_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5G__cache_node_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -241,8 +239,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G__cache_node_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5G__cache_node_image_len(const void *_thing, size_t *image_len)
{
const H5G_node_t *sym = (const H5G_node_t *)_thing; /* Pointer to object */
diff --git a/src/H5HFcache.c b/src/H5HFcache.c
index 3308f25..0e9485f 100644
--- a/src/H5HFcache.c
+++ b/src/H5HFcache.c
@@ -76,11 +76,9 @@ static herr_t H5HF__dtable_decode(H5F_t *f, const uint8_t **pp, H5HF_dtable_t *d
static herr_t H5HF__cache_hdr_get_load_size(const void *udata, size_t *image_len);
static void *H5HF__cache_hdr_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5HF__cache_hdr_image_len(const void *thing, size_t *image_len);
static herr_t H5HF__cache_hdr_pre_serialize(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len,
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len,
unsigned *flags);
static herr_t H5HF__cache_hdr_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
@@ -89,12 +87,9 @@ static herr_t H5HF__cache_hdr_free_icr(void *thing);
static herr_t H5HF__cache_iblock_get_load_size(const void *udata, size_t *image_len);
static void *H5HF__cache_iblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HF__cache_iblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5HF__cache_iblock_image_len(const void *thing, size_t *image_len);
static herr_t H5HF__cache_iblock_pre_serialize(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len,
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len,
unsigned *flags);
static herr_t H5HF__cache_iblock_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
@@ -104,12 +99,9 @@ static herr_t H5HF__cache_iblock_free_icr(void *thing);
static herr_t H5HF__cache_dblock_get_load_size(const void *udata, size_t *image_len);
static void *H5HF__cache_dblock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HF__cache_dblock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5HF__cache_dblock_image_len(const void *thing, size_t *image_len);
static herr_t H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id,
- void *thing, haddr_t addr, size_t len, size_t compressed_len,
- haddr_t *new_addr, size_t *new_len, size_t *new_compressed_len,
+ void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len,
unsigned *flags);
static herr_t H5HF__cache_dblock_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
@@ -146,7 +138,6 @@ const H5AC_class_t H5AC_FHEAP_HDR[1] = {{
H5HF__cache_hdr_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5HF__cache_hdr_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -163,7 +154,6 @@ const H5AC_class_t H5AC_FHEAP_IBLOCK[1] = {{
H5HF__cache_iblock_serialize, /* 'serialize' callback */
H5HF__cache_iblock_notify, /* 'notify' callback */
H5HF__cache_iblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -172,7 +162,7 @@ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{
H5AC_FHEAP_DBLOCK_ID, /* Metadata client ID */
"fractal heap direct block", /* Metadata client name (for debugging) */
H5FD_MEM_FHEAP_DBLOCK, /* File space memory type for client */
- H5C__CLASS_COMPRESSED_FLAG, /* Client class behavior flags */
+ H5AC__CLASS_NO_FLAGS_SET, /* Client class behavior flags */
H5HF__cache_dblock_get_load_size, /* 'get_load_size' callback */
H5HF__cache_dblock_deserialize, /* 'deserialize' callback */
H5HF__cache_dblock_image_len, /* 'image_len' callback */
@@ -180,7 +170,6 @@ const H5AC_class_t H5AC_FHEAP_DBLOCK[1] = {{
H5HF__cache_dblock_serialize, /* 'serialize' callback */
H5HF__cache_dblock_notify, /* 'notify' callback */
H5HF__cache_dblock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -578,8 +567,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len)
{
const H5HF_hdr_t *hdr = (const H5HF_hdr_t *)_thing; /* Fractal heap info */
@@ -619,9 +607,8 @@ H5HF__cache_hdr_image_len(const void *_thing, size_t *image_len,
*/
static herr_t
H5HF__cache_hdr_pre_serialize(const H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id,
- void *_thing, haddr_t addr, size_t len, size_t H5_ATTR_UNUSED compressed_len,
- haddr_t H5_ATTR_UNUSED *new_addr, size_t H5_ATTR_UNUSED *new_len,
- size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags)
+ void *_thing, haddr_t addr, size_t len, haddr_t H5_ATTR_UNUSED *new_addr,
+ size_t H5_ATTR_UNUSED *new_len, unsigned *flags)
{
H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */
herr_t ret_value = SUCCEED; /* Return value */
@@ -1083,8 +1070,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len)
{
const H5HF_indirect_t *iblock = (const H5HF_indirect_t *)_thing; /* Indirect block info */
@@ -1123,9 +1109,8 @@ H5HF__cache_iblock_image_len(const void *_thing, size_t *image_len,
*/
static herr_t
H5HF__cache_iblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
- haddr_t addr, size_t H5_ATTR_UNUSED len, size_t H5_ATTR_UNUSED compressed_len,
- haddr_t *new_addr, size_t H5_ATTR_UNUSED *new_len,
- size_t H5_ATTR_UNUSED *new_compressed_len, unsigned *flags)
+ haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr,
+ size_t H5_ATTR_UNUSED *new_len, unsigned *flags)
{
H5HF_hdr_t *hdr; /* Shared fractal heap information */
H5HF_indirect_t *iblock = (H5HF_indirect_t *)_thing; /* Indirect block info */
@@ -1494,10 +1479,6 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5HF__cache_iblock_free_icr() */
-/*********************************************************/
-/* metadata cache callback definitions for direct blocks */
-/*********************************************************/
-
/*-------------------------------------------------------------------------
* Function: H5HF__cache_dblock_get_load_size()
@@ -1752,14 +1733,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *compressed_ptr, size_t *compressed_image_len_ptr)
+H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len)
{
const H5HF_direct_t *dblock = (const H5HF_direct_t *)_thing; /* Direct block info */
- const H5HF_indirect_t *par_iblock; /* Parent iblock */
const H5HF_hdr_t *hdr; /* Shared fractal heap information */
- hbool_t compressed;
size_t size;
- size_t compressed_size;
FUNC_ENTER_STATIC_NOERR
@@ -1768,19 +1746,15 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
HDassert(dblock->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert(dblock->cache_info.type == H5AC_FHEAP_DBLOCK);
HDassert(image_len);
- HDassert(compressed_ptr);
- HDassert(compressed_image_len_ptr);
/* Set up convenience variables */
hdr = dblock->hdr;
- par_iblock = dblock->parent;
+ HDassert(hdr);
/* Check for I/O filters on this heap */
if(hdr->filter_len > 0) {
-
- /* Filters are enabled, so set compressed to TRUE, and set
- * size equal to the uncompressed size of the direct block.
- * If the data is available, set compressed_size to the compressed
+ /*
+ * If the data is available, set to the compressed
* size of the direct block -- otherwise set it equal to the
* uncompressed size.
*
@@ -1790,7 +1764,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
* case, both dblock->file_size and the size stored in the
* parent (either the header or the parent iblock) will all
* be zero. In this case, return the uncompressed size
- * stored in dblock->size as the compressed size.
+ * stored in dblock->size as the size.
*
* Second, the block may have just been serialized, in which
* case, dblock->file_size should be zero, and the correct
@@ -1804,42 +1778,26 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
* and thus looking up the parent will likely return incorrect
* data.
*/
- size = dblock->size;
- compressed = TRUE;
- compressed_size = dblock->size; /* will overwrite if compressed
- * size is available.
- */
-
if(dblock->file_size != 0)
- compressed_size = dblock->file_size;
+ size = dblock->file_size;
else {
- if(par_iblock) {
- unsigned par_entry; /* Entry in parent indirect block */
-
- par_entry = dblock->par_entry;
- compressed_size = par_iblock->filt_ents[par_entry].size;
+ const H5HF_indirect_t *par_iblock = dblock->parent; /* Parent iblock */
- } /* end if */
- else {
- compressed_size = hdr->pline_root_direct_size;
- }
-
- if(compressed_size == 0)
- compressed_size = dblock->size;
+ if(par_iblock)
+ size = par_iblock->filt_ents[dblock->par_entry].size;
+ else
+ size = hdr->pline_root_direct_size;
+ if(size == 0)
+ size = dblock->size;
} /* end else */
} /* end if */
- else {
+ else
size = dblock->size;
- compressed = FALSE;
- compressed_size = 0; /* a convenient, invalid value */
- }
+ /* Set the image size */
HDassert(size > 0);
-
- *image_len = size;
- *compressed_ptr = compressed;
- *compressed_image_len_ptr = compressed_size;
+ *image_len = size;
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HF__cache_dblock_image_len() */
@@ -1851,7 +1809,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
* Purpose: In principle, the purpose of this function is to determine
* the size and location of the disk image of the target direct
* block. In this case, the uncompressed size of the block is
- * fixed, but sined the H5C__CLASS_COMPRESSED_FLAG is set,
+ * fixed, but since the direct block could be compressed,
* we may need to compute and report the compressed size.
*
* This is a bit sticky in the case of a direct block when I/O
@@ -1863,8 +1821,8 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
*
* To complicate matters further, the direct block may have been
* initially allocated in temporary (AKA imaginary) file space.
- * In this case, we must relocate the direct block's on disk
- * image to real file space regardless of whether it has changed
+ * In this case, we must relocate the direct block's on-disk
+ * image to "real" file space regardless of whether it has changed
* size.
*
* One simplifying factor is the direct block's "blk" field,
@@ -1909,8 +1867,7 @@ H5HF__cache_dblock_image_len(const void *_thing, size_t *image_len, hbool_t *com
*/
static herr_t
H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr,
- size_t H5_ATTR_UNUSED *new_len, size_t *new_compressed_len, unsigned *flags)
+ haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags)
{
hbool_t at_tmp_addr; /* Flag to indicate direct block is */
/* at temporary address */
@@ -1936,18 +1893,14 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
HDassert(dblock->write_size == 0);
HDassert(dblock->cache_info.size == len);
HDassert(H5F_addr_defined(addr));
- HDassert(len == dblock->size);
HDassert(new_addr);
- HDassert(new_compressed_len);
+ HDassert(new_len);
HDassert(flags);
/* Set up local variables */
hdr = dblock->hdr;
dblock_addr = addr; /* will update dblock_addr if we move the block */
- /* dblock->size must match dblock->cache_info.size */
- HDassert(dblock->cache_info.size == dblock->size);
-
/* Set the shared heap header's file context for this operation */
hdr->f = (H5F_t *)f;
@@ -2035,9 +1988,10 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
/* Allocate buffer to perform I/O filtering on */
write_size = dblock->size;
-
if(NULL == (write_buf = H5MM_malloc(write_size)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline buffer")
+
+ /* Copy the direct block's image into the buffer to compress */
HDmemcpy(write_buf, dblock->blk, write_size);
/* Push direct block data through I/O filter pipeline */
@@ -2074,7 +2028,7 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
* size matches the heap's last record. This value will
* likely change shortly.
*/
- HDassert(compressed_len == hdr->pline_root_direct_size);
+ HDassert(len == hdr->pline_root_direct_size);
/* Check if we need to re-size the block on disk */
if(hdr->pline_root_direct_size != write_size || at_tmp_addr) {
@@ -2083,26 +2037,20 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
*
* (temp. file space does not need to be freed)
*/
- if(!at_tmp_addr) {
+ if(!at_tmp_addr)
/* Release direct block's current disk space */
if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)hdr->pline_root_direct_size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block")
- } /* end if */
/* Allocate space for the compressed direct block */
if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block")
- /* Let the metadata cache know, if the block moved */
- if(!H5F_addr_eq(hdr->man_dtable.table_addr, dblock_addr))
- if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock_addr, dxpl_id) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block")
-
/* Update information about compressed direct block's
* location & size
*/
HDassert(hdr->man_dtable.table_addr == addr);
- HDassert(hdr->pline_root_direct_size == compressed_len);
+ HDassert(hdr->pline_root_direct_size == len);
hdr->man_dtable.table_addr = dblock_addr;
hdr->pline_root_direct_size = write_size;
@@ -2132,7 +2080,7 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
* size matches the heap's last record. This value will
* likely change shortly.
*/
- HDassert(compressed_len == par_iblock->filt_ents[par_entry].size);
+ HDassert(len == par_iblock->filt_ents[par_entry].size);
/* Check if we need to re-size the block on disk */
if(par_iblock->filt_ents[par_entry].size != write_size || at_tmp_addr) {
@@ -2141,26 +2089,20 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
*
* (temp. file space does not need to be freed)
*/
- if(!at_tmp_addr) {
+ if(!at_tmp_addr)
/* Release direct block's current disk space */
if(H5MF_xfree(f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, addr, (hsize_t)par_iblock->filt_ents[par_entry].size) < 0)
HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to free fractal heap direct block")
- } /* end if */
/* Allocate space for the compressed direct block */
if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size)))
HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block")
- /* Let the metadata cache know, if the block moved */
- if(!H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr))
- if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, dblock_addr, dxpl_id) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block")
-
/* Update information about compressed direct block's
* location & size
*/
HDassert(par_iblock->ents[par_entry].addr == addr);
- HDassert(par_iblock->filt_ents[par_entry].size == compressed_len);
+ HDassert(par_iblock->filt_ents[par_entry].size == len);
par_iblock->ents[par_entry].addr = dblock_addr;
par_iblock->filt_ents[par_entry].size = write_size;
@@ -2192,22 +2134,16 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
* to 'normal' file space
*/
if(at_tmp_addr) {
+ /* Allocate 'normal' space for the direct block */
+ if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size)))
+ HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block")
+
/* Check for root direct block */
if(NULL == dblock->parent) {
- /* Sanity check */
+ /* Sanity checks */
HDassert(H5F_addr_eq(hdr->man_dtable.table_addr, addr));
-
- /* Allocate 'normal' space for the direct block */
- if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size)))
- HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block")
-
- /* Sanity check */
HDassert(!H5F_addr_eq(hdr->man_dtable.table_addr, dblock_addr));
- /* Let the metadata cache know the block moved */
- if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock_addr, dxpl_id) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block")
-
/* Update information about direct block's location */
hdr->man_dtable.table_addr = dblock_addr;
@@ -2216,22 +2152,12 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
HGOTO_ERROR(H5E_HEAP, H5E_CANTDIRTY, FAIL, "can't mark heap header as dirty")
} /* end if */
else { /* the direct block's parent is an indirect block */
- /* Sanity check */
+ /* Sanity checks */
HDassert(par_iblock);
HDassert(par_iblock->ents);
HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, addr));
-
- /* Allocate 'normal' space for the direct block */
- if(HADDR_UNDEF == (dblock_addr = H5MF_alloc((H5F_t *)f, H5FD_MEM_FHEAP_DBLOCK, dxpl_id, (hsize_t)write_size)))
- HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, FAIL, "file allocation failed for fractal heap direct block")
-
- /* Sanity check */
HDassert(!H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr));
- /* Let the metadata cache know the block moved */
- if(H5AC_move_entry((H5F_t *)f, H5AC_FHEAP_DBLOCK, par_iblock->ents[par_entry].addr, dblock_addr, dxpl_id) < 0)
- HGOTO_ERROR(H5E_HEAP, H5E_CANTMOVE, FAIL, "unable to move direct block")
-
/* Update information about direct block's location */
par_iblock->ents[par_entry].addr = dblock_addr;
@@ -2261,9 +2187,9 @@ H5HF__cache_dblock_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *_thing,
*new_addr = dblock_addr;
} /* end if */
- if((hdr->filter_len > 0) && (compressed_len != write_size)) {
- dblock_flags |= H5C__SERIALIZE_COMPRESSED_FLAG;
- *new_compressed_len = write_size;
+ if((hdr->filter_len > 0) && (len != write_size)) {
+ dblock_flags |= H5C__SERIALIZE_RESIZED_FLAG;
+ *new_len = write_size;
} /* end if */
*flags = dblock_flags;
diff --git a/src/H5HGcache.c b/src/H5HGcache.c
index c1eb8d9..b01f30e 100644
--- a/src/H5HGcache.c
+++ b/src/H5HGcache.c
@@ -65,8 +65,7 @@
static herr_t H5HG__cache_heap_get_load_size(const void *udata, size_t *image_len);
static void *H5HG__cache_heap_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5HG__cache_heap_image_len(const void *thing, size_t *image_len);
static herr_t H5HG__cache_heap_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5HG__cache_heap_free_icr(void *thing);
@@ -89,7 +88,6 @@ const H5AC_class_t H5AC_GHEAP[1] = {{
H5HG__cache_heap_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5HG__cache_heap_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -331,8 +329,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HG__cache_heap_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5HG__cache_heap_image_len(const void *_thing, size_t *image_len)
{
const H5HG_heap_t *heap = (const H5HG_heap_t *)_thing;
diff --git a/src/H5HLcache.c b/src/H5HLcache.c
index 95ab65d..5697121 100644
--- a/src/H5HLcache.c
+++ b/src/H5HLcache.c
@@ -74,9 +74,7 @@
static herr_t H5HL__cache_prefix_get_load_size(const void *udata, size_t *image_len);
static void *H5HL__cache_prefix_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HL__cache_prefix_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5HL__cache_prefix_image_len(const void *thing, size_t *image_len);
static herr_t H5HL__cache_prefix_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5HL__cache_prefix_free_icr(void *thing);
@@ -86,9 +84,7 @@ static herr_t H5HL__cache_datablock_get_load_size(const void *udata,
size_t *image_len);
static void *H5HL__cache_datablock_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5HL__cache_datablock_image_len(const void *thing,
- size_t *image_len, hbool_t *compressed_ptr,
- size_t *compressed_image_len_ptr);
+static herr_t H5HL__cache_datablock_image_len(const void *thing, size_t *image_len);
static herr_t H5HL__cache_datablock_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5HL__cache_datablock_free_icr(void *thing);
@@ -114,7 +110,6 @@ const H5AC_class_t H5AC_LHEAP_PRFX[1] = {{
H5HL__cache_prefix_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5HL__cache_prefix_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -130,7 +125,6 @@ const H5AC_class_t H5AC_LHEAP_DBLK[1] = {{
H5HL__cache_datablock_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5HL__cache_datablock_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -455,8 +449,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len)
{
const H5HL_prfx_t *prfx = (const H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */
@@ -480,10 +473,6 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HL__cache_prefix_image_len() */
-/****************************************/
-/* no H5HL_cache_prefix_pre_serialize() */
-/****************************************/
-
/*-------------------------------------------------------------------------
* Function: H5HL__cache_prefix_serialize
@@ -746,8 +735,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len)
{
const H5HL_dblk_t *dblk = (const H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */
@@ -766,10 +754,6 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5HL__cache_datablock_image_len() */
-/*******************************************/
-/* no H5HL_cache_datablock_pre_serialize() */
-/*******************************************/
-
/*-------------------------------------------------------------------------
* Function: H5HL__cache_datablock_serialize
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index f1a128d..edabc52 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -71,22 +71,20 @@
static herr_t H5O__cache_get_load_size(const void *udata, size_t *image_len);
static void *H5O__cache_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5O__cache_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5O__cache_image_len(const void *thing, size_t *image_len);
static herr_t H5O__cache_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
+static herr_t H5O__cache_notify(H5AC_notify_action_t action, void *_thing);
static herr_t H5O__cache_free_icr(void *thing);
-static herr_t H5O__cache_clear(const H5F_t *f, void *thing, hbool_t about_to_destroy);
static herr_t H5O__cache_chk_get_load_size(const void *udata, size_t *image_len);
static void *H5O__cache_chk_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5O__cache_chk_image_len(const void *thing, size_t *image_len);
static herr_t H5O__cache_chk_serialize(const H5F_t *f, void *image, size_t len,
void *thing);
+static herr_t H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing);
static herr_t H5O__cache_chk_free_icr(void *thing);
-static herr_t H5O__cache_chk_clear(const H5F_t *f, void *thing, hbool_t about_to_destroy);
/* Chunk routines */
static herr_t H5O__chunk_deserialize(H5O_t *oh, haddr_t addr, size_t len,
@@ -114,9 +112,8 @@ const H5AC_class_t H5AC_OHDR[1] = {{
H5O__cache_image_len, /* 'image_len' callback */
NULL, /* 'pre_serialize' callback */
H5O__cache_serialize, /* 'serialize' callback */
- NULL, /* 'notify' callback */
+ H5O__cache_notify, /* 'notify' callback */
H5O__cache_free_icr, /* 'free_icr' callback */
- H5O__cache_clear, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -131,9 +128,8 @@ const H5AC_class_t H5AC_OHDR_CHK[1] = {{
H5O__cache_chk_image_len, /* 'image_len' callback */
NULL, /* 'pre_serialize' callback */
H5O__cache_chk_serialize, /* 'serialize' callback */
- NULL, /* 'notify' callback */
+ H5O__cache_chk_notify, /* 'notify' callback */
H5O__cache_chk_free_icr, /* 'free_icr' callback */
- H5O__cache_chk_clear, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -165,7 +161,8 @@ H5FL_SEQ_DEFINE(H5O_cont_t);
*
* Return: Non-negative on success/Negative on failure
*
- * Programmer: Vailin Choi; Aug 2015
+ * Programmer: Vailin Choi
+ * Aug 2015
*
*-------------------------------------------------------------------------
*/
@@ -174,7 +171,6 @@ H5O_decode_prefix(H5F_t *f, H5O_t *oh, const uint8_t *buf, void *_udata)
{
H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */
const uint8_t *p = buf; /* Pointer into buffer to decode */
- size_t prefix_size; /* Size of object header prefix */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -292,8 +288,7 @@ H5O_decode_prefix(H5F_t *f, H5O_t *oh, const uint8_t *buf, void *_udata)
} /* end else */
/* Determine object header prefix length */
- prefix_size = (size_t)(p - buf);
- HDassert((size_t)prefix_size == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
+ HDassert((size_t)(p - buf) == (size_t)(H5O_SIZEOF_HDR(oh) - H5O_SIZEOF_CHKSUM_OH(oh)));
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -431,8 +426,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__cache_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5O__cache_image_len(const void *_thing, size_t *image_len)
{
const H5O_t *oh = (const H5O_t *)_thing; /* Object header to query */
@@ -453,10 +447,6 @@ H5O__cache_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__cache_image_len() */
-/********************************/
-/* no H5O_cache_pre_serialize() */
-/********************************/
-
/*-------------------------------------------------------------------------
* Function: H5O__cache_serialize
@@ -600,123 +590,111 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__cache_serialize() */
-/**********************************/
-/* no H5O_cache_notify() function */
-/**********************************/
-
/*-------------------------------------------------------------------------
- * Function: H5O__cache_free_icr
+ * Function: H5O__cache_notify
*
- * Purpose: Free the in core representation of the supplied object header.
+ * Purpose: Handle cache action notifications
*
- * Note: The metadata cache sets the object's cache_info.magic to
- * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr
- * callback (checked in assert).
+ * Return: Non-negative on success/Negative on failure
*
- * Return: Success: SUCCEED
- * Failure: FAIL
- *
- * Programmer: John Mainzer
- * 7/28/14
+ * Programmer: Quincey Koziol
+ * Jul 23 2016
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__cache_free_icr(void *_thing)
-{
- H5O_t *oh = (H5O_t *)_thing; /* Object header to destroy */
- herr_t ret_value = SUCCEED; /* Return value */
+H5O__cache_notify(H5AC_notify_action_t action, void *_thing)
+{
+ H5O_t *oh = (H5O_t *)_thing;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
- /* Check arguments */
+ /*
+ * Check arguments.
+ */
HDassert(oh);
- HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
- HDassert(oh->cache_info.type == H5AC_OHDR);
- /* Destroy object header */
- if(H5O__free(oh) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header")
+ switch(action) {
+ case H5AC_NOTIFY_ACTION_AFTER_INSERT:
+ case H5AC_NOTIFY_ACTION_AFTER_LOAD:
+ case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
+ case H5AC_NOTIFY_ACTION_ENTRY_DIRTIED:
+ /* do nothing */
+ break;
+
+ case H5AC_NOTIFY_ACTION_ENTRY_CLEANED:
+ {
+ unsigned u; /* Local index variable */
+
+ /* Mark messages stored with the object header (i.e. messages in chunk 0) as clean */
+ for(u = 0; u < oh->nmesgs; u++)
+ if(oh->mesg[u].chunkno == 0)
+ oh->mesg[u].dirty = FALSE;
+#ifndef NDEBUG
+ /* Reset the number of messages dirtied by decoding */
+ oh->ndecode_dirtied = 0;
+#endif /* NDEBUG */
+ }
+ break;
+
+ case H5AC_NOTIFY_ACTION_CHILD_DIRTIED:
+ case H5AC_NOTIFY_ACTION_CHILD_CLEANED:
+ case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
+ /* do nothing */
+ break;
+
+ default:
+#ifdef NDEBUG
+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
+#else /* NDEBUG */
+ HDassert(0 && "Unknown action?!?");
+#endif /* NDEBUG */
+ } /* end switch */
done:
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O__cache_free_icr() */
+} /* end H5O__cache_notify() */
/*-------------------------------------------------------------------------
- * Function: H5O__cache_clear
- *
- * Purpose: Clear all dirty bits associated with this cache entry.
+ * Function: H5O__cache_free_icr
*
- * This is ncessary as the object header cache client maintains
- * its own dirty bits on individual messages. These dirty bits
- * used to be cleared by the old V2 metadata cache flush callback,
- * but now the metadata cache must clear them explicitly, as
- * the serialize callback does not imply that the data has been
- * written to disk.
+ * Purpose: Free the in core representation of the supplied object header.
*
- * This callback is also necessary for the parallel case.
+ * Note: The metadata cache sets the object's cache_info.magic to
+ * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr
+ * callback (checked in assert).
*
* Return: Success: SUCCEED
* Failure: FAIL
*
* Programmer: John Mainzer
- * 9/22/14
+ * 7/28/14
*
*-------------------------------------------------------------------------
*/
static herr_t
-#ifdef H5_HAVE_PARALLEL
-H5O__cache_clear(const H5F_t *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy)
-#else
-H5O__cache_clear(const H5F_t H5_ATTR_UNUSED *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy)
-#endif /* H5_HAVE_PARALLEL */
+H5O__cache_free_icr(void *_thing)
{
- H5O_t *oh = (H5O_t *)_thing; /* Object header to reset */
- unsigned u; /* Local index variable */
+ H5O_t *oh = (H5O_t *)_thing; /* Object header to destroy */
herr_t ret_value = SUCCEED; /* Return value */
-#ifdef H5_HAVE_PARALLEL
FUNC_ENTER_STATIC
-#else
- FUNC_ENTER_STATIC_NOERR
-#endif /* H5_HAVE_PARALLEL */
/* Check arguments */
HDassert(oh);
- HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(oh->cache_info.type == H5AC_OHDR);
-#ifdef H5_HAVE_PARALLEL
- if((oh->nchunks > 0) && (!about_to_destroy)) {
- /* Scan through chunk 0 (the chunk stored contiguously with this
- * object header) and cause it to update its image of all entries
- * currently marked dirty. Must do this in the parallel case, as
- * it is possible that this processor may clear this object header
- * several times before flushing it -- thus causing undefined
- * sections of the image to be written to disk overwriting valid data.
- */
- if(H5O__chunk_serialize(f, oh, 0) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk")
- } /* end if */
-#endif /* H5_HAVE_PARALLEL */
-
- /* Mark messages stored with the object header (i.e. messages in chunk 0) as clean */
- for(u = 0; u < oh->nmesgs; u++)
- if(oh->mesg[u].chunkno == 0)
- oh->mesg[u].dirty = FALSE;
-
-#ifndef NDEBUG
- /* Reset the number of messages dirtied by decoding */
- oh->ndecode_dirtied = 0;
-#endif /* NDEBUG */
+ /* Destroy object header */
+ if(H5O__free(oh) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't destroy object header")
-#ifdef H5_HAVE_PARALLEL
done:
-#endif /* H5_HAVE_PARALLEL */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O__cache_clear() */
+} /* end H5O__cache_free_icr() */
/*-------------------------------------------------------------------------
@@ -848,8 +826,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__cache_chk_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5O__cache_chk_image_len(const void *_thing, size_t *image_len)
{
const H5O_chunk_proxy_t * chk_proxy = (const H5O_chunk_proxy_t *)_thing; /* Chunk proxy to query */
@@ -867,10 +844,6 @@ H5O__cache_chk_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O__cache_chk_image_len() */
-/************************************/
-/* no H5O_cache_chk_pre_serialize() */
-/************************************/
-
/*-------------------------------------------------------------------------
* Function: H5O__cache_chk_serialize
@@ -918,116 +891,115 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O__cache_chk_serialize() */
-/**************************************/
-/* no H5O_cache_chk_notify() function */
-/**************************************/
-
/*-------------------------------------------------------------------------
- * Function: H5O__cache_chk_free_icr
+ * Function: H5O__cache_chk_notify
*
- * Purpose: Free the in core memory associated with the supplied object
- * header continuation chunk.
+ * Purpose: Handle cache action notifications
*
- * Note: The metadata cache sets the object's cache_info.magic to
- * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr
- * callback (checked in assert).
- *
- * Return: Success: SUCCEED
- * Failure: FAIL
+ * Return: Non-negative on success/Negative on failure
*
- * Programmer: John Mainzer
- * 7/28/14
+ * Programmer: Neil Fortner
+ * Mar 20 2012
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5O__cache_chk_free_icr(void *_thing)
+H5O__cache_chk_notify(H5AC_notify_action_t action, void *_thing)
{
- H5O_chunk_proxy_t * chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk proxy to release */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing;
+ void *parent = NULL; /* Chunk containing continuation message that points to this chunk */
+ H5O_chunk_proxy_t *cont_chk_proxy = NULL; /* Proxy for chunk containing continuation message that points to this chunk, if not chunk 0 */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_STATIC
- /* Check arguments */
+ /*
+ * Check arguments.
+ */
HDassert(chk_proxy);
- HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
- HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK);
+ HDassert(chk_proxy->oh);
- /* Destroy object header chunk proxy */
- if(H5O__chunk_dest(chk_proxy) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy")
+ switch(action) {
+ case H5AC_NOTIFY_ACTION_AFTER_INSERT:
+ case H5AC_NOTIFY_ACTION_AFTER_LOAD:
+ case H5AC_NOTIFY_ACTION_AFTER_FLUSH:
+ case H5AC_NOTIFY_ACTION_ENTRY_DIRTIED:
+ /* do nothing */
+ break;
+
+ case H5AC_NOTIFY_ACTION_ENTRY_CLEANED:
+ {
+ unsigned u; /* Local index variable */
+
+ /* Mark messages in chunk as clean */
+ for(u = 0; u < chk_proxy->oh->nmesgs; u++)
+ if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno)
+ chk_proxy->oh->mesg[u].dirty = FALSE;
+ }
+ break;
+
+ case H5AC_NOTIFY_ACTION_CHILD_DIRTIED:
+ case H5AC_NOTIFY_ACTION_CHILD_CLEANED:
+ case H5AC_NOTIFY_ACTION_BEFORE_EVICT:
+ /* do nothing */
+ break;
+
+ default:
+#ifdef NDEBUG
+ HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, FAIL, "unknown action from metadata cache")
+#else /* NDEBUG */
+ HDassert(0 && "Unknown action?!?");
+#endif /* NDEBUG */
+ } /* end switch */
done:
+ if(cont_chk_proxy)
+ if(H5O_chunk_unprotect(chk_proxy->f, H5AC_ind_read_dxpl_id, cont_chk_proxy, FALSE) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to unprotect object header chunk")
+
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O__cache_chk_free_icr() */
+} /* end H5O__cache_chk_notify() */
/*-------------------------------------------------------------------------
- * Function: H5O__cache_chk_clear
- *
- * Purpose: Clear all dirty bits associated with this cache entry.
+ * Function: H5O__cache_chk_free_icr
*
- * This is ncessary as the object header cache client maintains
- * its own dirty bits on individual messages. These dirty bits
- * used to be cleared by the old V2 metadata cache flush callback,
- * but now the metadata cache must clear them explicitly, as
- * the serialize callback does not imply that the data has been
- * written to disk.
+ * Purpose: Free the in core memory associated with the supplied object
+ * header continuation chunk.
*
- * This callback is also necessary for the parallel case.
+ * Note: The metadata cache sets the object's cache_info.magic to
+ * H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC before calling a free_icr
+ * callback (checked in assert).
*
* Return: Success: SUCCEED
* Failure: FAIL
*
* Programmer: John Mainzer
- * 9/22/14
+ * 7/28/14
*
*-------------------------------------------------------------------------
*/
static herr_t
-#ifdef H5_HAVE_PARALLEL
-H5O__cache_chk_clear(const H5F_t *f, void *_thing, hbool_t about_to_destroy)
-#else
-H5O__cache_chk_clear(const H5F_t H5_ATTR_UNUSED *f, void *_thing, hbool_t H5_ATTR_UNUSED about_to_destroy)
-#endif /* H5_HAVE_PARALLEL */
-{
- H5O_chunk_proxy_t *chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk to reset */
- H5O_t *oh; /* Object header for chunk */
- unsigned u; /* Local index variable */
+H5O__cache_chk_free_icr(void *_thing)
+{
+ H5O_chunk_proxy_t * chk_proxy = (H5O_chunk_proxy_t *)_thing; /* Object header chunk proxy to release */
herr_t ret_value = SUCCEED; /* Return value */
-#ifdef H5_HAVE_PARALLEL
FUNC_ENTER_STATIC
-#else
- FUNC_ENTER_STATIC_NOERR
-#endif /* H5_HAVE_PARALLEL */
/* Check arguments */
HDassert(chk_proxy);
- HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+ HDassert(chk_proxy->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC);
HDassert(chk_proxy->cache_info.type == H5AC_OHDR_CHK);
- oh = chk_proxy->oh;
- HDassert(oh);
- HDassert(oh->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
- HDassert(oh->cache_info.type == H5AC_OHDR);
-
-#ifdef H5_HAVE_PARALLEL
- if((chk_proxy->oh->cache_info.is_dirty) && (!about_to_destroy))
- if(H5O__chunk_serialize(f, chk_proxy->oh, chk_proxy->chunkno) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTSERIALIZE, FAIL, "unable to serialize object header chunk")
-#endif /* H5_HAVE_PARALLEL */
- /* Mark messages in chunk as clean */
- for(u = 0; u < chk_proxy->oh->nmesgs; u++)
- if(chk_proxy->oh->mesg[u].chunkno == chk_proxy->chunkno)
- chk_proxy->oh->mesg[u].dirty = FALSE;
+ /* Destroy object header chunk proxy */
+ if(H5O__chunk_dest(chk_proxy) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to destroy object header chunk proxy")
-#ifdef H5_HAVE_PARALLEL
done:
-#endif /* H5_HAVE_PARALLEL */
FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5O__cache_chk_clear() */
+} /* end H5O__cache_chk_free_icr() */
/*-------------------------------------------------------------------------
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index 4de86e2..26db5d3 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -61,8 +61,7 @@
static herr_t H5SM__cache_table_get_load_size(const void *udata, size_t *image_len);
static void *H5SM__cache_table_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5SM__cache_table_image_len(const void *thing, size_t *image_len);
static herr_t H5SM__cache_table_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5SM__cache_table_free_icr(void *thing);
@@ -70,8 +69,7 @@ static herr_t H5SM__cache_table_free_icr(void *thing);
static herr_t H5SM__cache_list_get_load_size(const void *udata, size_t *image_len);
static void *H5SM__cache_list_deserialize(const void *image, size_t len,
void *udata, hbool_t *dirty);
-static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len,
- hbool_t *compressed_ptr, size_t *compressed_image_len_ptr);
+static herr_t H5SM__cache_list_image_len(const void *thing, size_t *image_len);
static herr_t H5SM__cache_list_serialize(const H5F_t *f, void *image,
size_t len, void *thing);
static herr_t H5SM__cache_list_free_icr(void *thing);
@@ -94,7 +92,6 @@ const H5AC_class_t H5AC_SOHM_TABLE[1] = {{
H5SM__cache_table_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5SM__cache_table_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -110,7 +107,6 @@ const H5AC_class_t H5AC_SOHM_LIST[1] = {{
H5SM__cache_list_serialize, /* 'serialize' callback */
NULL, /* 'notify' callback */
H5SM__cache_list_free_icr, /* 'free_icr' callback */
- NULL, /* 'clear' callback */
NULL, /* 'fsf_size' callback */
}};
@@ -301,8 +297,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5SM__cache_table_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5SM__cache_table_image_len(const void *_thing, size_t *image_len)
{
const H5SM_master_table_t *table = (const H5SM_master_table_t *)_thing; /* Shared message table to query */
@@ -319,10 +314,6 @@ H5SM__cache_table_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5SM__cache_table_image_len() */
-/***************************************/
-/* no H5SM_cache_table_pre_serialize() */
-/***************************************/
-
/*-------------------------------------------------------------------------
* Function: H5SM__cache_table_serialize
@@ -591,8 +582,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5SM__cache_list_image_len(const void *_thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_image_len_ptr)
+H5SM__cache_list_image_len(const void *_thing, size_t *image_len)
{
const H5SM_list_t *list = (const H5SM_list_t *)_thing; /* Shared message list to query */
@@ -610,10 +600,6 @@ H5SM__cache_list_image_len(const void *_thing, size_t *image_len,
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5SM__cache_list_image_len() */
-/**************************************/
-/* no H5SM_cache_list_pre_serialize() */
-/**************************************/
-
/*-------------------------------------------------------------------------
* Function: H5SM__cache_list_serialize
diff --git a/test/cache_common.c b/test/cache_common.c
index 94034eb..4bea2a8 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -111,62 +111,51 @@ static void *variable_deserialize(const void *image_ptr, size_t len, void *udata
static void *notify_deserialize(const void *image_ptr, size_t len, void *udata_ptr,
hbool_t *dirty_ptr);
-static herr_t pico_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t nano_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t micro_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t tiny_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t small_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t medium_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t large_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t huge_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t monster_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t variable_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
-static herr_t notify_image_len(void *thing, size_t *image_len_ptr,
- hbool_t *compressed_ptr, size_t * compressed_len_ptr);
+static herr_t pico_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t nano_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t micro_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t tiny_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t small_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t medium_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t large_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t huge_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t monster_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t variable_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t notify_image_len(const void *thing, size_t *image_len_ptr);
static herr_t pico_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t nano_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t micro_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t tiny_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t small_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t medium_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t large_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t huge_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t monster_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t variable_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t notify_pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
- haddr_t addr, size_t len, size_t compressed_len, haddr_t *new_addr_ptr,
- size_t *new_len_ptr, size_t *new_compressed_len_ptr, unsigned *flags_ptr);
+ haddr_t addr, size_t len, haddr_t *new_addr_ptr,
+ size_t *new_len_ptr, unsigned *flags_ptr);
static herr_t pico_serialize(const H5F_t *f, void *image_ptr,
size_t len, void *thing);
@@ -214,7 +203,7 @@ static herr_t get_load_size(const void *udata_ptr, size_t *image_len_ptr,
int32_t entry_type);
static void *deserialize(const void *image_ptr, size_t len, void *udata_ptr,
hbool_t *dirty_ptr, int32_t entry_type);
-static herr_t image_len(void *thing, size_t *image_len_ptr, int32_t entry_type);
+static herr_t image_len(const void *thing, size_t *image_len_ptr, int32_t entry_type);
static herr_t pre_serialize(const H5F_t *f, hid_t dxpl_id, void *thing,
haddr_t addr, size_t len, haddr_t *new_addr_ptr, size_t *new_len_ptr,
unsigned *flags_ptr);
@@ -317,165 +306,154 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
"pico_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)pico_get_load_size,
- (H5C_deserialize_func_t)pico_deserialize,
- (H5C_image_len_func_t)pico_image_len,
- (H5AC_pre_serialize_func_t)pico_pre_serialize,
- (H5C_serialize_func_t)pico_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)pico_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ pico_get_load_size,
+ pico_deserialize,
+ pico_image_len,
+ pico_pre_serialize,
+ pico_serialize,
+ NULL,
+ pico_free_icr,
+ NULL,
},
{
NANO_ENTRY_TYPE,
"nano_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)nano_get_load_size,
- (H5C_deserialize_func_t)nano_deserialize,
- (H5C_image_len_func_t)nano_image_len,
- (H5AC_pre_serialize_func_t)nano_pre_serialize,
- (H5C_serialize_func_t)nano_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)nano_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ nano_get_load_size,
+ nano_deserialize,
+ nano_image_len,
+ nano_pre_serialize,
+ nano_serialize,
+ NULL,
+ nano_free_icr,
+ NULL,
},
{
MICRO_ENTRY_TYPE,
"micro_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)micro_get_load_size,
- (H5C_deserialize_func_t)micro_deserialize,
- (H5C_image_len_func_t)micro_image_len,
- (H5AC_pre_serialize_func_t)micro_pre_serialize,
- (H5C_serialize_func_t)micro_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)micro_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ micro_get_load_size,
+ micro_deserialize,
+ micro_image_len,
+ micro_pre_serialize,
+ micro_serialize,
+ NULL,
+ micro_free_icr,
+ NULL,
},
{
TINY_ENTRY_TYPE,
"tiny_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)tiny_get_load_size,
- (H5C_deserialize_func_t)tiny_deserialize,
- (H5C_image_len_func_t)tiny_image_len,
- (H5AC_pre_serialize_func_t)tiny_pre_serialize,
- (H5C_serialize_func_t)tiny_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)tiny_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ tiny_get_load_size,
+ tiny_deserialize,
+ tiny_image_len,
+ tiny_pre_serialize,
+ tiny_serialize,
+ NULL,
+ tiny_free_icr,
+ NULL,
},
{
SMALL_ENTRY_TYPE,
"small_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)small_get_load_size,
- (H5C_deserialize_func_t)small_deserialize,
- (H5C_image_len_func_t)small_image_len,
- (H5AC_pre_serialize_func_t)small_pre_serialize,
- (H5C_serialize_func_t)small_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)small_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ small_get_load_size,
+ small_deserialize,
+ small_image_len,
+ small_pre_serialize,
+ small_serialize,
+ NULL,
+ small_free_icr,
+ NULL,
},
{
MEDIUM_ENTRY_TYPE,
"medium_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)medium_get_load_size,
- (H5C_deserialize_func_t)medium_deserialize,
- (H5C_image_len_func_t)medium_image_len,
- (H5AC_pre_serialize_func_t)medium_pre_serialize,
- (H5C_serialize_func_t)medium_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)medium_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ medium_get_load_size,
+ medium_deserialize,
+ medium_image_len,
+ medium_pre_serialize,
+ medium_serialize,
+ NULL,
+ medium_free_icr,
+ NULL,
},
{
LARGE_ENTRY_TYPE,
"large_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)large_get_load_size,
- (H5C_deserialize_func_t)large_deserialize,
- (H5C_image_len_func_t)large_image_len,
- (H5AC_pre_serialize_func_t)large_pre_serialize,
- (H5C_serialize_func_t)large_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)large_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ large_get_load_size,
+ large_deserialize,
+ large_image_len,
+ large_pre_serialize,
+ large_serialize,
+ NULL,
+ large_free_icr,
+ NULL,
},
{
HUGE_ENTRY_TYPE,
"huge_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)huge_get_load_size,
- (H5C_deserialize_func_t)huge_deserialize,
- (H5C_image_len_func_t)huge_image_len,
- (H5AC_pre_serialize_func_t)huge_pre_serialize,
- (H5C_serialize_func_t)huge_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)huge_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ huge_get_load_size,
+ huge_deserialize,
+ huge_image_len,
+ huge_pre_serialize,
+ huge_serialize,
+ NULL,
+ huge_free_icr,
+ NULL,
},
{
MONSTER_ENTRY_TYPE,
"monster_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)monster_get_load_size,
- (H5C_deserialize_func_t)monster_deserialize,
- (H5C_image_len_func_t)monster_image_len,
- (H5AC_pre_serialize_func_t)monster_pre_serialize,
- (H5C_serialize_func_t)monster_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)monster_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ monster_get_load_size,
+ monster_deserialize,
+ monster_image_len,
+ monster_pre_serialize,
+ monster_serialize,
+ NULL,
+ monster_free_icr,
+ NULL,
},
{
VARIABLE_ENTRY_TYPE,
"variable_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_SPECULATIVE_LOAD_FLAG,
- (H5C_get_load_size_func_t)variable_get_load_size,
- (H5C_deserialize_func_t)variable_deserialize,
- (H5C_image_len_func_t)variable_image_len,
- (H5AC_pre_serialize_func_t)variable_pre_serialize,
- (H5C_serialize_func_t)variable_serialize,
- (H5C_notify_func_t)NULL,
- (H5C_free_icr_func_t)variable_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ variable_get_load_size,
+ variable_deserialize,
+ variable_image_len,
+ variable_pre_serialize,
+ variable_serialize,
+ NULL,
+ variable_free_icr,
+ NULL,
},
{
NOTIFY_ENTRY_TYPE,
"notify_entry",
H5FD_MEM_DEFAULT,
H5C__CLASS_NO_FLAGS_SET,
- (H5C_get_load_size_func_t)notify_get_load_size,
- (H5C_deserialize_func_t)notify_deserialize,
- (H5C_image_len_func_t)notify_image_len,
- (H5AC_pre_serialize_func_t)notify_pre_serialize,
- (H5C_serialize_func_t)notify_serialize,
- (H5C_notify_func_t)notify_notify,
- (H5C_free_icr_func_t)notify_free_icr,
- (H5C_clear_func_t)NULL,
- (H5C_get_fsf_size_t)NULL,
+ notify_get_load_size,
+ notify_deserialize,
+ notify_image_len,
+ notify_pre_serialize,
+ notify_serialize,
+ notify_notify,
+ notify_free_icr,
+ NULL,
}
};
@@ -872,9 +850,9 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty)
*-------------------------------------------------------------------------
*/
herr_t
-image_len(void *thing, size_t *image_length, int32_t entry_type)
+image_len(const void *thing, size_t *image_length, int32_t entry_type)
{
- test_entry_t *entry;
+ const test_entry_t *entry;
test_entry_t *base_addr;
int32_t type;
int32_t idx;
@@ -882,7 +860,7 @@ image_len(void *thing, size_t *image_length, int32_t entry_type)
HDassert(thing);
HDassert(image_length);
- entry = (test_entry_t *)thing;
+ entry = (const test_entry_t *)thing;
HDassert(entry->self == entry);
@@ -909,78 +887,67 @@ image_len(void *thing, size_t *image_length, int32_t entry_type)
} /* image_len() */
herr_t
-pico_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+pico_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, PICO_ENTRY_TYPE);
}
herr_t
-nano_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+nano_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, NANO_ENTRY_TYPE);
}
herr_t
-micro_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+micro_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, MICRO_ENTRY_TYPE);
}
herr_t
-tiny_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+tiny_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, TINY_ENTRY_TYPE);
}
herr_t
-small_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+small_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, SMALL_ENTRY_TYPE);
}
herr_t
-medium_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+medium_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, MEDIUM_ENTRY_TYPE);
}
herr_t
-large_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+large_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, LARGE_ENTRY_TYPE);
}
herr_t
-huge_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+huge_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, HUGE_ENTRY_TYPE);
}
herr_t
-monster_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+monster_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, MONSTER_ENTRY_TYPE);
}
herr_t
-variable_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+variable_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, VARIABLE_ENTRY_TYPE);
}
herr_t
-notify_image_len(void *thing, size_t *image_length,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+notify_image_len(const void *thing, size_t *image_length)
{
return image_len(thing, image_length, NOTIFY_ENTRY_TYPE);
}
@@ -1095,10 +1062,8 @@ pico_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1111,10 +1076,8 @@ nano_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1127,10 +1090,8 @@ micro_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1143,10 +1104,8 @@ tiny_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1159,10 +1118,8 @@ small_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1175,10 +1132,8 @@ medium_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1191,10 +1146,8 @@ large_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1207,10 +1160,8 @@ huge_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1223,10 +1174,8 @@ monster_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1239,10 +1188,8 @@ variable_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
@@ -1255,10 +1202,8 @@ notify_pre_serialize(const H5F_t *f,
void *thing,
haddr_t addr,
size_t len,
- size_t H5_ATTR_UNUSED compressed_len,
haddr_t *new_addr_ptr,
size_t *new_len_ptr,
- size_t H5_ATTR_UNUSED *new_compressed_len_ptr,
unsigned *flags_ptr)
{
return pre_serialize(f, dxpl_id, thing, addr, len,
diff --git a/test/earray.c b/test/earray.c
index 44d16c5..17daefd 100644
--- a/test/earray.c
+++ b/test/earray.c
@@ -163,22 +163,11 @@ typedef struct earray_test_t {
static herr_t earray_cache_test_get_load_size(const void *udata_ptr,
size_t *image_len_ptr);
-
-static void *earray_cache_test_deserialize(const void *image_ptr,
- size_t len,
- void *udata_ptr,
- hbool_t *dirty_ptr);
-
-static herr_t earray_cache_test_image_len(const void *thing,
- size_t *image_len_ptr,
- hbool_t *compressed_ptr,
- size_t * compressed_len_ptr);
-
-static herr_t earray_cache_test_serialize(const H5F_t *f,
- void *image_ptr,
- size_t len,
- void *thing);
-
+static void *earray_cache_test_deserialize(const void *image_ptr, size_t len,
+ void *udata_ptr, hbool_t *dirty_ptr);
+static herr_t earray_cache_test_image_len(const void *thing, size_t *image_len_ptr);
+static herr_t earray_cache_test_serialize(const H5F_t *f, void *image_ptr,
+ size_t len, void *thing);
static herr_t earray_cache_test_free_icr(void *thing);
@@ -201,14 +190,13 @@ const H5AC_class_t H5AC_EARRAY_TEST[1] = {{
/* name */ "earray test",
/* mem_type */ H5FD_MEM_DEFAULT,
/* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES,
- /* get_load_size */ (H5AC_get_load_size_func_t)earray_cache_test_get_load_size,
- /* deserialize */ (H5AC_deserialize_func_t)earray_cache_test_deserialize,
- /* image_len */ (H5AC_image_len_func_t)earray_cache_test_image_len,
- /* pre_serialize */ (H5AC_pre_serialize_func_t)NULL,
- /* serialize */ (H5AC_serialize_func_t)earray_cache_test_serialize,
- /* notify */ (H5AC_notify_func_t)NULL,
- /* free_icr */ (H5AC_free_icr_func_t)earray_cache_test_free_icr,
- /* clear */ NULL,
+ /* get_load_size */ earray_cache_test_get_load_size,
+ /* deserialize */ earray_cache_test_deserialize,
+ /* image_len */ earray_cache_test_image_len,
+ /* pre_serialize */ NULL,
+ /* serialize */ earray_cache_test_serialize,
+ /* notify */ NULL,
+ /* free_icr */ earray_cache_test_free_icr,
/* fsf_size */ NULL,
}};
@@ -659,7 +647,6 @@ earray_cache_test_get_load_size(const void *udata_ptr, size_t *image_len_ptr)
*image_len_ptr = 0;
return(SUCCEED);
-
} /* end earray_cache_test_get_load_size() */
@@ -691,12 +678,10 @@ earray_cache_test_deserialize(const void *image_ptr,
HDassert(udata_ptr);
HDassert(dirty_ptr);
-
/* Should never be called */
HDassert(0 && "Can't be called!");
return(NULL);
-
} /* end earray_cache_test_deserialize() */
@@ -719,10 +704,8 @@ earray_cache_test_deserialize(const void *image_ptr,
*-------------------------------------------------------------------------
*/
static herr_t
-earray_cache_test_image_len(const void *thing, size_t *image_len_ptr,
- hbool_t H5_ATTR_UNUSED * compressed_ptr, size_t H5_ATTR_UNUSED * compressed_len_ptr)
+earray_cache_test_image_len(const void *thing, size_t *image_len_ptr)
{
-
HDassert(thing);
HDassert(image_len_ptr);
@@ -731,14 +714,9 @@ earray_cache_test_image_len(const void *thing, size_t *image_len_ptr,
*image_len_ptr = 1;
return(SUCCEED);
-
} /* end earray_cache_test_image_len() */
-/********************************/
-/* no H5O_cache_pre_serialize() */
-/********************************/
-
/*-------------------------------------------------------------------------
* Function: earray_cache_test_serialize
@@ -764,14 +742,12 @@ earray_cache_test_serialize(const H5F_t *f,
H5_ATTR_UNUSED size_t len,
void *thing)
{
- earray_test_t *test = NULL;
+ earray_test_t *test;
HDassert(f);
HDassert(image_ptr);
HDassert(thing);
-
test = (earray_test_t *)thing;
-
HDassert(test);
HDassert(test->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
HDassert((const H5AC_class_t *)(test->cache_info.type) ==
@@ -814,16 +790,10 @@ earray_cache_test_serialize(const H5F_t *f,
return(SUCCEED);
error:
-
return(FAIL);
-
} /* end earray_cache_test_serialize() */
-/******************************************/
-/* no earray_cache_test_notify() function */
-/******************************************/
-
/*-------------------------------------------------------------------------
* Function: earray_cache_test_free_icr
@@ -846,12 +816,10 @@ error:
static herr_t
earray_cache_test_free_icr(void *thing)
{
- earray_test_t *test = NULL;
+ earray_test_t *test;
HDassert(thing);
-
test = (earray_test_t *)thing;
-
HDassert(test);
/* the metadata cache sets cache_info.magic to
@@ -867,7 +835,6 @@ earray_cache_test_free_icr(void *thing)
HDfree(test);
return(SUCCEED);
-
} /* end earray_cache_test_free_icr() */
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 8b77ebe..b855f5d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -139,7 +139,8 @@ int total_writes = 0;
* happen to overlap some collective operation.
*
* cleared: Boolean flag that is set to true whenever the entry is
- * dirty, and is cleared via a call to datum_clear().
+ * dirty, and is cleared via a call to datum_notify with the
+ * "entry cleaned" action.
*
* flushed: Boolean flag that is set to true whenever the entry is
* dirty, and is flushed by the metadata cache.
@@ -397,10 +398,8 @@ static void * datum_deserialize(const void * image_ptr,
void * udata_ptr,
hbool_t * dirty_ptr);
-static herr_t datum_image_len(void *thing,
- size_t *image_len_ptr,
- hbool_t *compressed_ptr,
- size_t *compressed_len_ptr);
+static herr_t datum_image_len(const void *thing,
+ size_t *image_len_ptr);
static herr_t datum_serialize(const H5F_t *f,
void *image_ptr,
@@ -411,8 +410,6 @@ static herr_t datum_notify(H5C_notify_action_t action, void *thing);
static herr_t datum_free_icr(void * thing);
-static herr_t datum_clear(H5F_t * f, void * thing, hbool_t about_to_destroy);
-
#define DATUM_ENTRY_TYPE H5AC_TEST_ID
#define NUMBER_OF_ENTRY_TYPES 1
@@ -439,15 +436,14 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] =
/* name */ "datum",
/* mem_type */ H5FD_MEM_DEFAULT,
/* flags */ H5AC__CLASS_SKIP_READS | H5AC__CLASS_SKIP_WRITES,
- /* get_load_size */ (H5AC_get_load_size_func_t)datum_get_load_size,
- /* deserialize */ (H5AC_deserialize_func_t)datum_deserialize,
- /* image_len */ (H5AC_image_len_func_t)datum_image_len,
- /* pre_serialize */ (H5AC_pre_serialize_func_t)NULL,
- /* serialize */ (H5AC_serialize_func_t)datum_serialize,
- /* notify */ (H5AC_notify_func_t)datum_notify,
- /* free_icr */ (H5AC_free_icr_func_t)datum_free_icr,
- /* clear */ (H5AC_clear_func_t)datum_clear,
- /* fsf_size */ (H5AC_get_fsf_size_t)NULL,
+ /* get_load_size */ datum_get_load_size,
+ /* deserialize */ datum_deserialize,
+ /* image_len */ datum_image_len,
+ /* pre_serialize */ NULL,
+ /* serialize */ datum_serialize,
+ /* notify */ datum_notify,
+ /* free_icr */ datum_free_icr,
+ /* fsf_size */ NULL,
}
};
@@ -2448,8 +2444,7 @@ datum_deserialize(const void * image_ptr,
*-------------------------------------------------------------------------
*/
static herr_t
-datum_image_len(void *thing, size_t *image_len,
- hbool_t H5_ATTR_UNUSED *compressed_ptr, size_t H5_ATTR_UNUSED *compressed_len_ptr)
+datum_image_len(const void *thing, size_t *image_len)
{
int idx;
struct datum * entry_ptr;
@@ -2896,7 +2891,16 @@ datum_notify(H5C_notify_action_t action, void *thing)
fflush(stdout);
}
- /* do nothing */
+ entry_ptr->cleared = TRUE;
+ entry_ptr->dirty = FALSE;
+
+ datum_clears++;
+
+ if(entry_ptr->header.is_pinned) {
+ datum_pinned_clears++;
+ HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned );
+ } /* end if */
+
break;
case H5AC_NOTIFY_ACTION_CHILD_DIRTIED:
@@ -2994,62 +2998,6 @@ datum_free_icr(void * thing)
} /* datum_free_icr() */
-/*-------------------------------------------------------------------------
- * Function: datum_clear
- *
- * Purpose: Mark the datum as clean.
- *
- * Do not write it to the server, or increment the version.
- *
- * Return: SUCCEED
- *
- * Programmer: John Mainzer
- * 12/29/05
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-datum_clear(H5F_t H5_ATTR_UNUSED * f,
- void * thing,
- hbool_t H5_ATTR_UNUSED about_to_destroy)
-{
- int idx;
- struct datum * entry_ptr;
-
- HDassert( thing );
-
- entry_ptr = (struct datum *)thing;
-
- idx = addr_to_datum_index(entry_ptr->base_addr);
-
- HDassert( idx >= 0 );
- HDassert( idx < NUM_DATA_ENTRIES );
- HDassert( idx < virt_num_data_entries );
- HDassert( &(data[idx]) == entry_ptr );
-
- HDassert( entry_ptr->header.addr == entry_ptr->base_addr );
- HDassert( ( entry_ptr->header.size == entry_ptr->len ) ||
- ( entry_ptr->header.size == entry_ptr->local_len ) );
-
- HDassert( ( entry_ptr->dirty ) ||
- ( entry_ptr->header.is_dirty == entry_ptr->dirty ) );
-
- entry_ptr->cleared = TRUE;
- entry_ptr->dirty = FALSE;
-
- datum_clears++;
-
- if ( entry_ptr->header.is_pinned ) {
-
- datum_pinned_clears++;
- HDassert( entry_ptr->global_pinned || entry_ptr->local_pinned );
- }
-
- return(SUCCEED);
-
-} /* datum_clear() */
-
-
/*****************************************************************************/
/************************** test utility functions ***************************/
/*****************************************************************************/
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 315210b..335eafa 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -10129,75 +10129,75 @@ static void gent_compound_complex2(void)
H5Sclose(space);
}
-// /* CompoundComplex2D */
-// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
-// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
-// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
-// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
-// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
-// if ((space = H5Screate_simple(F82_RANK2, &nelmts, NULL)) >= 0) {
-// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
-// for(i = 0; i < nelmts; i++) {
-// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
-// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
-// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
-// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
-// }
-//
-// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
-// H5Dclose(dset);
-// }
-// H5Sclose(space);
-// }
-// H5Tclose(type);
-// }
-//
-// /* CompoundComplex3D */
-// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
-// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
-// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
-// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
-// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
-// if ((space = H5Screate_simple(F82_RANK3, &nelmts, NULL)) >= 0) {
-// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
-// for(i = 0; i < nelmts; i++) {
-// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
-// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
-// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
-// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
-// }
-//
-// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
-// H5Dclose(dset);
-// }
-// H5Sclose(space);
-// }
-// H5Tclose(type);
-// }
-//
-// /* CompoundComplex4D */
-// if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
-// H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
-// H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
-// H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
-// H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
-// if ((space = H5Screate_simple(F82_RANK4, &nelmts, NULL)) >= 0) {
-// if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
-// for(i = 0; i < nelmts; i++) {
-// buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
-// buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
-// buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
-// buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
-// }
-//
-// H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
-// H5Dclose(dset);
-// }
-// H5Sclose(space);
-// }
-// H5Tclose(type);
-// }
+ /* CompoundComplex2D */
+/* if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
+ H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
+ H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
+ H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
+ H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
+ if ((space = H5Screate_simple(F82_RANK2, &nelmts, NULL)) >= 0) {
+ if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ for(i = 0; i < nelmts; i++) {
+ buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
+ buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
+ buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
+ buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
+ }
+
+ H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ H5Dclose(dset);
+ }
+ H5Sclose(space);
+ }
+ H5Tclose(type);
+ }
+*/
+ /* CompoundComplex3D */
+/* if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
+ H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
+ H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
+ H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
+ H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
+ if ((space = H5Screate_simple(F82_RANK3, &nelmts, NULL)) >= 0) {
+ if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ for(i = 0; i < nelmts; i++) {
+ buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
+ buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
+ buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
+ buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
+ }
+ H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ H5Dclose(dset);
+ }
+ H5Sclose(space);
+ }
+ H5Tclose(type);
+ }
+*/
+ /* CompoundComplex4D */
+/* if ((type = H5Tcreate(H5T_COMPOUND, sizeof(s_t))) >= 0) {
+ H5Tinsert(type, "a", HOFFSET(s_t, a), H5T_STD_B8LE);
+ H5Tinsert(type, "b", HOFFSET(s_t, b), H5T_STD_B16LE);
+ H5Tinsert(type, "c", HOFFSET(s_t, c), H5T_STD_B32LE);
+ H5Tinsert(type, "d", HOFFSET(s_t, d), H5T_STD_B64LE);
+ if ((space = H5Screate_simple(F82_RANK4, &nelmts, NULL)) >= 0) {
+ if ((dset = H5Dcreate2(file, "compound_1", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) >= 0) {
+ for(i = 0; i < nelmts; i++) {
+ buf5[i].a = (unsigned char)0xff ^ (unsigned char)i;
+ buf5[i].b = (unsigned int)0xffff ^ (unsigned int)(i * 16);
+ buf5[i].c = (unsigned long)0xffffffff ^ (unsigned long)(i * 32);
+ buf5[i].d = (unsigned long long)0xffffffffffffffff ^ (unsigned long long)(i * 64);
+ }
+
+ H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
+ H5Dclose(dset);
+ }
+ H5Sclose(space);
+ }
+ H5Tclose(type);
+ }
+*/
H5Fclose(file);
HDfree(buf);