diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-15 20:30:48 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-04-15 20:30:48 (GMT) |
commit | 80d5ae2fc16e800fbc30008d7771408a40cfdcbf (patch) | |
tree | 8345fd40909d129b14146a027684db235cd28988 /src/H5R.c | |
parent | 4fa6fd807dddf42e14d2c4c1c40caf11674bb849 (diff) | |
download | hdf5-80d5ae2fc16e800fbc30008d7771408a40cfdcbf.zip hdf5-80d5ae2fc16e800fbc30008d7771408a40cfdcbf.tar.gz hdf5-80d5ae2fc16e800fbc30008d7771408a40cfdcbf.tar.bz2 |
[svn-r18574] Description:
Bring r18571 from trunk to 1.8 branch:
Bring r18542 from metadata journaling "merging" branch to trunk:
Bring new object header pin/unpin & protect/unprotect routines and
split-out object header chunk proxy changes from metadata_journaling branch to
"merging" branch, along with some other minor tweaks to clean up compiler
warnings, etc.
Also: clean up chunk protect/unprotect calls when allocating or freeing
space in a chunk, optimize metadata accumulator code to avoid some re-reading
of information from the file, refactor H5O_pin/H5O_unpin from way they are done
on the merging branch back to way they were previously done on trunk, other
minor code cleanups, etc.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
(h5committested on trunk)
Diffstat (limited to 'src/H5R.c')
-rw-r--r-- | src/H5R.c | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -366,8 +366,9 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re H5O_loc_t oloc; /* Object location */ H5G_name_t path; /* Path of object */ H5G_loc_t loc; /* Group location */ + unsigned rc; /* Reference count of object */ H5O_type_t obj_type; /* Type of object */ - hid_t ret_value; + hid_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5R_dereference) @@ -415,8 +416,9 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ - /* Check to make certain that this object hasn't been deleted since the reference was created */ - if(H5O_link(&oloc, 0, dxpl_id) <= 0) + /* Get the # of links for object, and its type */ + /* (To check to make certain that this object hasn't been deleted since the reference was created) */ + if(H5O_get_rc_and_type(&oloc, dxpl_id, &rc, &obj_type) < 0 || 0 == rc) HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") /* Construct a group location for opening the object */ @@ -424,10 +426,6 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_re loc.oloc = &oloc; loc.path = &path; - /* Get the type of the object */ - if(H5O_obj_type(&oloc, &obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get object type") - /* Open the object */ switch(obj_type) { case H5O_TYPE_GROUP: @@ -688,6 +686,7 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, const void *_ref, H5O_type_t *obj_type) { H5O_loc_t oloc; /* Object location */ + unsigned rc; /* Reference count of object */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5R_get_obj_type) @@ -736,14 +735,11 @@ H5R_get_obj_type(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, HGOTO_ERROR(H5E_REFERENCE, H5E_UNSUPPORTED, FAIL, "internal error (unknown reference type)") } /* end switch */ - /* Check to make certain that this object hasn't been deleted since the reference was created */ - if(H5O_link(&oloc, 0, dxpl_id) <= 0) + /* Get the # of links for object, and its type */ + /* (To check to make certain that this object hasn't been deleted since the reference was created) */ + if(H5O_get_rc_and_type(&oloc, dxpl_id, &rc, obj_type) < 0 || 0 == rc) HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object") - /* Get the object type */ - if(H5O_obj_type(&oloc, obj_type, dxpl_id) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to get object type") - done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5R_get_obj_type() */ |