diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-10-13 15:42:01 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-10-13 15:42:01 (GMT) |
commit | d99e23638ba96b71a39c46cbe1cb6369a3b7467c (patch) | |
tree | fc7be3c604fd16f3e26b6179d620a1ad1604b452 /src/H5L.c | |
parent | 2342d695dce629e1ee19610e97e873546ab91a82 (diff) | |
download | hdf5-d99e23638ba96b71a39c46cbe1cb6369a3b7467c.zip hdf5-d99e23638ba96b71a39c46cbe1cb6369a3b7467c.tar.gz hdf5-d99e23638ba96b71a39c46cbe1cb6369a3b7467c.tar.bz2 |
[svn-r19587] Description:
Address issue with object headers being created getting evicted from
the metadata cache cache before they are completely initialized. This is
done by pinning the object header in the cache until it is completely
initialized and attached to a group.
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 (amani) 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, w/threadsafe, in production mode
Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode
Mac OS X/32 10.6.4 (amazon) in debug mode
Mac OS X/32 10.6.4 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Mac OS X/32 10.6.4 (amazon) w/parallel, in debug mode
Diffstat (limited to 'src/H5L.c')
-rw-r--r-- | src/H5L.c | 22 |
1 files changed, 20 insertions, 2 deletions
@@ -1664,8 +1664,9 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED H5G_t *grp = NULL; /* H5G_t for this group, opened to pass to user callback */ hid_t grp_id = FAIL; /* Id for this group (passed to user callback */ H5G_loc_t temp_loc; /* For UD callback */ - hbool_t temp_loc_init = FALSE; - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t temp_loc_init = FALSE; /* Temporary location for UD callback (temp_loc) has been initialized */ + hbool_t obj_created = FALSE; /* Whether an object was created (through a hard link) */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5L_link_cb) @@ -1690,6 +1691,9 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED /* Set object path to use for setting object name (below) */ udata->path = new_loc.path; + + /* Indicate that an object was created */ + obj_created = TRUE; } /* end if */ else { /* Check that both objects are in same file */ @@ -1763,6 +1767,20 @@ H5L_link_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t UNUSED } /* end if */ done: + /* Check if an object was created */ + if(obj_created) { + H5O_loc_t oloc; /* Object location for created object */ + + /* Set up object location */ + HDmemset(&oloc, 0, sizeof(oloc)); + oloc.file = grp_loc->oloc->file; + oloc.addr = udata->lnk->u.hard.addr; + + /* Decrement refcount on superblock extension's object header in memory */ + if(H5O_dec_rc_by_loc(&oloc, udata->dxpl_id) < 0) + HDONE_ERROR(H5E_LINK, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") + } /* end if */ + /* Close the location given to the user callback if it was created */ if(grp_id >= 0) { if(H5I_dec_app_ref(grp_id) < 0) |