diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-26 18:18:08 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-26 18:18:08 (GMT) |
commit | e0ae782d2790610af17d11e30a5bd32a9bac7704 (patch) | |
tree | 76872927acdc98bc543184db2393bcc0dc80b40a | |
parent | 3ea2c632d50870966320bc13d716959745d1e7dd (diff) | |
download | hdf5-e0ae782d2790610af17d11e30a5bd32a9bac7704.zip hdf5-e0ae782d2790610af17d11e30a5bd32a9bac7704.tar.gz hdf5-e0ae782d2790610af17d11e30a5bd32a9bac7704.tar.bz2 |
[svn-r13390] Description:
Make H5O_protect/H5O_unprotect use pinned cache entries instead of
protected entries (allowing the object header routines to be semi-reentrant).
Tested on:
FreeBSD 6.2 (duty)
-rw-r--r-- | src/H5Aint.c | 9 | ||||
-rw-r--r-- | src/H5Apkg.h | 3 | ||||
-rw-r--r-- | src/H5D.c | 19 | ||||
-rw-r--r-- | src/H5Gobj.c | 7 | ||||
-rw-r--r-- | src/H5O.c | 47 | ||||
-rw-r--r-- | src/H5Oalloc.c | 8 | ||||
-rw-r--r-- | src/H5Oattribute.c | 114 | ||||
-rw-r--r-- | src/H5Omessage.c | 94 | ||||
-rw-r--r-- | src/H5Opkg.h | 24 | ||||
-rw-r--r-- | src/H5Oprivate.h | 11 | ||||
-rw-r--r-- | src/H5S.c | 6 | ||||
-rw-r--r-- | src/H5Sprivate.h | 14 |
12 files changed, 184 insertions, 172 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c index 9d1b5c9..a8bcedd 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -115,7 +115,7 @@ static herr_t H5A_attr_sort_table(H5A_attr_table_t *atable, H5_index_t idx_type, */ static herr_t H5A_compact_build_table_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, unsigned UNUSED *oh_flags_ptr, void *_udata/*in,out*/) + unsigned sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) { H5A_compact_bt_ud_t *udata = (H5A_compact_bt_ud_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -172,7 +172,7 @@ done: */ herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, - H5_iter_order_t order, H5A_attr_table_t *atable, unsigned *oh_flags) + H5_iter_order_t order, H5A_attr_table_t *atable) { H5A_compact_bt_ud_t udata; /* User data for iteration callback */ H5O_mesg_operator_t op; /* Wrapper for operator */ @@ -197,8 +197,9 @@ H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_index_t idx_type, udata.bogus_crt_idx = (oh->version == H5O_VERSION_1) ? TRUE : FALSE; /* Iterate over existing attributes, checking for attribute with same name */ - op.lib_op = H5A_compact_build_table_cb; - if(H5O_msg_iterate_real(f, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5A_compact_build_table_cb; + if(H5O_msg_iterate_real(f, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error building attribute table") /* Correct # of attributes in table */ diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 59a2032..8d95ce9 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -205,8 +205,7 @@ H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_t *oh, /* Attribute table operations */ H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable, - unsigned *oh_flags); + H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable); H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id, haddr_t attr_fheap_addr, haddr_t name_bt2_addr, H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable); @@ -1115,7 +1115,6 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset) { struct H5O_t *oh = NULL; /* Pointer to dataset's object header */ size_t ohdr_size = H5D_MINHDR_SIZE; /* Size of dataset's object header */ - unsigned oh_flags = H5AC__DIRTIED_FLAG; H5O_loc_t *oloc = NULL; /* Dataset's object location */ H5O_layout_t *layout; /* Dataset's layout information */ H5T_t *type; /* Dataset's datatype */ @@ -1203,21 +1202,21 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to protect dataset object header") /* Write new fill value message */ - if(H5O_msg_append(file, dxpl_id, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop, &oh_flags) < 0) + if(H5O_msg_append(file, dxpl_id, oh, H5O_FILL_NEW_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update new fill value header message") /* If there is valid information for the old fill value struct, update it */ /* (only if we aren't trying to write the latest version of the file format) */ if(fill_prop->buf && !use_latest_format) { /* Write old fill value */ - if(H5O_msg_append(file, dxpl_id, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop, &oh_flags) < 0) + if(H5O_msg_append(file, dxpl_id, oh, H5O_FILL_ID, H5O_MSG_FLAG_CONSTANT, 0, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update old fill value header message") } /* end if */ /* Update the datatype and dataspace header messages */ - if(H5O_msg_append(file, dxpl_id, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type, &oh_flags) < 0) + if(H5O_msg_append(file, dxpl_id, oh, H5O_DTYPE_ID, H5O_MSG_FLAG_CONSTANT, 0, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update datatype header message") - if(H5S_append(file, dxpl_id, oh, dset->shared->space, &oh_flags) < 0) + if(H5S_append(file, dxpl_id, oh, dset->shared->space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update dataspace header message") /* Update the filters message, if this is a chunked dataset */ @@ -1225,7 +1224,7 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset) H5O_pline_t *pline; /* Dataset's I/O pipeline information */ pline = &dset->shared->dcpl_cache.pline; - if(pline->nused > 0 && H5O_msg_append(file, dxpl_id, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline, &oh_flags) < 0) + if(pline->nused > 0 && H5O_msg_append(file, dxpl_id, oh, H5O_PLINE_ID, H5O_MSG_FLAG_CONSTANT, 0, pline) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update filter header message") } /* end if */ @@ -1263,14 +1262,14 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset) efl->slot[u].name_offset = offset; } /* end for */ - if(H5O_msg_append(file, dxpl_id, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl, &oh_flags) < 0) + if(H5O_msg_append(file, dxpl_id, oh, H5O_EFL_ID, H5O_MSG_FLAG_CONSTANT, 0, efl) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update external file list message") } /* end if */ /* Create layout message */ /* (Don't make layout message constant unless allocation time is early, since space may not be allocated) */ /* (Note: this is relying on H5D_alloc_storage not calling H5O_msg_write during dataset creation) */ - if(H5O_msg_append(file, dxpl_id, oh, H5O_LAYOUT_ID, ((fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type) ? H5O_MSG_FLAG_CONSTANT : 0), 0, layout, &oh_flags) < 0) + if(H5O_msg_append(file, dxpl_id, oh, H5O_LAYOUT_ID, ((fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type) ? H5O_MSG_FLAG_CONSTANT : 0), 0, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout") #ifdef H5O_ENABLE_BOGUS @@ -1282,13 +1281,13 @@ H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset) #endif /* H5O_ENABLE_BOGUS */ /* Add a modification time message. */ - if(H5O_touch_oh(file, dxpl_id, oh, TRUE, &oh_flags) < 0) + if(H5O_touch_oh(file, dxpl_id, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") done: /* Release pointer to object header itself */ if(oloc != NULL && oh != NULL) - if(H5O_unprotect(oloc, oh, dxpl_id, oh_flags) < 0) + if(H5O_unprotect(oloc, oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Gobj.c b/src/H5Gobj.c index 0400f8a..f8bc556 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -908,7 +908,6 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* If ok, insert links as link messages */ if(can_convert) { struct H5O_t *oh = NULL; /* Pointer to group's object header */ - unsigned oh_flags = H5AC__DIRTIED_FLAG; /* Get a pointer to the object header itself */ if((oh = H5O_protect(oloc, dxpl_id)) == NULL) @@ -916,16 +915,16 @@ H5G_obj_remove_update_linfo(H5O_loc_t *oloc, H5O_linfo_t *linfo, hid_t dxpl_id) /* Insert link messages into group */ for(u = 0; u < linfo->nlinks; u++) - if(H5O_msg_append(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u]), &oh_flags) < 0) { + if(H5O_msg_append(oloc->file, dxpl_id, oh, H5O_LINK_ID, 0, H5O_UPDATE_TIME, &(ltable.lnks[u])) < 0) { /* Release object header */ - if(H5O_unprotect(oloc, oh, dxpl_id, oh_flags) < 0) + if(H5O_unprotect(oloc, oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header") HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't create message") } /* end if */ /* Release object header */ - if(H5O_unprotect(oloc, oh, dxpl_id, oh_flags) < 0) + if(H5O_unprotect(oloc, oh) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to unprotect dataset object header") /* Remove the dense storage */ @@ -1028,6 +1028,17 @@ H5O_protect(H5O_loc_t *loc, hid_t dxpl_id) if(NULL == (ret_value = H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, H5AC_WRITE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "unable to load object header") + /* Mark object header as un-evictable */ + if(H5AC_pin_protected_entry(loc->file, ret_value) < 0) { + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, ret_value, H5AC__NO_FLAGS_SET) < 0) + HDONE_ERROR(H5E_OHDR, H5E_PROTECT, NULL, "unable to release object header") + + HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header") + } /* end if */ + + /* Release the object header from the cache */ + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, ret_value, H5AC__NO_FLAGS_SET) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, NULL, "unable to release object header") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_protect() */ @@ -1051,7 +1062,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_unprotect(H5O_loc_t *loc, H5O_t *oh, hid_t dxpl_id, unsigned oh_flags) +H5O_unprotect(H5O_loc_t *loc, H5O_t *oh) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1063,9 +1074,9 @@ H5O_unprotect(H5O_loc_t *loc, H5O_t *oh, hid_t dxpl_id, unsigned oh_flags) HDassert(H5F_addr_defined(loc->addr)); HDassert(oh); - /* Release the object header from the cache */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") + /* Mark object header as evictable again */ + if(H5AC_unpin_entry(loc->file, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPIN, FAIL, "unable to unpin object header") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1087,16 +1098,15 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force, - unsigned * oh_flags_ptr) +H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force) { time_t now; /* Current time */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh) + HDassert(f); HDassert(oh); - HDassert(oh_flags_ptr); /* Get current time */ now = H5_now(); @@ -1119,7 +1129,7 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force, HGOTO_DONE(SUCCEED); /*nothing to do*/ /* Allocate space for the modification time message */ - if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now, oh_flags_ptr)) == UFAIL) + if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_MTIME_NEW, &mesg_flags, &now)) == UFAIL) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for modification time message") /* Set the message's flags if appropriate */ @@ -1144,8 +1154,9 @@ H5O_touch_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t force, oh->atime = oh->ctime = now; } /* end else */ - /* Mark the object header as dirty */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + /* Mark object header as dirty in cache */ + if(H5AC_mark_pinned_or_protected_entry_dirty(f, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1188,9 +1199,12 @@ H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Create/Update the modification time message */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, force, &oh_flags) < 0) + if(H5O_touch_oh(loc->file, dxpl_id, oh, force) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to update object modificaton time") + /* Mark object header as changed */ + oh_flags |= H5AC__DIRTIED_FLAG; + done: if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") @@ -1214,7 +1228,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t * oh_flags_ptr) +H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) { int idx; herr_t ret_value = SUCCEED; /* Return value */ @@ -1223,7 +1237,6 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t * oh_flags_ptr) HDassert(f); HDassert(oh); - HDassert(oh_flags_ptr); /* Look for existing message */ for(idx = 0; idx < oh->nmesgs; idx++) @@ -1243,14 +1256,13 @@ H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh, hbool_t * oh_flags_ptr) bogus->u = H5O_BOGUS_VALUE; /* Allocate space in the object header for bogus message */ - if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_BOGUS, &mesg_flags, bogus, oh_flags_ptr)) < 0) + if((idx = H5O_msg_alloc(f, dxpl_id, oh, H5O_MSG_BOGUS, &mesg_flags, bogus)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to allocate space for 'bogus' message") /* Point to "bogus" information (take it over) */ oh->mesg[idx].native = bogus; /* Mark the message and object header as dirty */ - *oh_flags_ptr = TRUE; oh->mesg[idx].flags = mesg_flags; oh->mesg[idx].dirty = TRUE; oh->dirty = TRUE; @@ -1297,9 +1309,12 @@ H5O_bogus(H5O_loc_t *loc, hid_t dxpl_id) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Create the "bogus" message */ - if(H5O_bogus_oh(ent->file, dxpl_id, oh, &oh_flags) < 0) + if(H5O_bogus_oh(ent->file, dxpl_id, oh) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to update object 'bogus' message") + /* Mark object header as changed */ + oh_flags |= H5AC__DIRTIED_FLAG; + done: if(oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 64aa0f7..555c7b0 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -840,7 +840,7 @@ done: */ unsigned H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, - const void *mesg, unsigned * oh_flags_ptr) + const void *mesg) { size_t raw_size; /* Raw size of message */ size_t aligned_size; /* Size of message including alignment */ @@ -853,7 +853,6 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HDassert(oh); HDassert(type); HDassert(mesg); - HDassert(oh_flags_ptr); /* Compute the size needed to store the message in the object header */ if((raw_size = (type->raw_size)(f, FALSE, mesg)) >= H5O_MESG_MAX_SIZE) @@ -901,8 +900,9 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, if(H5O_alloc_null(oh, idx, type, NULL, aligned_size) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, UFAIL, "can't split null message") - /* Mark the object header as modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + /* Mark object header as dirty in cache */ + if(H5AC_mark_pinned_or_protected_entry_dirty(f, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, UFAIL, "unable to mark object header as dirty") /* Set return value */ ret_value = idx; diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 9377bd0..92c0887 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -162,7 +162,7 @@ static herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, */ static herr_t H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) { H5O_iter_cvt_t *udata = (H5O_iter_cvt_t *)_udata; /* Operator user data */ H5A_t *attr = (H5A_t *)mesg->native; /* Pointer to attribute to insert */ @@ -184,7 +184,7 @@ H5O_attr_to_dense_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + *oh_modified = TRUE; done: FUNC_LEAVE_NOAPI(ret_value) @@ -235,8 +235,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) } /* end if */ /* Check for condititions for switching to "dense" attribute storage are met */ - if(oh->nattrs == oh->max_compact || - (!sharable && raw_size >= H5O_MESG_MAX_SIZE)) { + if(oh->nattrs == oh->max_compact || (!sharable && raw_size >= H5O_MESG_MAX_SIZE)) { H5O_iter_cvt_t udata; /* User data for callback */ H5O_mesg_operator_t op; /* Wrapper for operator */ @@ -249,8 +248,9 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) udata.dxpl_id = dxpl_id; /* Iterate over existing attributes, moving them to dense storage */ - op.lib_op = H5O_attr_to_dense_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_to_dense_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTCONVERT, FAIL, "error converting attributes to dense storage") } /* end if */ } /* end if */ @@ -278,7 +278,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) } /* end if */ else { /* Append new message to object header */ - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, attr, &oh_flags) < 0) + if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new attribute in header") } /* end else */ @@ -322,7 +322,7 @@ H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "error determining if message should be shared") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE, &oh_flags) < 0) + if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") /* Indicate that the object header was modified */ @@ -352,7 +352,7 @@ done: */ static herr_t H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - unsigned UNUSED *oh_flags_ptr, void *_udata/*in,out*/) + hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_opn_t *udata = (H5O_iter_opn_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -399,7 +399,6 @@ H5A_t * H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ H5A_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_open_by_name) @@ -429,8 +428,9 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) udata.attr = NULL; /* Iterate over attributes, to locate correct one to open */ - op.lib_op = H5O_attr_open_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_open_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, NULL, "error updating attribute") /* Check that we found the attribute */ @@ -443,7 +443,7 @@ H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) } /* end else */ done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, NULL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -609,7 +609,7 @@ done: */ static herr_t H5O_attr_write_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) { H5O_iter_wrt_t *udata = (H5O_iter_wrt_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -641,7 +641,7 @@ H5O_attr_write_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, mesg->dirty = TRUE; /* Indicate that the object header was modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + *oh_modified = TRUE; /* Indicate that the attribute was found */ udata->found = TRUE; @@ -671,7 +671,6 @@ herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_write) @@ -701,8 +700,9 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) udata.found = FALSE; /* Iterate over attributes, to locate correct one to update */ - op.lib_op = H5O_attr_write_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_write_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute */ @@ -711,11 +711,11 @@ H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr) } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE, &oh_flags) < 0) + if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -738,7 +738,7 @@ done: */ static herr_t H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned UNUSED *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -784,7 +784,7 @@ H5O_attr_rename_chk_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, */ static herr_t H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -855,7 +855,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, /* Append renamed attribute to object header */ /* (Don't let it become shared) */ - if(H5O_msg_append_real(udata->f, udata->dxpl_id, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr, oh_flags_ptr) < 0) + if(H5O_msg_append_real(udata->f, udata->dxpl_id, oh, H5O_MSG_ATTR, (mesg->flags | H5O_MSG_FLAG_DONTSHARE), 0, attr) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, H5_ITER_ERROR, "unable to relocate renamed attribute in header") /* Sanity check */ @@ -867,7 +867,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, } /* end else */ /* Indicate that the object header was modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + *oh_modified = TRUE; /* Indicate that we found an existing attribute with the old name */ udata->found = TRUE; @@ -930,8 +930,9 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, udata.found = FALSE; /* Iterate over attributes, to check if "new name" exists already */ - op.lib_op = H5O_attr_rename_chk_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_rename_chk_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* If the new name was found, indicate an error */ @@ -939,17 +940,21 @@ H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, HGOTO_ERROR(H5E_ATTR, H5E_EXISTS, FAIL, "attribute with new name already exists") /* Iterate over attributes again, to actually rename attribute with old name */ - op.lib_op = H5O_attr_rename_mod_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_rename_mod_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "error updating attribute") /* Check that we found the attribute to rename */ if(!udata.found) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "can't locate attribute with old name") + + /* Indicate that the object header was modified */ + oh_flags |= H5AC__DIRTIED_FLAG; } /* end else */ /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE, &oh_flags) < 0) + if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") done: @@ -978,7 +983,6 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ herr_t ret_value; /* Return value */ @@ -1010,7 +1014,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, corder_bt2_addr = oh->corder_bt2_addr; /* Release the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") oh = NULL; @@ -1022,11 +1026,11 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, } /* end if */ else { /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable, &oh_flags) < 0) + if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Release the object header */ - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") oh = NULL; @@ -1041,7 +1045,7 @@ H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, done: /* Release resources */ - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") if(atable.attrs && H5A_attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") @@ -1101,8 +1105,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, unsigned *oh_flags, - hid_t dxpl_id) +H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1111,7 +1114,6 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, unsigned *oh_flags, /* Check arguments */ HDassert(loc); HDassert(oh); - HDassert(oh_flags); /* Reset the creation order min/max if there's no more attributes on the object */ if(oh->nattrs == 0) @@ -1166,7 +1168,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, unsigned *oh_flags, /* Insert attribute message into object header */ /* (Will increment reference count on shared attributes) */ - if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, &(atable.attrs[u]), oh_flags) < 0) + if(H5O_msg_append_real(loc->file, dxpl_id, oh, H5O_MSG_ATTR, 0, 0, &(atable.attrs[u])) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "can't create message") } /* end for */ @@ -1175,7 +1177,7 @@ H5O_attr_remove_update(const H5O_loc_t *loc, H5O_t *oh, unsigned *oh_flags, HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage") /* Update the modification time, if any */ - if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE, oh_flags) < 0) + if(H5O_touch_oh(loc->file, dxpl_id, oh, FALSE) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update time on object") } /* end if */ @@ -1206,7 +1208,7 @@ done: */ static herr_t H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -1232,7 +1234,7 @@ H5O_attr_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message") /* Indicate that the object header was modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + *oh_modified = TRUE; /* Indicate that this message is the attribute to be deleted */ udata->found = TRUE; @@ -1262,7 +1264,6 @@ herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_remove) @@ -1295,8 +1296,9 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ - op.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_remove_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1305,11 +1307,11 @@ H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) } /* end else */ /* Update the object header information after removing an attribute */ - if(H5O_attr_remove_update(loc, oh, &oh_flags, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1335,7 +1337,6 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, { H5O_t *oh = NULL; /* Pointer to actual object header */ H5A_attr_table_t atable = {0, NULL}; /* Table of attributes */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_remove_by_idx) @@ -1361,7 +1362,7 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, H5O_mesg_operator_t op; /* Wrapper for operator */ /* Build table of attributes for compact storage */ - if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable, &oh_flags) < 0) + if(H5A_compact_build_table(loc->file, dxpl_id, oh, idx_type, order, &atable) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "error building attribute table") /* Check for skipping too many attributes */ @@ -1375,8 +1376,9 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, udata.found = FALSE; /* Iterate over attributes, to locate correct one to delete */ - op.lib_op = H5O_attr_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_remove_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "error deleting attribute") /* Check that we found the attribute */ @@ -1385,11 +1387,11 @@ H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, } /* end else */ /* Update the object header information after removing an attribute */ - if(H5O_attr_remove_update(loc, oh, &oh_flags, dxpl_id) < 0) + if(H5O_attr_remove_update(loc, oh, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTUPDATE, FAIL, "unable to update attribute info") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_ATTR, H5E_PROTECT, FAIL, "unable to release object header") if(atable.attrs && H5A_attr_release_table(&atable) < 0) HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "unable to release attribute table") @@ -1461,7 +1463,7 @@ done: */ static herr_t H5O_attr_exists_cb(H5O_t UNUSED *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned UNUSED sequence, unsigned UNUSED *oh_flags_ptr, void *_udata/*in,out*/) + unsigned UNUSED sequence, hbool_t UNUSED *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ herr_t ret_value = H5_ITER_CONT; /* Return value */ @@ -1501,7 +1503,6 @@ htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ htri_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_exists) @@ -1531,8 +1532,9 @@ H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id) udata.found = FALSE; /* Iterate over existing attributes, checking for attribute with same name */ - op.lib_op = H5O_attr_exists_cb; - if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_attr_exists_cb; + if(H5O_msg_iterate_real(loc->file, oh, H5O_MSG_ATTR, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_BADITER, FAIL, "error checking for existence of attribute") /* Check that we found the attribute */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index a7ecb63..b4413db 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -74,15 +74,15 @@ typedef struct { static herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg, unsigned *oh_flags_ptr); + void *mesg); static herr_t H5O_msg_reset_real(const H5O_msg_class_t *type, void *native); static herr_t H5O_msg_remove_real(const H5O_loc_t *loc, const H5O_msg_class_t *type, int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); static herr_t H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, unsigned *oh_flags_ptr, void *_udata/*in,out*/); + unsigned sequence, hbool_t *oh_modified, void *_udata/*in,out*/); static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, - unsigned update_flags, unsigned *oh_flags_ptr); + unsigned update_flags); /*********************/ @@ -121,7 +121,6 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Metadata cache flags for object header */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5O_msg_create, FAIL) @@ -141,11 +140,11 @@ H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Go append message to object header */ - if(H5O_msg_append(loc->file, dxpl_id, oh, type_id, mesg_flags, update_flags, mesg, &oh_flags) < 0) + if(H5O_msg_append(loc->file, dxpl_id, oh, type_id, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to append to object header") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -171,8 +170,7 @@ done: */ herr_t H5O_msg_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg, - unsigned *oh_flags_ptr) + unsigned mesg_flags, unsigned update_flags, void *mesg) { const H5O_msg_class_t *type; /* Original H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -188,10 +186,9 @@ H5O_msg_append(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, HDassert(type); HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); HDassert(mesg); - HDassert(oh_flags_ptr); /* Append new message to object header */ - if(H5O_msg_append_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg, oh_flags_ptr) < 0) + if(H5O_msg_append_real(f, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINSERT, FAIL, "unable to create new message in header") done: @@ -216,7 +213,7 @@ done: */ herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, - unsigned mesg_flags, unsigned update_flags, void *mesg, unsigned *oh_flags_ptr) + unsigned mesg_flags, unsigned update_flags, void *mesg) { unsigned idx; /* Index of message to modify */ herr_t ret_value = SUCCEED; /* Return value */ @@ -229,14 +226,13 @@ H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *t HDassert(type); HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); HDassert(mesg); - HDassert(oh_flags_ptr); /* Allocate space for a new message */ - if((idx = H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, mesg, oh_flags_ptr)) == UFAIL) + if((idx = H5O_msg_alloc(f, dxpl_id, oh, type, &mesg_flags, mesg)) == UFAIL) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, FAIL, "unable to create new message") /* Copy the information for the message */ - if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) + if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -272,7 +268,6 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header to use */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags to unprotect object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value = SUCCEED; /* Return value */ @@ -298,11 +293,11 @@ H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Call the "real" modify routine */ - if(H5O_msg_write_real(loc->file, dxpl_id, oh, type, mesg_flags, update_flags, mesg, &oh_flags) < 0) + if(H5O_msg_write_real(loc->file, dxpl_id, oh, type, mesg_flags, update_flags, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header message") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -331,7 +326,7 @@ done: */ static herr_t H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, - unsigned mesg_flags, unsigned update_flags, void *mesg, unsigned *oh_flags_ptr) + unsigned mesg_flags, unsigned update_flags, void *mesg) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ unsigned idx; /* Index of message to modify */ @@ -345,7 +340,6 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty HDassert(type); HDassert(mesg); HDassert(0 == (mesg_flags & ~H5O_MSG_FLAG_BITS)); - HDassert(oh_flags_ptr); /* Count similar messages */ for(idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs; idx++, idx_msg++) @@ -384,7 +378,7 @@ H5O_msg_write_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *ty } /* end if */ /* Copy the information for the message */ - if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags, oh_flags_ptr) < 0) + if(H5O_copy_mesg(f, dxpl_id, oh, idx, type, mesg, mesg_flags, update_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message") #ifdef H5O_DEBUG H5O_assert(oh); @@ -1004,7 +998,7 @@ done: */ static herr_t H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, - unsigned *oh_flags_ptr, void *_udata/*in,out*/) + hbool_t *oh_modified, void *_udata/*in,out*/) { H5O_iter_rm_t *udata = (H5O_iter_rm_t *)_udata; /* Operator user data */ htri_t try_remove = FALSE; /* Whether to try removing a message */ @@ -1041,7 +1035,7 @@ H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message") /* Indicate that the object header was modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + *oh_modified = TRUE; } /* end else */ /* Break out now, if we've found the correct message */ @@ -1079,7 +1073,6 @@ H5O_msg_remove_real(const H5O_loc_t *loc, const H5O_msg_class_t *type, int seque H5O_operator_t app_op, void *op_data, hbool_t adj_link, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Start iteration with no flags set on object header */ H5O_iter_rm_t udata; /* User data for iterator */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1109,8 +1102,9 @@ H5O_msg_remove_real(const H5O_loc_t *loc, const H5O_msg_class_t *type, int seque HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Iterate over the messages, deleting appropriate one(s) */ - op.lib_op = H5O_msg_remove_cb; - if(H5O_msg_iterate_real(loc->file, oh, type, TRUE, op, &udata, dxpl_id, &oh_flags) < 0) + op.op_type = H5O_MESG_OP_LIB; + op.u.lib_op = H5O_msg_remove_cb; + if(H5O_msg_iterate_real(loc->file, oh, type, &op, &udata, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "error iterating over messages") /* Fail if we tried to remove any constant messages */ @@ -1118,7 +1112,7 @@ H5O_msg_remove_real(const H5O_loc_t *loc, const H5O_msg_class_t *type, int seque HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to remove constant message(s)") done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1161,7 +1155,6 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, H5O_operator_t app_op, void *op_data, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to actual object header */ - unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Start iteration with no flags set on object header */ const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ H5O_mesg_operator_t op; /* Wrapper for operator */ herr_t ret_value; /* Return value */ @@ -1181,12 +1174,13 @@ H5O_msg_iterate(const H5O_loc_t *loc, unsigned type_id, H5O_operator_t app_op, HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header") /* Call the "real" iterate routine */ - op.app_op = app_op; - if((ret_value = H5O_msg_iterate_real(loc->file, oh, type, FALSE, op, op_data, dxpl_id, &oh_flags)) < 0) + op.op_type = H5O_MESG_OP_APP; + op.u.app_op = app_op; + if((ret_value = H5O_msg_iterate_real(loc->file, oh, type, &op, op_data, dxpl_id)) < 0) HERROR(H5E_OHDR, H5E_BADITER, "unable to iterate over object header messages"); done: - if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, oh_flags) < 0) + if(oh && H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header") FUNC_LEAVE_NOAPI(ret_value) @@ -1226,12 +1220,12 @@ done: */ herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - hbool_t internal, H5O_mesg_operator_t op, void *op_data, hid_t dxpl_id, - unsigned *oh_flags_ptr) + const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id) { H5O_mesg_t *idx_msg; /* Pointer to current message */ unsigned idx; /* Absolute index of current message in all messages */ unsigned sequence; /* Relative index of current message for messages of type */ + hbool_t oh_modified = FALSE; /* Whether the callback modified the object header */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_msg_iterate_real) @@ -1240,8 +1234,8 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, HDassert(f); HDassert(oh); HDassert(type); - HDassert(op.app_op); - HDassert(oh_flags_ptr); + HDassert(op); + HDassert(op->u.app_op); /* Iterate over messages */ for(sequence = 0, idx = 0, idx_msg = &oh->mesg[0]; idx < oh->nmesgs && !ret_value; idx++, idx_msg++) { @@ -1250,10 +1244,10 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, H5O_LOAD_NATIVE(f, dxpl_id, idx_msg, FAIL) /* Check for making an "internal" (i.e. within the H5O package) callback */ - if(internal) - ret_value = (op.lib_op)(oh, idx_msg, sequence, oh_flags_ptr, op_data); + if(op->op_type == H5O_MESG_OP_LIB) + ret_value = (op->u.lib_op)(oh, idx_msg, sequence, &oh_modified, op_data); else - ret_value = (op.app_op)(idx_msg->native, sequence, op_data); + ret_value = (op->u.app_op)(idx_msg->native, sequence, op_data); /* Check for iterator callback indicating to get out of loop */ if(ret_value != 0) @@ -1270,7 +1264,7 @@ H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, done: /* Check if object message was modified */ - if(*oh_flags_ptr & H5AC__DIRTIED_FLAG) { + if(oh_modified) { /* Try to condense object header info */ /* (Since this routine is used to remove messages from an * object header, the header will be condensed after each @@ -1279,8 +1273,13 @@ done: if(H5O_condense_header(f, oh, dxpl_id) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTPACK, FAIL, "can't pack object header") - if(H5O_touch_oh(f, dxpl_id, oh, FALSE, oh_flags_ptr) < 0) + /* Mark object header as changed */ + if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") + + /* Mark object header as dirty in cache */ + if(H5AC_mark_pinned_or_protected_entry_dirty(f, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -1711,7 +1710,7 @@ done: */ unsigned H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, - unsigned *mesg_flags, void *native, unsigned *oh_flags_ptr) + unsigned *mesg_flags, void *native) { htri_t shared_mesg; /* Should this message be stored in the Shared Message table? */ unsigned ret_value = UFAIL; /* Return value */ @@ -1725,7 +1724,6 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, HDassert(!(*mesg_flags & H5O_MSG_FLAG_SHARED)); HDassert(type); HDassert(native); - HDassert(oh_flags_ptr); /* Check if message is already shared */ if((shared_mesg = H5O_msg_is_shared(type->id, native)) < 0) @@ -1749,7 +1747,7 @@ H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, } /* end else */ /* Allocate space in the object header for the message */ - if((ret_value = H5O_alloc(f, dxpl_id, oh, type, native, oh_flags_ptr)) == UFAIL) + if((ret_value = H5O_alloc(f, dxpl_id, oh, type, native)) == UFAIL) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, UFAIL, "unable to allocate space for message") /* Get the message's "creation index", if it has one */ @@ -1780,7 +1778,7 @@ done: static herr_t H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, const H5O_msg_class_t *type, const void *mesg, unsigned mesg_flags, - unsigned update_flags, unsigned *oh_flags_ptr) + unsigned update_flags) { H5O_mesg_t *idx_msg = &oh->mesg[idx]; /* Pointer to message to modify */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1791,9 +1789,8 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, HDassert(f); HDassert(oh); HDassert(type); - HDassert(mesg); - HDassert(oh_flags_ptr); HDassert(type->copy); + HDassert(mesg); /* Reset existing native information for the header's message */ H5O_msg_reset_real(type, idx_msg->native); @@ -1808,11 +1805,12 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, /* Update the modification time, if requested */ if(update_flags & H5O_UPDATE_TIME) - if(H5O_touch_oh(f, dxpl_id, oh, FALSE, oh_flags_ptr) < 0) + if(H5O_touch_oh(f, dxpl_id, oh, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUPDATE, FAIL, "unable to update time on object") - /* Mark the object header as modified */ - *oh_flags_ptr |= H5AC__DIRTIED_FLAG; + /* Mark object header as dirty in cache */ + if(H5AC_mark_pinned_or_protected_entry_dirty(f, oh) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTMARKDIRTY, FAIL, "unable to mark object header as dirty") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Opkg.h b/src/H5Opkg.h index d8e63dc..72d9c46 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -291,12 +291,18 @@ typedef struct H5O_addr_map_t { /* Typedef for "internal library" iteration operations */ typedef herr_t (*H5O_lib_operator_t)(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, - unsigned sequence, unsigned *oh_flags_ptr/*out*/, void *operator_data/*in,out*/); + unsigned sequence, hbool_t *oh_modified/*out*/, void *operator_data/*in,out*/); /* Some syntactic sugar to make the compiler happy with two different kinds of iterator callbacks */ -typedef union { - H5O_operator_t app_op; /* Application callback for each message */ - H5O_lib_operator_t lib_op; /* Library internal callback for each message */ +typedef struct { + enum { + H5O_MESG_OP_APP, /* Application callback */ + H5O_MESG_OP_LIB /* Library internal callback */ + } op_type; + union { + H5O_operator_t app_op; /* Application callback for each message */ + H5O_lib_operator_t lib_op; /* Library internal callback for each message */ + } u; } H5O_mesg_operator_t; @@ -433,11 +439,10 @@ H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); /* Object header message routines */ H5_DLL unsigned H5O_msg_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg, - unsigned *oh_flags_ptr); + const H5O_msg_class_t *type, unsigned *mesg_flags, void *mesg); H5_DLL herr_t H5O_msg_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type, unsigned mesg_flags, unsigned update_flags, - void *mesg, unsigned *oh_flags_ptr); + void *mesg); H5_DLL void *H5O_msg_read_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned type_id, void *mesg); H5_DLL void *H5O_msg_free_real(const H5O_msg_class_t *type, void *mesg); @@ -448,12 +453,11 @@ H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hid_t dxpl_id, hbool_t *shared, H5O_copy_t *cpy_info, void *udata); H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, - hbool_t internal, H5O_mesg_operator_t op, void *op_data, hid_t dxpl_id, - unsigned *oh_flags_ptr); + const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); /* Object header allocation routines */ H5_DLL unsigned H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_msg_class_t *type, const void *mesg, hbool_t *oh_dirtied_ptr); + const H5O_msg_class_t *type, const void *mesg); H5_DLL herr_t H5O_condense_header(H5F_t *f, H5O_t *oh, hid_t dxpl_id); H5_DLL herr_t H5O_release_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_mesg_t *mesg, hbool_t adj_link); diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 883f262..88c2a33 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -401,15 +401,13 @@ H5_DLL herr_t H5O_open(const H5O_loc_t *loc); H5_DLL herr_t H5O_close(H5O_loc_t *loc); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); H5_DLL struct H5O_t *H5O_protect(H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, struct H5O_t *oh, hid_t dxpl_id, - unsigned oh_flags); +H5_DLL herr_t H5O_unprotect(H5O_loc_t *loc, struct H5O_t *oh); H5_DLL herr_t H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id); H5_DLL herr_t H5O_touch_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, - hbool_t force, unsigned *oh_flags_ptr); + hbool_t force); #ifdef H5O_ENABLE_BOGUS H5_DLL herr_t H5O_bogus(H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, - unsigned * oh_flags_ptr); +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh); #endif /* H5O_ENABLE_BOGUS */ H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL herr_t H5O_get_info(H5O_loc_t *oloc, H5O_info_t *oinfo, hid_t dxpl_id); @@ -420,8 +418,7 @@ H5_DLL herr_t H5O_get_create_plist(const H5O_loc_t *loc, hid_t dxpl_id, struct H H5_DLL herr_t H5O_msg_create(const H5O_loc_t *loc, unsigned type_id, unsigned mesg_flags, unsigned update_flags, void *mesg, hid_t dxpl_id); H5_DLL herr_t H5O_msg_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, - unsigned mesg_flags, unsigned update_flags, void *mesg, - unsigned *oh_flags_ptr); + unsigned mesg_flags, unsigned update_flags, void *mesg); H5_DLL herr_t H5O_msg_write(const H5O_loc_t *loc, unsigned type_id, unsigned flags, unsigned update_flags, void *mesg, hid_t dxpl_id); H5_DLL void *H5O_msg_read(const H5O_loc_t *loc, unsigned type_id, void *mesg, @@ -1089,8 +1089,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, - unsigned *oh_flags_ptr) +H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1099,13 +1098,12 @@ H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, HDassert(f); HDassert(oh); HDassert(ds); - HDassert(oh_flags_ptr); switch (H5S_GET_EXTENT_TYPE(ds)) { case H5S_NULL: case H5S_SCALAR: case H5S_SIMPLE: - if(H5O_msg_append(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent), oh_flags_ptr) < 0) + if(H5O_msg_append(f, dxpl_id, oh, H5O_SDSPACE_ID, 0, 0, &(ds->extent)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't update simple data space message") break; diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index e36a791..7b57f06 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -202,19 +202,19 @@ H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds); H5_DLL hbool_t H5S_has_extent(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_ndims(const H5S_t *ds); H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[]/*out*/, - hsize_t max_dims[]/*out*/); + hsize_t max_dims[]/*out*/); H5_DLL herr_t H5S_write(struct H5O_loc_t *loc, const H5S_t *space, hbool_t update_time, hid_t dxpl_id); H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, - const H5S_t *ds, unsigned * oh_flags_ptr); + const H5S_t *ds); H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id); H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size); H5_DLL int H5S_set_extent(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size); H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], - const hsize_t maxdims[/*rank*/]); + const hsize_t maxdims[/*rank*/]); H5_DLL herr_t H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, - int indent, int fwidth); + int indent, int fwidth); H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); @@ -222,9 +222,9 @@ H5_DLL hsize_t H5S_extent_nelem(const H5S_extent_t *ext); H5_DLL herr_t H5S_select_deserialize(H5S_t *space, const uint8_t *buf); H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space); H5_DLL herr_t H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, - H5D_operator_t op, void *operator_data); -H5_DLL herr_t H5S_select_fill(void *fill, size_t fill_size, - const H5S_t *space, void *buf); + H5D_operator_t op, void *operator_data); +H5_DLL herr_t H5S_select_fill(void *fill, size_t fill_size, const H5S_t *space, + void *buf); H5_DLL htri_t H5S_select_valid(const H5S_t *space); H5_DLL hssize_t H5S_get_select_npoints(const H5S_t *space); H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); |