diff options
-rw-r--r-- | src/H5Aint.c | 2 | ||||
-rw-r--r-- | src/H5Dearray.c | 4 | ||||
-rw-r--r-- | src/H5Dfarray.c | 4 | ||||
-rw-r--r-- | src/H5Dint.c | 11 | ||||
-rw-r--r-- | src/H5Dvirtual.c | 4 | ||||
-rw-r--r-- | src/H5F.c | 2 | ||||
-rw-r--r-- | src/H5Fefc.c | 8 | ||||
-rw-r--r-- | src/H5Fint.c | 23 | ||||
-rw-r--r-- | src/H5Fmount.c | 4 | ||||
-rw-r--r-- | src/H5Fprivate.h | 5 | ||||
-rw-r--r-- | src/H5Fquery.c | 25 | ||||
-rw-r--r-- | src/H5Fsuper.c | 2 | ||||
-rw-r--r-- | src/H5Gint.c | 17 | ||||
-rw-r--r-- | src/H5Gtraverse.c | 2 | ||||
-rw-r--r-- | src/H5O.c | 15 | ||||
-rw-r--r-- | src/H5Ocopy.c | 2 | ||||
-rw-r--r-- | src/H5Oprivate.h | 2 | ||||
-rw-r--r-- | src/H5SM.c | 2 | ||||
-rw-r--r-- | src/H5T.c | 4 | ||||
-rw-r--r-- | src/H5Tcommit.c | 6 | ||||
-rw-r--r-- | test/efc.c | 312 | ||||
-rw-r--r-- | test/evict_on_close.c | 150 | ||||
-rw-r--r-- | test/ohdr.c | 14 |
23 files changed, 336 insertions, 284 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c index 66af0ff..e31cd83 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -1050,7 +1050,7 @@ H5A_close(H5A_t *attr) HDassert(attr->shared); /* Close the object's symbol-table entry */ - if(attr->obj_opened && (H5O_close(&(attr->oloc)) < 0)) + if(attr->obj_opened && (H5O_close(&(attr->oloc), NULL) < 0)) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") /* Reference count can be 0. It only happens when H5A_create fails. */ diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 9f95b30..3f12e97 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -657,7 +657,7 @@ H5D__earray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ - if(H5O_close(&obj_loc) < 0) + if(H5O_close(&obj_loc, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") /* Create user data */ @@ -676,7 +676,7 @@ done: /* Close object header */ if(obj_opened) { - if(H5O_close(&obj_loc) < 0) + if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") } /* end if */ } /* end if */ diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c index 5f82e59..212f1f1 100644 --- a/src/H5Dfarray.c +++ b/src/H5Dfarray.c @@ -497,7 +497,7 @@ H5D__farray_crt_dbg_context(H5F_t *f, hid_t dxpl_id, haddr_t obj_addr) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't get layout info") /* close the object header */ - if(H5O_close(&obj_loc) < 0) + if(H5O_close(&obj_loc, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") /* Create user data */ @@ -516,7 +516,7 @@ done: /* Close object header */ if(obj_opened) { - if(H5O_close(&obj_loc) < 0) + if(H5O_close(&obj_loc, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, NULL, "can't close object header") } /* end if */ } /* end if */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 1f34c81..5a11581 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1303,7 +1303,7 @@ done: if(H5F_addr_defined(new_dset->oloc.addr)) { if(H5O_dec_rc_by_loc(&(new_dset->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") - if(H5O_close(&(new_dset->oloc)) < 0) + if(H5O_close(&(new_dset->oloc), NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release object header") if(file) { if(H5O_delete(file, dxpl_id, new_dset->oloc.addr) < 0) @@ -1738,7 +1738,7 @@ H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) done: if(ret_value < 0) { - if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc)) < 0) + if(H5F_addr_defined(dataset->oloc.addr) && H5O_close(&(dataset->oloc), NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") if(dataset->shared) { if(layout_init) @@ -1782,6 +1782,7 @@ H5D_close(H5D_t *dataset) { hbool_t free_failed = FALSE; /* Set if freeing sub-components failed */ hbool_t corked; /* Whether the dataset is corked or not */ + hbool_t file_closed = TRUE; /* H5O_close also closed the file? */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1915,11 +1916,11 @@ H5D_close(H5D_t *dataset) /* Close the dataset object */ /* (This closes the file, if this is the last object open) */ - if(H5O_close(&(dataset->oloc)) < 0) + if(H5O_close(&(dataset->oloc), &file_closed) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Evict dataset metadata if evicting on close */ - if(!H5F_CLOSING(dataset->oloc.file) && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { + if(!file_closed && H5F_SHARED(dataset->oloc.file) && H5F_EVICT_ON_CLOSE(dataset->oloc.file)) { if(H5AC_flush_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, H5AC_ind_read_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") if(H5AC_evict_tagged_metadata(dataset->oloc.file, dataset->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) @@ -1943,7 +1944,7 @@ H5D_close(H5D_t *dataset) /* Check reference count for this object in the top file */ if(H5FO_top_count(dataset->oloc.file, dataset->oloc.addr) == 0) { - if(H5O_close(&(dataset->oloc)) < 0) + if(H5O_close(&(dataset->oloc), NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ else diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 9a90fa7..3780b88 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -807,7 +807,7 @@ H5D__virtual_open_source_dset(const H5D_t *vdset, done: /* Close source file */ if(src_file_open) - if(H5F_try_close(src_file) < 0) + if(H5F_try_close(src_file, NULL) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "can't close source file") FUNC_LEAVE_NOAPI(ret_value) @@ -2931,7 +2931,7 @@ H5D__virtual_release_source_dset_files(H5D_virtual_held_file_t *head) * essentially "private" to the virtual dataset, since it wasn't * opened through an API routine -QAK) */ - if(H5F_try_close(head->file) < 0) + if(H5F_try_close(head->file, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") /* Delete node */ @@ -580,7 +580,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id) new_file->file_id = ret_value; done: - if(ret_value < 0 && new_file && H5F_try_close(new_file) < 0) + if(ret_value < 0 && new_file && H5F_try_close(new_file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") FUNC_LEAVE_API(ret_value) diff --git a/src/H5Fefc.c b/src/H5Fefc.c index 5e3deb1..42bf5d8 100644 --- a/src/H5Fefc.c +++ b/src/H5Fefc.c @@ -301,7 +301,7 @@ done: if(ent) { if(open_file) { ent->file->nopen_objs--; - if(H5F_try_close(ent->file) < 0) + if(H5F_try_close(ent->file, NULL) < 0) HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "can't close external file") } /* end if */ ent->name = (char *)H5MM_xfree(ent->name); @@ -350,7 +350,7 @@ H5F_efc_close(H5F_t *parent, H5F_t *file) * on the state of the efc. */ if(!efc) { file->nopen_objs--; - if(H5F_try_close(file) < 0) + if(H5F_try_close(file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close external file") HGOTO_DONE(SUCCEED) @@ -364,7 +364,7 @@ H5F_efc_close(H5F_t *parent, H5F_t *file) for(ent = efc->LRU_head; ent && ent->file != file; ent = ent->LRU_next); if(!ent) { file->nopen_objs--; - if(H5F_try_close(file) < 0) + if(H5F_try_close(file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close external file") } /* end if */ else @@ -572,7 +572,7 @@ H5F_efc_remove_ent(H5F_efc_t *efc, H5F_efc_ent_t *ent) * However we must still manipulate the nopen_objs field to prevent the file * from being closed out from under us. */ ent->file->nopen_objs--; - if(H5F_try_close(ent->file) < 0) + if(H5F_try_close(ent->file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close external file") ent->file = NULL; diff --git a/src/H5Fint.c b/src/H5Fint.c index 152148d..9cf129c 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1349,7 +1349,7 @@ H5F_close(H5F_t *f) f->file_id = -1; /* Attempt to close the file/mount hierarchy */ - if(H5F_try_close(f) < 0) + if(H5F_try_close(f, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") done: @@ -1373,7 +1373,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5F_try_close(H5F_t *f) +H5F_try_close(H5F_t *f, hbool_t *was_closed /*out*/) { unsigned nopen_files = 0; /* Number of open files in file/mount hierarchy */ unsigned nopen_objs = 0; /* Number of open objects in file/mount hierarchy */ @@ -1385,9 +1385,21 @@ H5F_try_close(H5F_t *f) HDassert(f); HDassert(f->shared); + /* Set the was_closed flag to the default value. + * This flag lets downstream code know if the file struct is + * still accessible and/or likely to contain useful data. + * It's needed by the evict-on-close code. Clients can ignore + * this value by passing in NULL. + */ + if(was_closed) + *was_closed = FALSE; + /* Check if this file is already in the process of closing */ - if(f->closing) + if(f->closing) { + if(was_closed) + *was_closed = TRUE; HGOTO_DONE(SUCCEED) + } /* end if */ /* Get the number of open objects and open files on this file/mount hierarchy */ if(H5F_mount_count_ids(f, &nopen_files, &nopen_objs) < 0) @@ -1488,7 +1500,7 @@ H5F_try_close(H5F_t *f) * hierarchy if so. */ if(f->parent) - if(H5F_try_close(f->parent) < 0) + if(H5F_try_close(f->parent, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close parent file") /* Unmount and close each child before closing the current file. */ @@ -1514,6 +1526,9 @@ H5F_try_close(H5F_t *f) if(H5F_dest(f, H5AC_ind_read_dxpl_id, TRUE) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problems closing file") + /* Since we closed the file, this should be set to TRUE */ + if(was_closed) + *was_closed = TRUE; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_try_close() */ diff --git a/src/H5Fmount.c b/src/H5Fmount.c index adde071..e3d4952 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -69,7 +69,7 @@ H5F_close_mounts(H5F_t *f) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group") /* Close the child file */ - if(H5F_try_close(f->shared->mtab.child[u].file) < 0) + if(H5F_try_close(f->shared->mtab.child[u].file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close child file") /* Eliminate the mount point from the table */ @@ -386,7 +386,7 @@ H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) /* Detach child file from parent & see if it should close */ child->parent = NULL; - if(H5F_try_close(child) < 0) + if(H5F_try_close(child, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close unmounted file") done: diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index ee8a845..50cd763 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -305,7 +305,6 @@ #define H5F_FCPL(F) ((F)->shared->fcpl_id) #define H5F_GET_FC_DEGREE(F) ((F)->shared->fc_degree) #define H5F_EVICT_ON_CLOSE(F) ((F)->shared->evict_on_close) -#define H5F_CLOSING(F) ((F)->closing) #define H5F_RDCC_NSLOTS(F) ((F)->shared->rdcc_nslots) #define H5F_RDCC_NBYTES(F) ((F)->shared->rdcc_nbytes) #define H5F_RDCC_W0(F) ((F)->shared->rdcc_w0) @@ -356,7 +355,6 @@ #define H5F_FCPL(F) (H5F_get_fcpl(F)) #define H5F_GET_FC_DEGREE(F) (H5F_get_fc_degree(F)) #define H5F_EVICT_ON_CLOSE(F) (H5F_get_evict_on_close(F)) -#define H5F_CLOSING(F) (H5F_get_closing(F)) #define H5F_RDCC_NSLOTS(F) (H5F_rdcc_nslots(F)) #define H5F_RDCC_NBYTES(F) (H5F_rdcc_nbytes(F)) #define H5F_RDCC_W0(F) (H5F_rdcc_w0(F)) @@ -649,7 +647,7 @@ typedef struct H5F_block_t { /* Private functions */ H5_DLL H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); -H5_DLL herr_t H5F_try_close(H5F_t *f); +H5_DLL herr_t H5F_try_close(H5F_t *f, hbool_t *was_closed/*out*/); /* Functions than retrieve values from the file struct */ H5_DLL unsigned H5F_get_intent(const H5F_t *f); @@ -686,7 +684,6 @@ H5_DLL herr_t H5F_set_sohm_nindexes(H5F_t *f, unsigned nindexes); H5_DLL hid_t H5F_get_fcpl(const H5F_t *f); H5_DLL H5F_close_degree_t H5F_get_fc_degree(const H5F_t *f); H5_DLL hbool_t H5F_get_evict_on_close(const H5F_t *f); -H5_DLL hbool_t H5F_get_closing(const H5F_t *f); H5_DLL size_t H5F_rdcc_nbytes(const H5F_t *f); H5_DLL size_t H5F_rdcc_nslots(const H5F_t *f); H5_DLL double H5F_rdcc_w0(const H5F_t *f); diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 2ffe766..14dd655 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -886,31 +886,6 @@ H5F_get_evict_on_close(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_closing - * - * Purpose: Checks if the file is in the process of being closed. - * - * Return: Success: Flag indicating whether the file is closing. - * Failure: (can't happen) - * - * Programmer: Dana Robinson - * Fall 2016 - * - *------------------------------------------------------------------------- - */ -hbool_t -H5F_get_closing(const H5F_t *f) -{ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR - - HDassert(f); - - FUNC_LEAVE_NOAPI(f->closing) -} /* end H5F_get_closing() */ - - -/*------------------------------------------------------------------------- * Function: H5F_store_msg_crt_idx * * Purpose: Retrieve the 'store message creation index' flag for the file. diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 66b34bc..489a149 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -208,7 +208,7 @@ H5F_super_ext_close(H5F_t *f, H5O_loc_t *ext_ptr, hid_t dxpl_id, /* Twiddle the number of open objects to avoid closing the file. */ f->nopen_objs++; - if(H5O_close(ext_ptr) < 0) + if(H5O_close(ext_ptr, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close superblock extension") f->nopen_objs--; diff --git a/src/H5Gint.c b/src/H5Gint.c index 95682d9..72cc1a4 100644 --- a/src/H5Gint.c +++ b/src/H5Gint.c @@ -232,7 +232,7 @@ done: if(oloc_init) { if(H5O_dec_rc_by_loc(&(grp->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDEC, NULL, "unable to decrement refcount on newly created object") - if(H5O_close(&(grp->oloc)) < 0) + if(H5O_close(&(grp->oloc), NULL) < 0) HDONE_ERROR(H5E_SYM, H5E_CLOSEERROR, NULL, "unable to release object header") if(H5O_delete(file, dxpl_id, grp->oloc.addr) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTDELETE, NULL, "unable to delete object header") @@ -448,7 +448,7 @@ H5G_open_oid(H5G_t *grp, hid_t dxpl_id) done: if(ret_value < 0) { if(obj_opened) - H5O_close(&(grp->oloc)); + H5O_close(&(grp->oloc), NULL); if(grp->shared) grp->shared = H5FL_FREE(H5G_shared_t, grp->shared); } /* end if */ @@ -472,8 +472,9 @@ done: herr_t H5G_close(H5G_t *grp) { - hbool_t corked; /* Whether the group is corked or not */ - herr_t ret_value = SUCCEED; /* Return value */ + hbool_t corked; /* Whether the group is corked or not */ + hbool_t file_closed = TRUE; /* H5O_close also closed the file? */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -498,11 +499,11 @@ H5G_close(H5G_t *grp) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't decrement count for object") if(H5FO_delete(grp->oloc.file, H5AC_ind_read_dxpl_id, grp->oloc.addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "can't remove group from list of open objects") - if(H5O_close(&(grp->oloc)) < 0) + if(H5O_close(&(grp->oloc), &file_closed) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") /* Evict group metadata if evicting on close */ - if(!H5F_CLOSING(grp->oloc.file) && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { + if(!file_closed && H5F_SHARED(grp->oloc.file) && H5F_EVICT_ON_CLOSE(grp->oloc.file)) { if(H5AC_flush_tagged_metadata(grp->oloc.file, grp->oloc.addr, H5AC_ind_read_dxpl_id) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush tagged metadata") if(H5AC_evict_tagged_metadata(grp->oloc.file, grp->oloc.addr, FALSE, H5AC_ind_read_dxpl_id) < 0) @@ -518,7 +519,7 @@ H5G_close(H5G_t *grp) /* Check reference count for this object in the top file */ if(H5FO_top_count(grp->oloc.file, grp->oloc.addr) == 0) { - if(H5O_close(&(grp->oloc)) < 0) + if(H5O_close(&(grp->oloc), NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ else @@ -531,7 +532,7 @@ H5G_close(H5G_t *grp) */ if(grp->shared->mounted && grp->shared->fo_count == 1) { /* Attempt to close down the file hierarchy */ - if(H5F_try_close(grp->oloc.file) < 0) + if(H5F_try_close(grp->oloc.file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") } /* end if */ } /* end else */ diff --git a/src/H5Gtraverse.c b/src/H5Gtraverse.c index 4d84e9f..d6c90e4 100644 --- a/src/H5Gtraverse.c +++ b/src/H5Gtraverse.c @@ -727,7 +727,7 @@ H5G_traverse_real(const H5G_loc_t *_loc, const char *name, unsigned target, HGOTO_ERROR(H5E_SYM, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") /* Close new group */ - if(H5O_close(obj_loc.oloc) < 0) + if(H5O_close(obj_loc.oloc, NULL) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to close") /* If the parent group was holding the file open, the @@ -1558,7 +1558,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_close(H5O_loc_t *loc) +H5O_close(H5O_loc_t *loc, hbool_t *file_closed /*out*/) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1569,6 +1569,15 @@ H5O_close(H5O_loc_t *loc) HDassert(loc->file); HDassert(H5F_NOPEN_OBJS(loc->file) > 0); + /* Set the file_closed flag to the default value. + * This flag lets downstream code know if the file struct is + * still accessible and/or likely to contain useful data. + * It's needed by the evict-on-close code. Clients can ignore + * this value by passing in NULL. + */ + if(file_closed) + *file_closed = FALSE; + /* Decrement open-lock counters */ H5F_DECR_NOPEN_OBJS(loc->file); @@ -1589,7 +1598,7 @@ H5O_close(H5O_loc_t *loc) */ if(H5F_NOPEN_OBJS(loc->file) == H5F_NMOUNTS(loc->file)) /* Attempt to close down the file hierarchy */ - if(H5F_try_close(loc->file) < 0) + if(H5F_try_close(loc->file, file_closed) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "problem attempting file close") /* Release location information */ @@ -2713,7 +2722,7 @@ H5O_loc_free(H5O_loc_t *loc) H5F_DECR_NOPEN_OBJS(loc->file); loc->holding_file = FALSE; if(H5F_NOPEN_OBJS(loc->file) <= 0) { - if(H5F_try_close(loc->file) < 0) + if(H5F_try_close(loc->file, NULL) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close file") } /* end if */ } /* end if */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index d056ae8..c1c72cf 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -277,7 +277,7 @@ H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, done: if(loc_found && H5G_loc_free(&src_loc) < 0) HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location") - if(obj_open && H5O_close(&src_oloc) < 0) + if(obj_open && H5O_close(&src_oloc, NULL) < 0) HDONE_ERROR(H5E_OHDR, H5E_CLOSEERROR, FAIL, "unable to release object header") FUNC_LEAVE_API(ret_value) diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index e8ba267..2169906 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -827,7 +827,7 @@ H5_DLL herr_t H5O_init(void); H5_DLL herr_t H5O_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, size_t initial_rc, hid_t ocpl_id, H5O_loc_t *loc/*out*/); H5_DLL herr_t H5O_open(H5O_loc_t *loc); -H5_DLL herr_t H5O_close(H5O_loc_t *loc); +H5_DLL herr_t H5O_close(H5O_loc_t *loc, hbool_t *file_closed/*out*/); H5_DLL int H5O_link(const H5O_loc_t *loc, int adjust, hid_t dxpl_id); H5_DLL H5O_t *H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, unsigned prot_flags); H5_DLL H5O_t *H5O_pin(const H5O_loc_t *loc, hid_t dxpl_id); @@ -2467,7 +2467,7 @@ done: if(oh && oh != open_oh) { if(oh && H5O_unprotect(&oloc, dxpl_id, oh, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTUNPROTECT, FAIL, "unable to release object header") - if(H5O_close(&oloc) < 0) + if(H5O_close(&oloc, NULL) < 0) HDONE_ERROR(H5E_SOHM, H5E_CANTCLOSEOBJ, FAIL, "unable to close object header") } /* end if */ @@ -3525,7 +3525,7 @@ H5T__free(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't decrement count for object") if(H5FO_delete(dt->sh_loc.file, H5AC_ind_read_dxpl_id, dt->sh_loc.u.loc.oh_addr) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "can't remove datatype from list of open objects") - if(H5O_close(&dt->oloc) < 0) + if(H5O_close(&dt->oloc, NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close data type object header") dt->shared->state = H5T_STATE_NAMED; } /* end if */ @@ -3645,7 +3645,7 @@ H5T_close(H5T_t *dt) /* Check reference count for this object in the top file */ if(H5FO_top_count(dt->sh_loc.file, dt->sh_loc.u.loc.oh_addr) == 0) { /* Close object location for named datatype */ - if(H5O_close(&dt->oloc) < 0) + if(H5O_close(&dt->oloc, NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to close") } /* end if */ else diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 07fe371..3ded7af 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -203,7 +203,7 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't remove dataset from list of open objects") /* Close the datatype object */ - if(H5O_close(&(dt->oloc)) < 0) + if(H5O_close(&(dt->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") /* Remove the datatype's object header from the file */ @@ -401,7 +401,7 @@ done: if((type->shared->state == H5T_STATE_TRANSIENT || type->shared->state == H5T_STATE_RDONLY) && (type->sh_loc.type == H5O_SHARE_TYPE_COMMITTED)) { if(H5O_dec_rc_by_loc(&(type->oloc), dxpl_id) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "unable to decrement refcount on newly created object") - if(H5O_close(&(type->oloc)) < 0) + if(H5O_close(&(type->oloc), NULL) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header") if(H5O_delete(file, dxpl_id, type->sh_loc.u.loc.oh_addr) < 0) HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header") @@ -823,7 +823,7 @@ H5T_open_oid(const H5G_loc_t *loc, hid_t dxpl_id) done: if(ret_value == NULL) if(dt == NULL) - H5O_close(loc->oloc); + H5O_close(loc->oloc, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_open_oid() */ @@ -104,7 +104,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR @@ -261,13 +261,13 @@ test_single(void) TEST_ERROR if(f4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR @@ -294,7 +294,7 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR @@ -375,9 +375,9 @@ test_single(void) TEST_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR @@ -455,13 +455,13 @@ test_single(void) TEST_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp4) < 0) + if(H5F_try_close(ftmp4, NULL) < 0) FAIL_STACK_ERROR @@ -494,12 +494,12 @@ test_single(void) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR /* Close parent file */ - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR PASSED(); @@ -576,9 +576,9 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], @@ -596,7 +596,7 @@ test_graph_nocycle(void) if(NULL == (f1 = H5F_efc_open(f0, filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f2) < 0) FAIL_STACK_ERROR @@ -611,9 +611,9 @@ test_graph_nocycle(void) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -667,11 +667,11 @@ test_graph_nocycle(void) TEST_ERROR if(ftmp4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp4) < 0) + if(H5F_try_close(ftmp4, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -731,11 +731,11 @@ test_graph_nocycle(void) if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -780,9 +780,9 @@ test_graph_nocycle(void) if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -868,15 +868,15 @@ test_graph_nocycle(void) if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp4) < 0) + if(H5F_try_close(ftmp4, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -951,7 +951,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -960,7 +960,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -991,7 +991,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_efc_open(f0, filename[1], @@ -1007,7 +1007,7 @@ test_graph_cycle(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1015,7 +1015,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR @@ -1055,7 +1055,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1063,7 +1063,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1091,7 +1091,7 @@ test_graph_cycle(void) TEST_ERROR if(H5F_efc_close(f0, f1) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1099,7 +1099,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR @@ -1132,7 +1132,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 3) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1140,7 +1140,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1177,7 +1177,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1221,7 +1221,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1229,7 +1229,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1277,7 +1277,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1304,11 +1304,11 @@ test_graph_cycle(void) TEST_ERROR if(f0->shared->nrefs != 3) TEST_ERROR - if(H5F_try_close(ftmp0) < 0) + if(H5F_try_close(ftmp0, NULL) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1316,7 +1316,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -1344,7 +1344,7 @@ test_graph_cycle(void) if(ftmp1->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(ftmp1->shared->nrefs != 2) TEST_ERROR @@ -1354,9 +1354,9 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp1) < 0) + if(H5F_try_close(ftmp1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1364,7 +1364,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1372,7 +1372,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR @@ -1411,7 +1411,7 @@ test_graph_cycle(void) if(ftmp2->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(ftmp2->shared->nrefs != 2) TEST_ERROR @@ -1421,9 +1421,9 @@ test_graph_cycle(void) if(f0->shared->nrefs != 3) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1431,7 +1431,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1439,7 +1439,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1447,7 +1447,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR @@ -1499,9 +1499,9 @@ test_graph_cycle(void) TEST_ERROR if(ftmp2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp2) < 0) + if(H5F_try_close(ftmp2, NULL) < 0) FAIL_STACK_ERROR @@ -1551,7 +1551,7 @@ test_graph_cycle(void) if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR @@ -1561,9 +1561,9 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1571,7 +1571,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1579,7 +1579,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1587,7 +1587,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1595,7 +1595,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -1659,9 +1659,9 @@ test_graph_cycle(void) TEST_ERROR if(ftmp3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR @@ -1701,7 +1701,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1709,7 +1709,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1717,7 +1717,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1725,7 +1725,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1733,7 +1733,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -1777,7 +1777,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1785,7 +1785,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1793,7 +1793,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1801,7 +1801,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -1844,7 +1844,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1852,12 +1852,12 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(ftmp3->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1865,7 +1865,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1873,7 +1873,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -1881,7 +1881,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -1937,14 +1937,14 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_release(ftmp3->shared->efc) < 0) @@ -1956,12 +1956,12 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(ftmp3) < 0) + if(H5F_try_close(ftmp3, NULL) < 0) FAIL_STACK_ERROR @@ -2029,7 +2029,7 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2037,7 +2037,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2045,7 +2045,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2053,7 +2053,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2061,7 +2061,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2069,7 +2069,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2077,7 +2077,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f5) < 0) + if(H5F_try_close(f5, NULL) < 0) FAIL_STACK_ERROR @@ -2150,7 +2150,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2158,7 +2158,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2166,7 +2166,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2174,7 +2174,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2182,7 +2182,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2190,7 +2190,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f5) < 0) + if(H5F_try_close(f5, NULL) < 0) FAIL_STACK_ERROR @@ -2268,7 +2268,7 @@ test_graph_cycle(void) if(f5->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(f4->shared->nrefs != 2) TEST_ERROR @@ -2280,14 +2280,14 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR if(f5->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(f5->shared->nrefs != 2) TEST_ERROR @@ -2296,10 +2296,10 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f5) < 0) + if(H5F_try_close(f5, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], @@ -2308,7 +2308,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2316,7 +2316,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2324,7 +2324,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2332,7 +2332,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f4 = H5F_open(filename[4], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2340,7 +2340,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f4->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f5 = H5F_open(filename[5], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2348,7 +2348,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f5->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f5) < 0) + if(H5F_try_close(f5, NULL) < 0) FAIL_STACK_ERROR @@ -2440,7 +2440,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 3) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_release(f4->shared->efc) < 0) @@ -2456,7 +2456,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_release(f5->shared->efc) < 0) @@ -2472,14 +2472,14 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f4) < 0) + if(H5F_try_close(f4, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f5) < 0) + if(H5F_try_close(f5, NULL) < 0) FAIL_STACK_ERROR @@ -2577,7 +2577,7 @@ test_graph_cycle(void) if(H5F_efc_close(f0, f3) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2585,7 +2585,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2593,7 +2593,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2601,7 +2601,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2609,7 +2609,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -2711,7 +2711,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2719,7 +2719,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2727,7 +2727,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR | H5F_ACC_CREAT | H5F_ACC_TRUNC, fcpl_id, fapl_id, @@ -2735,7 +2735,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -2773,7 +2773,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -2812,7 +2812,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR @@ -2853,7 +2853,7 @@ test_graph_cycle(void) if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(f1->shared->nrefs != 2) TEST_ERROR @@ -2866,7 +2866,7 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f1, f3) < 0) @@ -2880,14 +2880,14 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR if(H5F_efc_close(f2, f1) < 0) @@ -2899,52 +2899,52 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 3) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR @@ -3023,19 +3023,19 @@ test_graph_cycle(void) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f3 = H5F_open(filename[3], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f3->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f3) < 0) + if(H5F_try_close(f3, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR @@ -3066,21 +3066,21 @@ test_graph_cycle(void) if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR @@ -3113,28 +3113,28 @@ test_graph_cycle(void) if(f0->shared->nrefs != 2) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f0 = H5F_open(filename[0], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f0->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f0) < 0) + if(H5F_try_close(f0, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f1 = H5F_open(filename[1], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f1->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f1) < 0) + if(H5F_try_close(f1, NULL) < 0) FAIL_STACK_ERROR if(NULL == (f2 = H5F_open(filename[2], H5F_ACC_RDWR, fcpl_id, fapl_id, dxpl_id))) FAIL_STACK_ERROR if(f2->shared->nrefs != 1) TEST_ERROR - if(H5F_try_close(f2) < 0) + if(H5F_try_close(f2, NULL) < 0) FAIL_STACK_ERROR diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 7016fde..c42c4b3 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -49,10 +49,8 @@ const char *FILENAMES[] = { #define FILENAME_BUF_SIZE 1024 /* Group names */ -#define GROUP_OLD_STYLE_1_NAME "old1" -#define GROUP_OLD_STYLE_2_NAME "old2" -#define GROUP_NEW_STYLE_1_NAME "new1" -#define GROUP_NEW_STYLE_2_NAME "new2" +#define GROUP_OLD_STYLE_NAME "old_style_groups" +#define GROUP_NEW_STYLE_NAME "new_style_groups" /* Dataset names */ #define DSET_COMPACT_NAME "compact" @@ -63,14 +61,21 @@ const char *FILENAMES[] = { #define DSET_FARRAY_NAME "farray" #define DSET_SINGLE_NAME "single" -/* All datasets store 1000 elements */ +/* Number of data elements in a dataset */ #define NELEMENTS 1024 +/* Number of subgroups in each style of group */ +#define NSUBGROUPS 128 + +/* Max size of subgroup name, not including NULL */ +#define SUBGROUP_NAME_SIZE 16 + +/* Prototypes */ static hbool_t verify_tag_not_in_cache(H5F_t *f, haddr_t tag); static herr_t check_evict_on_close_api(void); static hid_t generate_eoc_test_file(hid_t fapl_id); static herr_t check_dset_scheme(hid_t fid, const char *dset_name); -static herr_t check_group_layout(hid_t fid, const char *group_name, const char *subgroup_name); +static herr_t check_group_layout(hid_t fid, const char *group_name); /*------------------------------------------------------------------------- @@ -142,6 +147,7 @@ generate_eoc_test_file(hid_t fapl_id) H5D_layout_t layout_type; /* dataset layout type */ int *data = NULL; /* buffer for fake data */ int n; /* # of data elements */ + int i; /* iterator (# subgroups) */ TESTING("generating evict-on-close test file"); @@ -175,14 +181,31 @@ generate_eoc_test_file(hid_t fapl_id) /* Old-style (version 1 B-tree + local heap) */ /*********************************************/ - if((gid1 = H5Gcreate2(fid, GROUP_OLD_STYLE_1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR; - if((gid2 = H5Gcreate2(gid1, GROUP_OLD_STYLE_2_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* A single group is created in the root group, followed + * by a large number of groups in the new group. This will + * ensure that the file data structures for groups include + * multiple cache entries. + */ + if((gid1 = H5Gcreate2(fid, GROUP_OLD_STYLE_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + + /* Create sub-groups */ + for(i = 0; i < NSUBGROUPS; i++) { + char subgroup_name[SUBGROUP_NAME_SIZE]; + + /* Create the group name */ + HDmemset(subgroup_name, '\0', SUBGROUP_NAME_SIZE); + if(HDsnprintf(subgroup_name, (size_t)(SUBGROUP_NAME_SIZE - 1), "%d", i) < 0) + TEST_ERROR + + if((gid2 = H5Gcreate2(gid1, subgroup_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + if(H5Gclose(gid2) < 0) + TEST_ERROR; + } /* end for */ + if(H5Gclose(gid1) < 0) TEST_ERROR; - if(H5Gclose(gid2) < 0) - TEST_ERROR; /********************************************************************/ /* Generate datasets and ensure that the chunking scheme is correct */ @@ -254,17 +277,36 @@ generate_eoc_test_file(hid_t fapl_id) /* New-style (version 2 B-tree + fractal heap) */ /***********************************************/ - if((gid1 = H5Gcreate2(fid, GROUP_NEW_STYLE_1_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - TEST_ERROR; - if((gid2 = H5Gcreate2(gid1, GROUP_NEW_STYLE_2_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* A single group is created in the root group, followed + * by a large number of groups in the new group. This will + * ensure that the file data structures for groups include + * multiple cache entries. + */ + if((gid1 = H5Gcreate2(fid, GROUP_NEW_STYLE_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR; + + /* Create sub-groups */ + for(i = 0; i < NSUBGROUPS; i++) { + char subgroup_name[SUBGROUP_NAME_SIZE]; + + /* Create the group name */ + HDmemset(subgroup_name, '\0', SUBGROUP_NAME_SIZE); + if(HDsnprintf(subgroup_name, (size_t)(SUBGROUP_NAME_SIZE - 1), "%d", i) < 0) + TEST_ERROR + +/* DER - Restore when EoC new-style group bug is resolved. + if((gid2 = H5Gcreate2(gid1, subgroup_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; + if(H5Gclose(gid2) < 0) + TEST_ERROR; +*/ + } /* end for */ + if(H5Gclose(gid1) < 0) TEST_ERROR; - if(H5Gclose(gid2) < 0) - TEST_ERROR; /********************************************************************/ - /* Generate datasets and ensure that the scheme is chunking correct */ + /* Generate datasets and ensure that the chunking scheme is correct */ /********************************************************************/ /********************/ @@ -523,6 +565,8 @@ generate_eoc_test_file(hid_t fapl_id) error: H5E_BEGIN_TRY { + H5Gclose(gid1); + H5Gclose(gid2); H5Fclose(fid); H5Dclose(did); H5Sclose(sid); @@ -542,7 +586,7 @@ error: * Function: check_group_layout() * * Purpose: Verify that the evict-on-close feature works for a given - * group layout. + * group layout (new-style vs. old-style). * * Return: SUCCEED/FAIL * @@ -552,14 +596,14 @@ error: *------------------------------------------------------------------------- */ static herr_t -check_group_layout(hid_t fid, const char *group_name, const char *subgroup_name) +check_group_layout(hid_t fid, const char *group_name) { H5F_t *file_ptr = NULL; /* ptr to internal file struct */ hid_t gid1 = -1, gid2 = -1; /* group IDs */ H5G_t *grp_ptr = NULL; /* ptr to internal group struct */ haddr_t tag1, tag2; /* MD cache tags for groups */ int32_t before, during, after; /* cache sizes */ - + int i; /* iterator */ /* NOTE: The TESTING() macro is called in main() */ @@ -577,36 +621,51 @@ check_group_layout(hid_t fid, const char *group_name, const char *subgroup_name) HDprintf("NUMBER OF CACHE ENTRIES: %d\n", before); #endif - /* Open groups and get tags */ + /* Open the main group and get its tag */ if((gid1 = H5Gopen2(fid, group_name, H5P_DEFAULT)) < 0) TEST_ERROR; - if((gid2 = H5Gopen2(gid1, subgroup_name, H5P_DEFAULT)) < 0) - TEST_ERROR; - if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid1, H5I_GROUP))) TEST_ERROR; tag1 = grp_ptr->oloc.addr; - if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid2, H5I_GROUP))) - TEST_ERROR; - tag2 = grp_ptr->oloc.addr; + + /* Open and close all sub-groups */ + for(i = 0; i < NSUBGROUPS; i++) { + char subgroup_name[SUBGROUP_NAME_SIZE]; + + /* Create the group name */ + HDmemset(subgroup_name, '\0', SUBGROUP_NAME_SIZE); + if(HDsnprintf(subgroup_name, (size_t)(SUBGROUP_NAME_SIZE - 1), "%d", i) < 0) + TEST_ERROR + + if((gid2 = H5Gopen2(gid1, subgroup_name, H5P_DEFAULT)) < 0) + TEST_ERROR; + + if(NULL == (grp_ptr = (H5G_t *)H5I_object_verify(gid2, H5I_GROUP))) + TEST_ERROR; + tag2 = grp_ptr->oloc.addr; + + if(H5Gclose(gid2) < 0) + TEST_ERROR; + + if(TRUE == verify_tag_not_in_cache(file_ptr, tag2)) + TEST_ERROR; + } /* end for */ /* Record the number of cache entries */ - during = file_ptr->shared->cache->index_len; + during = file_ptr->shared->cache->index_len; #ifdef EOC_MANUAL_INSPECTION HDprintf("\nCACHE AFTER OPENING GROUPS (WHILE OPEN):\n"); if(H5AC_dump_cache(file_ptr) < 0) TEST_ERROR; - HDprintf("TAGS: group: %#X, subgroup: %#X\n", tag1, tag2); + HDprintf("MAIN GROUP TAG: %#X\n", tag1); HDprintf("NUMBER OF CACHE ENTRIES: %d\n", during); #endif - /* Close the groups */ + /* Close the main group */ if(H5Gclose(gid1) < 0) TEST_ERROR; - if(H5Gclose(gid2) < 0) - TEST_ERROR; /* Record the number of cache entries */ after = file_ptr->shared->cache->index_len; @@ -618,12 +677,9 @@ check_group_layout(hid_t fid, const char *group_name, const char *subgroup_name) HDprintf("NUMBER OF CACHE ENTRIES: %d\n", after); #endif - /* Ensure that the cache does not contain entries with the tags */ + /* Ensure that the cache does not contain entries with the tag */ if(TRUE == verify_tag_not_in_cache(file_ptr, tag1)) TEST_ERROR; - if(TRUE == verify_tag_not_in_cache(file_ptr, tag2)) - TEST_ERROR; - /* Compare the number of cache entries */ if(before != after || before == during) TEST_ERROR; @@ -870,24 +926,12 @@ main(void) PUTS_ERROR("Unable to set evict-on-close property\n"); } /* end if */ - /*************************/ - /* Test EoC for datasets */ - /*************************/ - /* Generate the test file */ if((fid = generate_eoc_test_file(fapl_id)) < 0) { nerrors++; PUTS_ERROR("Unable to generate test file\n"); } /* end if */ - /* Run tests with old- and new-style groups - * PASSED() and H5_FAILED() are handled in check_configuration() - */ - TESTING("evict on close with old-style groups"); - nerrors += check_group_layout(fid, GROUP_OLD_STYLE_1_NAME, GROUP_OLD_STYLE_2_NAME) < 0 ? 1 : 0; - TESTING("evict on close with new-style groups"); - nerrors += check_group_layout(fid, GROUP_NEW_STYLE_1_NAME, GROUP_NEW_STYLE_2_NAME) < 0 ? 1 : 0; - /* Run tests with a variety of dataset configurations * PASSED() and H5_FAILED() are handled in check_configuration() */ @@ -906,6 +950,16 @@ main(void) TESTING("evict on close with compact layout"); nerrors += check_dset_scheme(fid, DSET_COMPACT_NAME) < 0 ? 1 : 0; + /* Run tests with old- and new-style groups + * PASSED() and H5_FAILED() are handled in check_configuration() + */ + TESTING("evict on close with old-style groups"); + nerrors += check_group_layout(fid, GROUP_OLD_STYLE_NAME) < 0 ? 1 : 0; +/* DER - Enable when EoC new-style groups bug is fixed + TESTING("evict on close with new-style groups"); + nerrors += check_group_layout(fid, GROUP_NEW_STYLE_NAME) < 0 ? 1 : 0; +*/ + /* Close the test file */ if(H5Fclose(fid) < 0) { nerrors++; diff --git a/test/ohdr.c b/test/ohdr.c index 1478c5c..f06dc71 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -131,9 +131,9 @@ test_cont(char *filename, hid_t fapl) if(hdr_info.nchunks >= nchunks) TEST_ERROR - if(H5O_close(&oh_locA) < 0) + if(H5O_close(&oh_locA, NULL) < 0) FAIL_STACK_ERROR - if(H5O_close(&oh_locB) < 0) + if(H5O_close(&oh_locB, NULL) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -145,8 +145,8 @@ test_cont(char *filename, hid_t fapl) error: H5E_BEGIN_TRY { - H5O_close(&oh_locA); - H5O_close(&oh_locB); + H5O_close(&oh_locA, NULL); + H5O_close(&oh_locB, NULL); H5Fclose(file); } H5E_END_TRY; @@ -272,7 +272,7 @@ test_ohdr_cache(char *filename, hid_t fapl) FAIL_STACK_ERROR /* Close object header created */ - if(H5O_close(&oh_loc) < 0) + if(H5O_close(&oh_loc, NULL) < 0) FAIL_STACK_ERROR /* Unprotect local heap (which actually unpins it from the cache) */ @@ -731,7 +731,7 @@ main(void) * works correctly - QAK) */ TESTING("close & re-open object header"); - if(H5O_close(&oh_loc) < 0) + if(H5O_close(&oh_loc, NULL) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -806,7 +806,7 @@ main(void) /* release resources */ TESTING("object header closing"); - if(H5O_close(&oh_loc) < 0) + if(H5O_close(&oh_loc, NULL) < 0) FAIL_STACK_ERROR PASSED(); |