diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2012-12-14 17:33:18 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2012-12-14 17:33:18 (GMT) |
commit | ebebe2dd934b0b0211ee3be28e5b2f9bb9f7f14e (patch) | |
tree | f4d06a33ba454171d91874957def4cec18ea4924 /src/H5Oainfo.c | |
parent | cec83436f2abbe52e15c76a53703d5a10b237470 (diff) | |
download | hdf5-ebebe2dd934b0b0211ee3be28e5b2f9bb9f7f14e.zip hdf5-ebebe2dd934b0b0211ee3be28e5b2f9bb9f7f14e.tar.gz hdf5-ebebe2dd934b0b0211ee3be28e5b2f9bb9f7f14e.tar.bz2 |
[svn-r23104] Purpose: Add object header flush dependencies
Description:
Added flush dependencies between object header chunks. Also added a new object
header proxy object, which is a child dependency of all object header chunks.
All objects which are child dependencies of an object header should set up a
flush dependency on the object header proxy, so the dependency applies to all
object header chunks.
Tested: ummon; jam (fails ph5diff -v, unrelated), koala, ostrich (h5committest)
Diffstat (limited to 'src/H5Oainfo.c')
-rw-r--r-- | src/H5Oainfo.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index bbdfe2e..a3a0766 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -323,7 +323,9 @@ H5O_ainfo_free(void *mesg) /*------------------------------------------------------------------------- * Function: H5O_ainfo_delete * - * Purpose: Free file space referenced by message + * Purpose: Free file space referenced by message. Note that open_oh + * *must* be non-NULL - this means that calls to + * H5O_msg_delete must include an oh if the type is ainfo. * * Return: Non-negative on success/Negative on failure * @@ -336,6 +338,7 @@ static herr_t H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) { H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; + H5O_proxy_t *oh_proxy = NULL; /* Object header proxy */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -343,14 +346,26 @@ H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) /* check args */ HDassert(f); HDassert(ainfo); + HDassert(open_oh); /* If the object is using "dense" attribute storage, delete it */ - if(H5F_addr_defined(ainfo->fheap_addr)) - /*!FIXME use ohdr proxy -NAF */ - if(H5A_dense_delete(f, dxpl_id, ainfo, open_oh) < 0) + if(H5F_addr_defined(ainfo->fheap_addr)) { + /* Check for SWMR writes to the file */ + if(H5F_INTENT(f) & H5F_ACC_SWMR_WRITE) + /* Pin the attribute's object header proxy */ + if(NULL == (oh_proxy = H5O_pin_flush_dep_proxy_oh(f, dxpl_id, open_oh))) + HGOTO_ERROR(H5E_ATTR, H5E_CANTPIN, FAIL, "unable to pin object header proxy") + + /* Delete the attribute */ + if(H5A_dense_delete(f, dxpl_id, ainfo, oh_proxy) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free dense attribute storage") + } /* end if */ done: + /* Release resources */ + if(oh_proxy && H5O_unpin_flush_dep_proxy(oh_proxy) < 0) + HDONE_ERROR(H5E_ATTR, H5E_CANTUNPIN, FAIL, "unable to unpin attribute object header proxy") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_ainfo_delete() */ |