summaryrefslogtreecommitdiffstats
path: root/src/H5I.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-08-08 17:05:20 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-08-08 17:05:20 (GMT)
commite3e4c3710976810ed7a9109d9b4f9d842eca2954 (patch)
treec85f2d5dcb00b7ccb8f80774818cce25a89e3d0f /src/H5I.c
parent68067443e04f352aeca5b41243e77e4aacc4cd98 (diff)
downloadhdf5-e3e4c3710976810ed7a9109d9b4f9d842eca2954.zip
hdf5-e3e4c3710976810ed7a9109d9b4f9d842eca2954.tar.gz
hdf5-e3e4c3710976810ed7a9109d9b4f9d842eca2954.tar.bz2
[svn-r25521] major rework of the internal setup of VOL plugins to make it more
symmetrical to VFDs and allow new functionality to be implemented later. + some Bug fixes
Diffstat (limited to 'src/H5I.c')
-rw-r--r--src/H5I.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/H5I.c b/src/H5I.c
index 50abc1e..c3d591a 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -2284,23 +2284,24 @@ H5Iget_file_id(hid_t obj_id)
/* Get the file through the VOL */
if(H5VL_file_get(obj, vol_plugin, H5VL_OBJECT_GET_FILE, H5AC_dxpl_id, H5_EVENT_STACK_NULL, type, &file) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to get file")
-
if (NULL == file)
HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file")
/* Check if the ID already exists and procceed accordingly */
if (FAIL == (ret_value = H5I_get_id(file, H5I_FILE))) {
- /* resurrect the ID - Register an ID with the native plugin */
+ /* resurrect the ID */
if((ret_value = H5I_register2(H5I_FILE, file, vol_plugin, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register group")
+ /* increment the ref count on the VOL plugin for the new ID */
+ vol_plugin->nrefs ++;
+ if(H5I_inc_ref(vol_plugin->id, FALSE) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINC, FAIL, "unable to increment ref count on VOL plugin")
}
else {
/* Increment ref count on existing ID */
if(H5I_inc_ref(ret_value, TRUE) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed")
}
- /* increment the ref count on the VOL plugin for the new ID */
- vol_plugin->nrefs ++;
}
else
HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID")