From bef08a7c0ec8f1bdc6a2637401b99d3c2bbb0617 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 11 Jul 2012 16:52:12 -0500 Subject: [svn-r22559] - move the vol plugin ref count increment for H5Freopen into the VOL layer - fix a bug in H5VLdatatype_get_binary --- src/H5F.c | 1 - src/H5VL.c | 2 +- src/H5VLint.c | 6 ++++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index d5e15be..0f6436b 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -779,7 +779,6 @@ H5Freopen(hid_t file_id) /* Get an atom for the file with the VOL information as the auxilary struct*/ if((ret_value = H5I_register2(H5I_FILE, file, vol_plugin, TRUE)) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to atomize file handle") - vol_plugin->nrefs ++; done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5VL.c b/src/H5VL.c index 4372f05..b0b15a9 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -708,7 +708,7 @@ H5VLdatatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size_ if (NULL == obj || NULL == vol_plugin || NULL == vol_plugin->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid object/VOL class pointer") - if((ret_value = H5VL_datatype_get_binary(obj, vol_plugin, buf, size, req))) + if((ret_value = H5VL_datatype_get_binary(obj, vol_plugin, buf, size, req)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "unable to encode datatype") done: diff --git a/src/H5VLint.c b/src/H5VLint.c index 5b427c2..08c539a 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -822,6 +822,7 @@ H5VL_datatype_get_binary(void *obj, H5VL_t *vol_plugin, unsigned char *buf, size /* call the corresponding VOL open callback */ if((ret_value = (vol_plugin->cls->datatype_cls.get_binary)(obj, buf, size, req)) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, FAIL, "get binary failed") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_datatype_get_binary() */ @@ -1399,6 +1400,11 @@ H5VL_file_optional(void *file, H5VL_t *vol_plugin, H5VL_file_optional_t optional HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "optional failed") va_end (arguments); + /* if the get_type is a named datatype, attach the vol info to it */ + if(H5VL_FILE_REOPEN == optional_type) { + vol_plugin->nrefs ++; + } + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL_file_optional() */ -- cgit v0.12