diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2016-07-02 05:14:06 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2016-07-02 05:14:06 (GMT) |
commit | 4f967d5029cd8e0080f5637efd403842394f87d0 (patch) | |
tree | f755ed97699afbffd21967f88b964c6dbed4b67c /src/H5T.c | |
parent | b72eff165916e1763a866211928507b36d58f3a5 (diff) | |
download | hdf5-4f967d5029cd8e0080f5637efd403842394f87d0.zip hdf5-4f967d5029cd8e0080f5637efd403842394f87d0.tar.gz hdf5-4f967d5029cd8e0080f5637efd403842394f87d0.tar.bz2 |
[svn-r30139] Description:
Bring over missing flush+refresh routines, to address Java failures.
Tested on:
MacOSX/64 10.11.5 (amazon) w/serial, parallel & production
Linux/64 2.6.18 (jam) w/Java
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 72 |
1 files changed, 72 insertions, 0 deletions
@@ -5495,3 +5495,75 @@ H5T_patch_vlen_file(H5T_t *dt, H5F_t *f) FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5T_patch_vlen_file() */ + +/*------------------------------------------------------------------------- + * Function: H5Tflush + * + * Purpose: Flushes all buffers associated with a named datatype to disk. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * May 19, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Tflush(hid_t type_id) +{ + H5T_t *dt; /* Datatype for this operation */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + + /* To flush metadata and invoke flush callback if there is */ + if(H5O_flush_common(&dt->oloc, type_id, H5AC_ind_read_dxpl_id) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFLUSH, FAIL, "unable to flush datatype and object flush callback") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Tflush */ + + +/*------------------------------------------------------------------------- + * Function: H5Trefresh + * + * Purpose: Refreshes all buffers associated with a named datatype. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * July 21, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Trefresh(hid_t type_id) +{ + H5T_t * dt = NULL; + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("e", "i", type_id); + + /* Check args */ + if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + if(!H5T_is_named(dt)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a committed datatype") + + /* Call private function to refresh datatype object */ + if ((H5O_refresh_metadata(type_id, dt->oloc, H5AC_ind_read_dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTLOAD, FAIL, "unable to refresh datatype") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Trefresh */ + |