From 10dd81d6bf70d17a573f8202fbf375e6badd18b3 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 14 Mar 2012 09:48:34 -0500 Subject: [svn-r22065] fix a typo forget to update the renamed functions in the header file --- src/H5D.c | 3 +-- src/H5F.c | 16 +++++++++------- src/H5I.c | 3 +++ src/H5VL.c | 12 ++++++++++++ src/H5VLprivate.h | 12 ++++++------ 5 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/H5D.c b/src/H5D.c index 20a8b79..fb3d15b 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -176,8 +176,7 @@ H5Dcreate2(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, if(NULL == (dset = H5D__create_named(&loc, name, type_id, space, lcpl_id, dcpl_id, dapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") if((ret_value = H5I_register(H5I_DATASET, dset, TRUE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset")A - + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register dataset") done: if(ret_value < 0) diff --git a/src/H5F.c b/src/H5F.c index 5a9889d..047fd39 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -336,12 +336,6 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) if(driver_info != NULL && H5P_set(new_plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file driver info") - /* Set the vol "info" in the property list */ - /* MSC - can't do that yet - vol_info = H5VL_fapl_get(f); - if(vol_info != NULL && H5P_set(new_plist, H5F_ACS_VOL_INFO_NAME, &vol_info) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set vol info") - */ /* Set the file close degree appropriately */ if(f->shared->fc_degree == H5F_CLOSE_DEFAULT && H5P_set(new_plist, H5F_ACS_CLOSE_DEGREE_NAME, &(f->shared->lf->cls->fc_degree)) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") @@ -1943,11 +1937,14 @@ H5Freopen(hid_t uid) /* Keep this ID in file object structure */ new_file->file_id = new_file_id; -#if 1 +#if 1 /*MSC - This needs to go through the VOL */ if(NULL == (new_uid_info = H5FL_MALLOC(H5I_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") new_uid_info->obj_id = new_file_id; new_uid_info->vol_id = uid_info->vol_id; + /* increment ref count on the VOL id */ + if(H5I_inc_ref(uid_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on vol plugin") if((ret_value = H5I_register(H5I_UID, new_uid_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") @@ -2027,6 +2024,11 @@ H5F_get_id(H5F_t *file, hbool_t app_ref) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") uid_info->obj_id = file->file_id; uid_info->vol_id = file->vol_id; + + /* increment ref count on the VOL id */ + if(H5I_inc_ref(uid_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on vol plugin") + if((H5I_register(H5I_UID, uid_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") } else { diff --git a/src/H5I.c b/src/H5I.c index 560d0ef..ae0f5ad 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -2448,6 +2448,9 @@ H5I_inc_ref_uid(hid_t fid, hbool_t app_ref) if(NULL == (uid_info = (H5I_t *)H5I_object(id_ptr->id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid user identifier") if (uid_info->obj_id == fid) { + /* increment ref count on the VOL id */ + if(H5I_inc_ref(uid_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on vol plugin") /* Increment reference count on atom. */ if((ret_value = H5I_inc_ref(id_ptr->id, app_ref)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") diff --git a/src/H5VL.c b/src/H5VL.c index 692456a..2b41794 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -557,6 +557,10 @@ H5VL_file_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, h uid_info->obj_id = file_id; uid_info->vol_id = plugin_id; + /* increment ref count on the VOL id */ + if(H5I_inc_ref(uid_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on vol plugin") + if((ret_value = H5I_register(H5I_UID, uid_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") done: @@ -614,6 +618,10 @@ H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) uid_info->obj_id = file_id; uid_info->vol_id = plugin_id; + /* increment ref count on the VOL id */ + if(H5I_inc_ref(uid_info->vol_id, FALSE) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on vol plugin") + if((ret_value = H5I_register(H5I_UID, uid_info, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") @@ -662,6 +670,10 @@ H5VL_file_close(hid_t uid) if((ret_value = (vol_plugin->file_cls.close)(uid_info->obj_id)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTCLOSEFILE, FAIL, "close failed") + /* decrement ref count on the VOL id */ + if(H5I_dec_ref(uid_info->vol_id) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "unable to decrement ref count on vol plugin") + if(H5I_dec_app_ref(uid) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to decrement ref count on user ID") done: diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index e465bb8..eab0d5c 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -47,12 +47,12 @@ H5_DLL int H5VL_term_interface(void); H5_DLL H5VL_class_t *H5VL_get_class(hid_t id); //H5_DLL hsize_t H5VL_sb_size(H5F_t *file); H5_DLL hid_t H5VL_register(const void *cls, size_t size, hbool_t app_ref); -H5_DLL hid_t H5VL_open(const char *name, unsigned flags, hid_t fcpl_id, - hid_t fapl_id, hid_t dxpl_id); -H5_DLL hid_t H5VL_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); -H5_DLL herr_t H5VL_close(hid_t file_id); -H5_DLL herr_t H5VL_flush(hid_t file_id, H5F_scope_t scope); -H5_DLL herr_t H5VL_get(hid_t uid, H5VL_file_get_t get_type, void *data, int argc, void **argv); +H5_DLL hid_t H5VL_file_open(const char *name, unsigned flags, hid_t fcpl_id, + hid_t fapl_id, hid_t dxpl_id); +H5_DLL hid_t H5VL_file_create(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id); +H5_DLL herr_t H5VL_file_close(hid_t file_id); +H5_DLL herr_t H5VL_file_flush(hid_t file_id, H5F_scope_t scope); +H5_DLL herr_t H5VL_file_get(hid_t uid, H5VL_file_get_t get_type, void *data, int argc, void **argv); H5_DLL herr_t H5VL_fapl_open(struct H5P_genplist_t *plist, hid_t vol_id, const void *vol_info); H5_DLL herr_t H5VL_fapl_copy(hid_t vol_id, const void *fapl, void **copied_fapl); H5_DLL herr_t H5VL_fapl_close(hid_t vol_id, void *fapl); -- cgit v0.12