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/H5SH.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/H5SH.c')
-rw-r--r-- | src/H5SH.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -71,6 +71,11 @@ H5FL_DEFINE(H5SH_t); * koziol@ncsa.uiuc.edu * Mar 23 2005 * + * Changes: John Mainzer -- 6/7/05 + * Removed code modifying the is_dirty field of the cache + * info. Management of this field is in the process of + * being moved to the H5C code. + * *------------------------------------------------------------------------- */ herr_t @@ -96,7 +101,6 @@ H5SH_create(H5F_t *f, hid_t dxpl_id, haddr_t *addr_p, H5SH_data_type_t heap_type HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for segmented heap info") /* Assign internal information */ - sh->cache_info.is_dirty = TRUE; sh->heap_type = heap_type; if(sh->heap_type == H5SH_RAW) sh->file_mem_type = H5FD_MEM_DRAW; @@ -229,11 +233,19 @@ done: * koziol@ncsa.uiuc.edu * Mar 25 2005 * + * Modifications: + * + * John Mainzer, 6/16/05 + * Modified the function to use the new dirtied parameter of + * of H5AC_unprotect() instead of modifying the is_dirty + * field of the cache info. + * *------------------------------------------------------------------------- */ herr_t H5SH_alloc(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t size, haddr_t *obj_addr_p) { + hbool_t sh_dirtied = FALSE; H5SH_t *sh = NULL; /* Segmented heap info */ haddr_t free_addr; /* Address of free block */ hsize_t free_len; /* Address of free block */ @@ -318,7 +330,7 @@ H5SH_alloc(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t size, haddr_t *obj_add done: /* Release the block tracker info */ - if (sh && H5AC_unprotect(f, dxpl_id, H5AC_SGHP, addr, sh, H5AC__NO_FLAGS_SET) < 0) + if (sh && H5AC_unprotect(f, dxpl_id, H5AC_SGHP, addr, sh, sh_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release segmented heap info") FUNC_LEAVE_NOAPI(ret_value) |