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/H5B2dbg.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/H5B2dbg.c')
-rw-r--r-- | src/H5B2dbg.c | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/src/H5B2dbg.c b/src/H5B2dbg.c index b73bf49..d308bdb 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -43,12 +43,20 @@ * koziol@ncsa.uiuc.edu * Feb 2 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 H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type) { + hbool_t bt2_dirtied = FALSE; H5B2_t *bt2 = NULL; H5B2_shared_t *shared; /* Shared B-tree information */ herr_t ret_value=SUCCEED; /* Return value */ @@ -129,7 +137,7 @@ H5B2_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, shared->merge_leaf_nrec); done: - if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__NO_FLAGS_SET) < 0) + if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, bt2_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") FUNC_LEAVE_NOAPI(ret_value) @@ -147,13 +155,22 @@ done: * koziol@ncsa.uiuc.edu * Feb 4 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 H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec) { + hbool_t bt2_dirtied = FALSE; H5B2_t *bt2 = NULL; + hbool_t internal_dirtied = FALSE; H5B2_internal_t *internal = NULL; H5B2_shared_t *shared; /* Shared B-tree information */ unsigned u; /* Local index variable */ @@ -188,7 +205,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree internal node") /* Release the B-tree header */ - if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, bt2_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; @@ -241,7 +258,7 @@ H5B2_int_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, internal->node_ptrs[u].addr); done: - if (internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, H5AC__NO_FLAGS_SET) < 0) + if (internal && H5AC_unprotect(f, dxpl_id, H5AC_BT2_INT, addr, internal, internal_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree internal node") FUNC_LEAVE_NOAPI(ret_value) @@ -259,13 +276,22 @@ done: * koziol@ncsa.uiuc.edu * Feb 7 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 H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec) { + hbool_t bt2_dirtied = FALSE; H5B2_t *bt2 = NULL; + hbool_t leaf_dirtied = FALSE; H5B2_leaf_t *leaf = NULL; H5B2_shared_t *shared; /* Shared B-tree information */ unsigned u; /* Local index variable */ @@ -300,7 +326,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load B-tree leaf node") /* Release the B-tree header */ - if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, H5AC__NO_FLAGS_SET) < 0) + if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, hdr_addr, bt2, bt2_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree header") bt2 = NULL; @@ -337,7 +363,7 @@ H5B2_leaf_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, } /* end for */ done: - if (leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, H5AC__NO_FLAGS_SET) < 0) + if (leaf && H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, addr, leaf, leaf_dirtied, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree leaf node") FUNC_LEAVE_NOAPI(ret_value) |