summaryrefslogtreecommitdiffstats
path: root/src/H5FAcache.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-11-16 04:17:45 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-11-16 04:17:45 (GMT)
commit4fe33eda1c243a0e6410e57c151b93e1950cf192 (patch)
tree857b21defd5b7804fd8edd0e3429a57213b849cc /src/H5FAcache.c
parent6d5d4ed1d10498bf776b5a4d41cf2384b4d8fe28 (diff)
downloadhdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.zip
hdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.tar.gz
hdf5-4fe33eda1c243a0e6410e57c151b93e1950cf192.tar.bz2
[svn-r17895] Description:
Correct & simplify client callback context for extensible and fixed array data structures. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.2 (amazon) in debug mode Mac OS X/32 10.6.2 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5FAcache.c')
-rw-r--r--src/H5FAcache.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/H5FAcache.c b/src/H5FAcache.c
index 59a81e2..3488531 100644
--- a/src/H5FAcache.c
+++ b/src/H5FAcache.c
@@ -158,11 +158,11 @@ const H5AC_class_t H5AC_FARRAY_DBLK_PAGE[1] = {{
*/
BEGIN_FUNC(STATIC, ERR,
H5FA_hdr_t *, NULL, NULL,
-H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
+H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *udata1,
void *ctx_udata))
/* Local variables */
- const H5FA_class_t *cls = (const H5FA_class_t *)_cls; /* Fixed array class */
+ H5FA_cls_id_t id; /* ID of fixed array class, as found in file */
H5FA_hdr_t *hdr = NULL; /* Fixed array info */
size_t size; /* Header size */
H5WB_t *wb = NULL; /* Wrapped buffer for header data */
@@ -177,7 +177,7 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
HDassert(H5F_addr_defined(addr));
/* Allocate space for the fixed array data structure */
- if(NULL == (hdr = H5FA__hdr_alloc(f, cls, ctx_udata)))
+ if(NULL == (hdr = H5FA__hdr_alloc(f)))
H5E_THROW(H5E_CANTALLOC, "memory allocation failed for fixed array shared header")
/* Set the fixed array header's address */
@@ -210,9 +210,11 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
if(*p++ != H5FA_HDR_VERSION)
H5E_THROW(H5E_VERSION, "wrong fixed array header version")
- /* Fixed array type */
- if(*p++ != (uint8_t)cls->id)
+ /* Fixed array class */
+ id = *p++;
+ if(id >= H5FA_NUM_CLS_ID)
H5E_THROW(H5E_BADTYPE, "incorrect fixed array class")
+ hdr->cparam.cls = H5FA_client_class_g[id];
/* General array creation/configuration information */
hdr->cparam.raw_elmt_size = *p++; /* Element size in file (in bytes) */
@@ -226,10 +228,6 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
/* Internal information */
H5F_addr_decode(f, &p, &hdr->dblk_addr); /* Address of index block */
- /* Initializations of header info */
- hdr->stats.nelmts = hdr->cparam.nelmts;
- hdr->stats.hdr_size = hdr->size = size; /* Size of header in file */
-
/* Check for data block */
if(H5F_addr_defined(hdr->dblk_addr)) {
H5FA_dblock_t dblock; /* Fake data block for computing size */
@@ -267,6 +265,11 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_cls,
if(stored_chksum != computed_chksum)
H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for fixed array header")
+ /* Finish initializing fixed array header */
+ if(H5FA__hdr_init(hdr, ctx_udata) < 0)
+ H5E_THROW(H5E_CANTINIT, "initialization failed for fixed array header")
+ HDassert(hdr->size == size);
+
/* Set return value */
ret_value = hdr;