diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2005-06-24 06:30:29 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2005-06-24 06:30:29 (GMT) |
commit | 7f8e3460261851cdad1e344d8929d2817e3149ad (patch) | |
tree | 760d0e8dd581c4d4245a7e8acf51254f0c29d1ad /src/H5G.c | |
parent | 2ab6b12b552e9260e2e76640a788b5a3744c6a9f (diff) | |
download | hdf5-7f8e3460261851cdad1e344d8929d2817e3149ad.zip hdf5-7f8e3460261851cdad1e344d8929d2817e3149ad.tar.gz hdf5-7f8e3460261851cdad1e344d8929d2817e3149ad.tar.bz2 |
[svn-r10978] Purpose:
Interim checkin of code changes moving management of the is_dirty flag
into the cache code.
Description:
Prior to this checkin, management of the is_dirty flag was handled
above the level of the metadata cache. This can no longer be allowed,
as it introduces a race condition in the proposed fix for a cache
coherency bug in PHDF5.
Solution:
Move management fo the is_dirty flag to the cache code proper.
Entries are now marked as dirty via a flag on the unprotect call.
Platforms tested:
h5committested
Misc. update:
Diffstat (limited to 'src/H5G.c')
-rw-r--r-- | src/H5G.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -1698,6 +1698,11 @@ done: * Pedro Vicente, <pvn@ncsa.uiuc.edu> 22 Aug 2002 * Added `id to name' support. * + * John Mainzer - 6/8/05 + * Modified function to use the new dirtied parmeter of + * H5AC_unprotect(), which allows management of the is_dirty + * field of the cache info to be moved into the cache code. + * *------------------------------------------------------------------------- */ static herr_t @@ -1710,6 +1715,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, char *linkval = NULL; /*the copied link value */ H5G_entry_t tmp_grp_ent; /* Temporary copy of group entry */ H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */ + hbool_t dirtied = FALSE; const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ @@ -1730,7 +1736,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, linkval = H5MM_xstrdup (clv); assert(linkval); - if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr) < 0) + if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, dirtied) < 0) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") /* Hold the entry's name (& old_name) to restore later */ @@ -2781,6 +2787,11 @@ done: * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002 * Added `id to name' support. * + * John Mainzer - 6/8/05 + * Modified function to use the new dirtied parmeter of + * H5AC_unprotect(), which allows management of the is_dirty + * field of the cache info to be moved into the cache code. + * *------------------------------------------------------------------------- */ herr_t @@ -2810,6 +2821,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, */ if (statbuf) { if (H5G_CACHED_SLINK==obj_ent.type) { + hbool_t dirtied = FALSE; const H5HL_t *heap; /* Named object is a symbolic link */ @@ -2823,7 +2835,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, statbuf->linklen = HDstrlen(s) + 1; /*count the null terminator*/ - if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr) < 0) + if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, dirtied) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") statbuf->objno = 0; @@ -3040,6 +3052,11 @@ done: * Pedro Vicente, <pvn@ncsa.uiuc.edu> 18 Sep 2002 * Added `id to name' support. * + * John Mainzer - 6/8/05 + * Modified function to use the new dirtied parmeter of + * H5AC_unprotect(), which allows management of the is_dirty + * field of the cache info to be moved into the cache code. + * *------------------------------------------------------------------------- */ static herr_t @@ -3048,6 +3065,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, const char *s = NULL; H5G_entry_t grp_ent, obj_ent; H5O_stab_t stab_mesg; + hbool_t dirtied = FALSE; const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ @@ -3079,7 +3097,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, if (size>0 && buf) HDstrncpy (buf, s, size); - if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr) < 0) + if (H5HL_unprotect(grp_ent.file, dxpl_id, heap, stab_mesg.heap_addr, dirtied) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") done: |