diff options
Diffstat (limited to 'src/H5D.c')
-rw-r--r-- | src/H5D.c | 68 |
1 files changed, 68 insertions, 0 deletions
@@ -1100,4 +1100,72 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) done: FUNC_LEAVE_API(ret_value) } /* end H5Dset_extent() */ + + +/*------------------------------------------------------------------------- + * Function: H5Dflush + * + * Purpose: Flushes all buffers associated with a dataset. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * May 19, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Dflush(hid_t dset_id) +{ + H5D_t *dset; /* Dataset for this operation */ + herr_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(H5Dflush, FAIL) + H5TRACE1("e", "i", dset_id); + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + + /* Call private function to flush dataset object */ + if (H5O_flush_metadata(&dset->oloc, H5AC_dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush dataset") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Dflush */ + + +/*------------------------------------------------------------------------- + * Function: H5Drefresh + * + * Purpose: Refreshes all buffers associated with a dataset. + * + * Return: Non-negative on success, negative on failure + * + * Programmer: Mike McGreevy + * July 21, 2010 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Drefresh(hid_t dset_id) +{ + H5D_t * dset = NULL; + hid_t ret_value = SUCCEED; /* return value */ + + FUNC_ENTER_API(H5Drefresh, FAIL) + H5TRACE1("e", "i", dset_id); + + /* Check args */ + if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") + + /* Call private function to refresh dataset object */ + if ((H5O_refresh_metadata(dset_id, dset->oloc, H5AC_dxpl_id)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTLOAD, FAIL, "unable to refresh dataset") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Drefresh */ |