diff options
Diffstat (limited to 'src/H5EAcache.c')
-rw-r--r-- | src/H5EAcache.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 36d1875..a178536 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -617,15 +617,15 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(*p++ != H5EA_IBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array index block version") + /* Extensible array type */ + if(*p++ != (uint8_t)hdr->cparam.cls->id) + H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") + /* Address of header for array that owns this block (just for file integrity checks) */ H5F_addr_decode(f, &p, &arr_addr); if(H5F_addr_ne(arr_addr, hdr->addr)) H5E_THROW(H5E_BADVALUE, "wrong extensible array header address") - /* Extensible array type */ - if(*p++ != (uint8_t)hdr->cparam.cls->id) - H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") - /* Internal information */ /* Decode elements in index block */ @@ -744,12 +744,12 @@ H5EA__cache_iblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Version # */ *p++ = H5EA_IBLOCK_VERSION; - /* Address of array header for array which owns this block */ - H5F_addr_encode(f, &p, iblock->hdr->addr); - /* Extensible array type */ *p++ = iblock->hdr->cparam.cls->id; + /* Address of array header for array which owns this block */ + H5F_addr_encode(f, &p, iblock->hdr->addr); + /* Internal information */ /* Encode elements in index block */ @@ -1033,6 +1033,10 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(*p++ != H5EA_SBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array super block version") + /* Extensible array type */ + if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) + H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") + /* Address of header for array that owns this block (just for file integrity checks) */ H5F_addr_decode(f, &p, &arr_addr); if(H5F_addr_ne(arr_addr, udata->hdr->addr)) @@ -1041,10 +1045,6 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Offset of block within the array's address space */ UINT64DECODE_VAR(p, sblock->block_off, udata->hdr->arr_off_size); - /* Extensible array type */ - if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) - H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") - /* Internal information */ /* Check for 'page init' bitmasks for this super block */ @@ -1151,15 +1151,15 @@ H5EA__cache_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Version # */ *p++ = H5EA_SBLOCK_VERSION; + /* Extensible array type */ + *p++ = sblock->hdr->cparam.cls->id; + /* Address of array header for array which owns this block */ H5F_addr_encode(f, &p, sblock->hdr->addr); /* Offset of block in array */ UINT64ENCODE_VAR(p, sblock->block_off, sblock->hdr->arr_off_size); - /* Extensible array type */ - *p++ = sblock->hdr->cparam.cls->id; - /* Internal information */ /* Check for 'page init' bitmasks for this super block */ @@ -1431,6 +1431,10 @@ H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) if(*p++ != H5EA_DBLOCK_VERSION) H5E_THROW(H5E_VERSION, "wrong extensible array data block version") + /* Extensible array type */ + if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) + H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") + /* Address of header for array that owns this block (just for file integrity checks) */ H5F_addr_decode(f, &p, &arr_addr); if(H5F_addr_ne(arr_addr, udata->hdr->addr)) @@ -1439,10 +1443,6 @@ H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) /* Offset of block within the array's address space */ UINT64DECODE_VAR(p, dblock->block_off, udata->hdr->arr_off_size); - /* Extensible array type */ - if(*p++ != (uint8_t)udata->hdr->cparam.cls->id) - H5E_THROW(H5E_BADTYPE, "incorrect extensible array class") - /* Internal information */ /* Only decode elements if the data block is not paged */ @@ -1547,15 +1547,15 @@ H5EA__cache_dblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, /* Version # */ *p++ = H5EA_DBLOCK_VERSION; + /* Extensible array type */ + *p++ = dblock->hdr->cparam.cls->id; + /* Address of array header for array which owns this block */ H5F_addr_encode(f, &p, dblock->hdr->addr); /* Offset of block in array */ UINT64ENCODE_VAR(p, dblock->block_off, dblock->hdr->arr_off_size); - /* Extensible array type */ - *p++ = dblock->hdr->cparam.cls->id; - /* Internal information */ /* Only encode elements if the data block is not paged */ |