summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-12-19 05:45:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-12-19 05:45:56 (GMT)
commitcccd3d26d61348db189ec262548fab26f062a427 (patch)
treeae599a7ab23d0330d1d92e85551c058ec42ba0cd /src/H5O.c
parent856b2e2c259e94516c9b04e57368018fd44f58cf (diff)
downloadhdf5-cccd3d26d61348db189ec262548fab26f062a427.zip
hdf5-cccd3d26d61348db189ec262548fab26f062a427.tar.gz
hdf5-cccd3d26d61348db189ec262548fab26f062a427.tar.bz2
[svn-r18038] Description:
Bring r18037 from trunk to 1.8 branch: Bring r18035 from merge_metadata_journaling branch to trunk: More "brush clearing" convergence between metadata_journaling branch and the trunk. Tested on: Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode (h5committested on trunk)
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/H5O.c b/src/H5O.c
index ebe1204..73860cd 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1192,7 +1192,8 @@ H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, hid_t ocpl_id,
/* Cache object header */
if(H5AC_set(f, dxpl_id, H5AC_OHDR, oh_addr, oh, H5AC__NO_FLAGS_SET) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to cache object header")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "unable to cache object header")
+ oh = NULL;
/* Set up object location */
loc->file = f;
@@ -1420,7 +1421,7 @@ int
H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags)
{
haddr_t addr = H5O_OH_GET_ADDR(oh); /* Object header address */
- int ret_value; /* Return value */
+ int ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5O_link_oh, FAIL)
@@ -1430,7 +1431,11 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags)
/* Check for too large of an adjustment */
if((unsigned)(-adjust) > oh->nlink)
HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "link count would be negative")
+
+ /* Adjust the link count for the object header */
oh->nlink += adjust;
+
+ /* Mark object header as dirty in cache */
*oh_flags |= H5AC__DIRTIED_FLAG;
/* Check if the object should be deleted */
@@ -1465,7 +1470,7 @@ H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, unsigned *oh_flags)
/* Adjust the link count for the object header */
oh->nlink += adjust;
- /* Mark the object header for deletion */
+ /* Mark object header as dirty in cache */
*oh_flags |= H5AC__DIRTIED_FLAG;
} /* end if */
@@ -1576,8 +1581,8 @@ done:
H5O_t *
H5O_pin(H5O_loc_t *loc, hid_t dxpl_id)
{
- H5O_t *oh = NULL; /* Object header */
- H5O_t *ret_value; /* Return value */
+ H5O_t *oh = NULL; /* Object header */
+ H5O_t *ret_value; /* Return value */
FUNC_ENTER_NOAPI(H5O_pin, NULL)
@@ -1758,7 +1763,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5O_touch(H5O_loc_t *loc, hbool_t force, hid_t dxpl_id)
+H5O_touch(const H5O_loc_t *loc, hbool_t force, hid_t dxpl_id)
{
H5O_t *oh = NULL; /* Object header to modify */
unsigned oh_flags = H5AC__NO_FLAGS_SET; /* Flags for unprotecting object header */