summaryrefslogtreecommitdiffstats
path: root/src/H5O.c
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-09-10 17:05:19 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-09-10 17:05:19 (GMT)
commit6d928cf05ef860086825665cbfff18c6d1c15b3c (patch)
tree1236f11f1935fefcd8d6ec04631e5313dba3baaa /src/H5O.c
parent14f7f3e53d97c3f31a129145e7ea7e9cd55008dc (diff)
downloadhdf5-6d928cf05ef860086825665cbfff18c6d1c15b3c.zip
hdf5-6d928cf05ef860086825665cbfff18c6d1c15b3c.tar.gz
hdf5-6d928cf05ef860086825665cbfff18c6d1c15b3c.tar.bz2
[svn-r7456] Purpose:
Removal of H5AC_find() Description: The H5AC_find() function is mostly redundant and with the new Flexible Parallel HDF5 stuff, we need to do locking on metadata returned from the H5AC_find() anyway. So, all of the locking stuff will be placed in the H5AC_{un}protect() functions. The H5AC_find() is no longer needed. Solution: Replaced all H5AC_finds with H5AC_protects and H5AC_unprotects. Platforms tested: Linux (Fortran & C++) Solaris (Fortran) Irix (Parallel & Fortran) Misc. update:
Diffstat (limited to 'src/H5O.c')
-rw-r--r--src/H5O.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5O.c b/src/H5O.c
index e34f750..14dfd74 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1332,13 +1332,17 @@ H5O_count_real (H5G_entry_t *ent, const H5O_class_t *type, hid_t dxpl_id)
assert (type);
/* Load the object header */
- if (NULL==(oh=H5AC_find(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL)))
+ if (NULL == (oh = H5AC_protect(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL)))
HGOTO_ERROR (H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header");
for (u=acc=0; u<oh->nmesgs; u++) {
if (oh->mesg[u].type==type)
acc++;
}
+
+ if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) != SUCCEED)
+ HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header");
+
oh=NULL;
/* Set return value */
@@ -1432,7 +1436,7 @@ H5O_exists_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d
assert(sequence>=0);
/* Load the object header */
- if (NULL==(oh=H5AC_find(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL)))
+ if (NULL == (oh = H5AC_protect(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL)))
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header");
/* Scan through the messages looking for the right one */
@@ -1442,6 +1446,10 @@ H5O_exists_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d
if (--sequence<0)
break;
}
+
+ if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) != SUCCEED)
+ HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header");
+
oh=NULL;
/* Set return value */
@@ -2024,6 +2032,8 @@ H5O_unprotect(H5G_entry_t *ent, H5O_t *oh, hid_t dxpl_id)
if (H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0)
HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header");
+ oh = NULL;
+
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5O_unprotect() */