diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2015-06-24 23:47:24 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2015-06-24 23:47:24 (GMT) |
commit | 39b99473ea6e83aa394779a591eeef55fe141487 (patch) | |
tree | 624455e25b0c7221ee9507bb7bcbbfb2a8c4b0f2 /src/H5F.c | |
parent | e36e886cf75b836aba005abea24b955057778ebb (diff) | |
download | hdf5-39b99473ea6e83aa394779a591eeef55fe141487.zip hdf5-39b99473ea6e83aa394779a591eeef55fe141487.tar.gz hdf5-39b99473ea6e83aa394779a591eeef55fe141487.tar.bz2 |
[svn-r27281] Bring revision #24478 from revise_chksum_retry branch to revise_chunks. h5committested.
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 34 |
1 files changed, 13 insertions, 21 deletions
@@ -61,7 +61,6 @@ /********************/ - /*********************/ /* Package Variables */ /*********************/ @@ -834,7 +833,6 @@ H5Freopen(hid_t file_id) { H5F_t *old_file = NULL; H5F_t *new_file = NULL; - unsigned i; hid_t ret_value; FUNC_ENTER_API(FAIL) @@ -848,14 +846,6 @@ H5Freopen(hid_t file_id) if(NULL == (new_file = H5F_new(old_file->shared, 0, H5P_FILE_CREATE_DEFAULT, H5P_FILE_ACCESS_DEFAULT, NULL))) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to reopen file") - /* Keep old file's read attempts in new file */ - new_file->read_attempts = old_file->read_attempts; - - new_file->retries_nbins = old_file->retries_nbins; - for(i = 0; i < H5AC_NTYPES; i++) - new_file->retries[i] = NULL; - - /* Duplicate old file's names */ new_file->open_name = H5MM_xstrdup(old_file->open_name); new_file->actual_name = H5MM_xstrdup(old_file->actual_name); @@ -1428,7 +1418,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Fget_metadata_read_retries_info + * Function: H5Fget_metadata_read_retry_info * * Purpose: To retrieve the collection of read retries for metadata items with checksum. * @@ -1440,7 +1430,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info) +H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) { H5F_t *file; /* File object for file ID */ unsigned i, j; /* Local index variable */ @@ -1459,11 +1449,10 @@ H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Copy the # of bins for "retries" array */ - info->nbins = file->retries_nbins; + info->nbins = file->shared->retries_nbins; /* Initialize the array of "retries" */ - for(i = 0; i < NUM_METADATA_READ_RETRIES; i++) - info->retries[i] = NULL; + HDmemset(info->retries, 0, sizeof(info->retries)); /* Return if there are no bins -- no retries */ if(!info->nbins) @@ -1497,14 +1486,17 @@ H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info) case H5AC_FARRAY_DBLOCK_ID: case H5AC_FARRAY_DBLK_PAGE_ID: case H5AC_SUPERBLOCK_ID: - HDassert(j < NUM_METADATA_READ_RETRIES); - if(file->retries[i] != NULL) { + HDassert(j < H5F_NUM_METADATA_READ_RETRY_TYPES); + if(file->shared->retries[i] != NULL) { /* Allocate memory for retries[i] */ - if((info->retries[j] = (uint32_t *)HDmalloc(tot_size)) == NULL) + if(NULL == (info->retries[j] = (uint32_t *)HDmalloc(tot_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* Copy the information */ - HDmemcpy(info->retries[j], file->retries[i], tot_size); - } + HDmemcpy(info->retries[j], file->shared->retries[i], tot_size); + } /* end if */ + + /* Increment location in info->retries[] array */ j++; break; @@ -1515,7 +1507,7 @@ H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info) done: FUNC_LEAVE_API(ret_value) -} /* end H5Fget_metadata_read_retries_info() */ +} /* end H5Fget_metadata_read_retry_info() */ /*------------------------------------------------------------------------- |