diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5O.c | 24 | ||||
-rw-r--r-- | src/H5Oalloc.c | 6 |
2 files changed, 19 insertions, 11 deletions
@@ -720,7 +720,7 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id, /* Allocate disk space for header and first chunk */ if(HADDR_UNDEF == (oh_addr = H5MF_alloc(f, H5FD_MEM_OHDR, dxpl_id, (hsize_t)oh_size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header header") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "file allocation failed for object header") /* Create the chunk list */ oh->nchunks = oh->alloc_nchunks = 1; @@ -1511,23 +1511,27 @@ static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) { const H5O_obj_class_t *obj_class; /* Class of object for header */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_obj_type_real) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_obj_type_real) /* Sanity check */ HDassert(oh); HDassert(obj_type); /* Look up class for object header */ - if(NULL == (obj_class = H5O_obj_class_real(oh))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to determine object type") + if(NULL == (obj_class = H5O_obj_class_real(oh))) { + /* Clear error stack from "failed" class lookup */ + H5E_clear_stack(NULL); - /* Set object type */ - *obj_type = obj_class->type; + /* Set type to "unknown" */ + *obj_type = H5O_TYPE_UNKNOWN; + } /* end if */ + else { + /* Set object type */ + *obj_type = obj_class->type; + } /* end else */ -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_obj_type_real() */ @@ -1927,7 +1931,7 @@ H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id) /* Iterate over all the chunks, adding any gaps to the free space */ oinfo->hdr.space.total = 0; for(u = 0, curr_chunk = &oh->chunk[0]; u < oh->nchunks; u++, curr_chunk++) { - /* Accumulate the size of the header on header */ + /* Accumulate the size of the header on disk */ oinfo->hdr.space.total += curr_chunk->size; /* If the chunk has a gap, add it to the free space */ diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 6badfb7..ae07294 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -594,9 +594,13 @@ H5O_alloc_extend_chunk(H5F_t *f, /* Spin through existing messages, adjusting them */ for(u = 0; u < oh->nmesgs; u++) { /* Adjust raw addresses for messages in this chunk to reflect new 'image' address */ - if(oh->mesg[u].chunkno == chunkno) + if(oh->mesg[u].chunkno == chunkno) { oh->mesg[u].raw = oh->chunk[chunkno].image + extra_prfx_size + (oh->mesg[u].raw - old_image); + /* Flag message as dirty */ + oh->mesg[u].dirty = TRUE; + } /* endif */ + /* Find continuation message which points to this chunk and adjust chunk's size */ /* (Chunk 0 doesn't have a continuation message that points to it and * it's size is directly encoded in the object header) */ |