From 9a4b73eea06b984119e42e533bb6bb554644f1bc Mon Sep 17 00:00:00 2001 From: "U-hdf\\nfortne2" Date: Thu, 15 Dec 2016 09:49:52 -0600 Subject: Add support for reading FCPL from file. Other minor fixes. --- examples/h5dsm_group_create.c | 2 +- src/H5FF.c | 4 ++++ src/H5VLdaosm.c | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/h5dsm_group_create.c b/examples/h5dsm_group_create.c index ad6e3da..e5c3d49 100644 --- a/examples/h5dsm_group_create.c +++ b/examples/h5dsm_group_create.c @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { if((trans = H5TRcreate(file, trans_num + 1)) < 0) ERROR; - printf("Creating dataset - transaction number = %llu\n", (long long unsigned)(trans_num + 1)); + printf("Creating group - transaction number = %llu\n", (long long unsigned)(trans_num + 1)); /* Create group */ if((grp = H5Gcreate_ff(file, argv[3], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT, trans)) < 0) diff --git a/src/H5FF.c b/src/H5FF.c index 301e328..1378f9e 100644 --- a/src/H5FF.c +++ b/src/H5FF.c @@ -350,6 +350,10 @@ H5Fclose_ff(hid_t file_id, hid_t H5_ATTR_UNUSED trans_id) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ii", file_id, trans_id); + /* Check/fix arguments. */ + if(H5I_FILE != H5I_get_type(file_id)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file ID") + /* flush file using trans_id? DSMINC */ /* Decrement reference count on atom. When it reaches zero the file will be closed. */ diff --git a/src/H5VLdaosm.c b/src/H5VLdaosm.c index c99abb3..0c304b3 100644 --- a/src/H5VLdaosm.c +++ b/src/H5VLdaosm.c @@ -1067,6 +1067,12 @@ H5VL_daosm_file_open(const char *name, unsigned flags, hid_t fapl_id, if(NULL == (file->root_grp = (H5VL_daosm_group_t *)H5VL_daosm_group_open_helper(file, root_grp_oid, H5P_GROUP_ACCESS_DEFAULT, dxpl_id, req, epoch))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "can't open root group") + /* FCPL was stored as root group's GCPL (as GCPL is the parent of FCPL). + * Point to it. */ + file->fcpl_id = file->root_grp->gcpl_id; + if(H5Iinc_ref(file->fcpl_id) < 0) + HGOTO_ERROR(H5E_ATOM, H5E_CANTINC, NULL, "can't increment FCPL ref count") + /* Determine if we want to acquire a transaction for the opened file */ if(H5P_get(plist, H5VL_ACQUIRE_TR_ID, &trans_id) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property value for trans id") -- cgit v0.12