diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/H5B2cache.c | 6 | ||||
-rw-r--r-- | src/H5EAcache.c | 10 | ||||
-rw-r--r-- | src/H5F.c | 172 | ||||
-rw-r--r-- | src/H5FAcache.c | 6 | ||||
-rw-r--r-- | src/H5FD.c | 26 | ||||
-rw-r--r-- | src/H5FDprivate.h | 1 | ||||
-rw-r--r-- | src/H5FScache.c | 4 | ||||
-rw-r--r-- | src/H5Fio.c | 21 | ||||
-rw-r--r-- | src/H5Fpkg.h | 2 | ||||
-rw-r--r-- | src/H5Fprivate.h | 10 | ||||
-rw-r--r-- | src/H5Fpublic.h | 8 | ||||
-rw-r--r-- | src/H5Fsuper_cache.c | 14 | ||||
-rw-r--r-- | src/H5HFcache.c | 26 | ||||
-rw-r--r-- | src/H5Ocache.c | 13 | ||||
-rw-r--r-- | src/H5Pfapl.c | 52 | ||||
-rw-r--r-- | src/H5Ppublic.h | 4 | ||||
-rw-r--r-- | src/H5SMcache.c | 4 |
17 files changed, 308 insertions, 71 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c index e9030d8..1d97c63 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -188,7 +188,7 @@ H5B2__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_BTREE, H5E_NOSPACE, NULL, "can't get actual buffer") /* Read and validate header from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, addr, hdr->hdr_size, hdr->hdr_size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, H5AC_BT2_HDR_ID, addr, hdr->hdr_size, hdr->hdr_size, dxpl_id, buf, &computed_chksum) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 B-tree header") /* Get temporary pointer to serialized header */ @@ -607,7 +607,7 @@ H5B2__cache_internal_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) chk_size = H5B2_INT_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size) + ((udata->nrec + 1) * H5B2_INT_POINTER_SIZE(udata->hdr, udata->depth)); /* Read and validate internal node from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, chk_size, dxpl_id, udata->hdr->page, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, H5AC_BT2_INT_ID, addr, udata->hdr->node_size, chk_size, dxpl_id, udata->hdr->page, &computed_chksum) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 internal node") p = udata->hdr->page; @@ -1030,7 +1030,7 @@ H5B2__cache_leaf_load(H5F_t UNUSED *f, hid_t dxpl_id, haddr_t addr, void *_udata chk_size = H5B2_LEAF_PREFIX_SIZE + (udata->nrec * udata->hdr->rrec_size); /* Read and validate leaf node from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, addr, udata->hdr->node_size, chk_size, dxpl_id, udata->hdr->page, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_BTREE, H5AC_BT2_LEAF_ID, addr, udata->hdr->node_size, chk_size, dxpl_id, udata->hdr->page, &computed_chksum) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for v2 leaf node") p = udata->hdr->page; diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 381b364..789cdf8 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -234,7 +234,7 @@ H5EA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate header from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_HDR, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_HDR, H5AC_EARRAY_HDR_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array header") /* Get temporary pointer to serialized header */ @@ -598,7 +598,7 @@ H5EA__cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate index block from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_IBLOCK, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_IBLOCK, H5AC_EARRAY_IBLOCK_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array index block") /* Get temporary pointer to serialized header */ @@ -1012,7 +1012,7 @@ H5EA__cache_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate super block from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_SBLOCK, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_SBLOCK, H5AC_EARRAY_SBLOCK_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array super block") /* Get temporary pointer to serialized header */ @@ -1408,7 +1408,7 @@ H5EA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate data block from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_DBLOCK, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_DBLOCK, H5AC_EARRAY_DBLOCK_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible data block") /* Get temporary pointer to serialized header */ @@ -1804,7 +1804,7 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate data block page from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_DBLK_PAGE, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_EARRAY_DBLK_PAGE, H5AC_EARRAY_DBLK_PAGE_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for extensible array data block page") /* Get temporary pointer to serialized header */ @@ -367,7 +367,7 @@ H5F_get_access_plist(H5F_t *f, hbool_t app_ref) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size") if(H5P_set(new_plist, H5F_ACS_LATEST_FORMAT_NAME, &(f->shared->latest_format)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag") - if(H5P_set(new_plist, H5F_ACS_READ_ATTEMPTS_NAME, &(f->read_attempts)) < 0) + if(H5P_set(new_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &(f->read_attempts)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'latest format' flag") if(f->shared->efc) efc_size = H5F_efc_max_nfiles(f->shared->efc); @@ -1239,6 +1239,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5FD_class_t *drvr; /*file driver class info */ H5P_genplist_t *a_plist; /*file access property list */ H5F_close_degree_t fc_degree; /*file close degree */ + unsigned i; /*local index variable */ H5F_t *ret_value; /*actual return value */ FUNC_ENTER_NOAPI(NULL) @@ -1365,16 +1366,29 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not file access property list") /* Retrieve the # of read attempts here so that sohm in superblock will get the correct # of attempts */ - if(H5P_get(a_plist, H5F_ACS_READ_ATTEMPTS_NAME, &file->read_attempts) < 0) + if(H5P_get(a_plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &file->read_attempts) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get the # of read attempts") - /* When opening file with SWMR access, the # of read attempts is H5_SWMR_READ_ATTEMPTS if not set */ - /* When opening file with non-SWMR access, the # of read attempts is always H5F_READ_ATTEMPTS (set or not set) */ + /* When opening file with SWMR access, the # of read attempts is H5F_SWMR_METADATA_READ_ATTEMPTS if not set */ + /* When opening file without SWMR access, the # of read attempts is always H5F_METADATA_READ_ATTEMPTS (set or not set) */ if(file->intent & H5F_ACC_SWMR_READ || file->intent & H5F_ACC_SWMR_WRITE) { if(!file->read_attempts) - file->read_attempts = H5F_SWMR_READ_ATTEMPTS; + file->read_attempts = H5F_SWMR_METADATA_READ_ATTEMPTS; + /* Turn off accumulator */ + shared->feature_flags = lf->feature_flags & ~H5FD_FEAT_ACCUMULATE_METADATA; + if(H5FD_set_feature_flags(lf, shared->feature_flags) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, NULL, "can't set feature_flags in VFD") } else - file->read_attempts = H5F_READ_ATTEMPTS; + file->read_attempts = H5F_METADATA_READ_ATTEMPTS; + + /* Determine the # of bins for metdata read retries */ + file->retries_nbins = 0; + if(file->read_attempts > 1) + file->retries_nbins = HDlog10((double)(file->read_attempts - 1)) + 1; + + /* Initialize the tracking for metadata read retries */ + for(i = 0; i < H5AC_NTYPES; i++) + file->retries[i] = NULL; /* * Read or write the file superblock, depending on whether the file is @@ -2122,6 +2136,7 @@ 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) @@ -2141,6 +2156,11 @@ H5Freopen(hid_t file_id) /* 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); @@ -3154,6 +3174,97 @@ done: /*------------------------------------------------------------------------- + * Function: H5Fget_metadata_read_retries_info + * + * Purpose: To retrieve the collection of read retries for metadata items with checksum. + * + * Return: Success: non-negative on success + * Failure: Negative + * + * Programmer: Vailin Choi; October 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info) +{ + H5F_t *file; /* File object for file ID */ + unsigned i, j; /* Local index variable */ + size_t tot_size; /* Size of each retries[i] */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", file_id, info); + + /* Check args */ + if(!info) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") + + /* Get the file pointer */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + + /* Copy the # of bins for "retries" array */ + info->nbins = file->retries_nbins; + + /* Initialize the array of "retries" */ + for(i = 0; i < NUM_METADATA_READ_RETRIES; i++) + info->retries[i] = NULL; + + /* Return if there are no bins -- no retries */ + if(!info->nbins) + HGOTO_DONE(SUCCEED); + + /* Calculate size for each retries[i] */ + tot_size = info->nbins * sizeof(uint32_t); + + /* Map and copy information to info's retries for metadata items with tracking for read retries */ + j = 0; + for(i = 0; i < H5AC_NTYPES; i++) { + switch(i) { + case H5AC_OHDR_ID: + case H5AC_OHDR_CHK_ID: + case H5AC_BT2_HDR_ID: + case H5AC_BT2_INT_ID: + case H5AC_BT2_LEAF_ID: + case H5AC_FHEAP_HDR_ID: + case H5AC_FHEAP_DBLOCK_ID: + case H5AC_FHEAP_IBLOCK_ID: + case H5AC_FSPACE_HDR_ID: + case H5AC_FSPACE_SINFO_ID: + case H5AC_SOHM_TABLE_ID: + case H5AC_SOHM_LIST_ID: + case H5AC_EARRAY_HDR_ID: + case H5AC_EARRAY_IBLOCK_ID: + case H5AC_EARRAY_SBLOCK_ID: + case H5AC_EARRAY_DBLOCK_ID: + case H5AC_EARRAY_DBLK_PAGE_ID: + case H5AC_FARRAY_HDR_ID: + 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) { + /* Allocate memory for retries[i] */ + if((info->retries[j] = (uint32_t *)HDmalloc(tot_size)) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + /* Copy the information */ + HDmemcpy(info->retries[j], file->retries[i], tot_size); + } + j++; + break; + + default: + break; + } /* end switch */ + } /* end for */ + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Fget_metadata_read_retries_info() */ + + +/*------------------------------------------------------------------------- * Function: H5Fget_free_sections * * Purpose: To get free-space section information for free-space manager with @@ -3375,3 +3486,52 @@ H5F_set_store_msg_crt_idx(H5F_t *f, hbool_t flag) FUNC_LEAVE_NOAPI(SUCCEED) } /* H5F_set_store_msg_crt_idx() */ + + +/*------------------------------------------------------------------------- + * Function: H5F_track_metadata_read_retries + * + * Purpose: To track the # of a "retries" (log10) for a metadata item. + * This routine should be used only when: + * "retries" > 0 + * f->read_attempts > 1 (does not have retry when 1) + * f->retries_nbins > 0 (calculated based on f->read_attempts) + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Vailin Choi; October 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_track_metadata_read_retries(H5F_t *f, H5AC_type_t actype, unsigned retries) +{ + unsigned log_ind; /* Index to the array of retries based on log10 of retries */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(f); + HDassert(f->read_attempts > 1); + HDassert(f->retries_nbins > 0); + HDassert(retries > 0); + HDassert(retries < f->read_attempts); + HDassert(actype < H5AC_NTYPES); + + /* Allocate memory for retries */ + if(f->retries[actype] == NULL) + if((f->retries[actype] = (uint32_t *)HDcalloc(f->retries_nbins, sizeof(uint32_t))) == NULL) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Index to retries based on log10 */ + log_ind = HDlog10((double)retries); + HDassert(log_ind < f->retries_nbins); + + /* Increment the # of the "retries" */ + f->retries[actype][log_ind]++; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5F_track_metadata_read_retries() */ diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 9b2d32c..56ed1e3 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -195,7 +195,7 @@ H5FA__cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and vaildate header from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_HDR, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_HDR, H5AC_FARRAY_HDR_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for fixed array header") /* Get temporary pointer to serialized header */ @@ -539,7 +539,7 @@ H5FA__cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata)) H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate data block from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_DBLOCK, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_DBLOCK, H5AC_FARRAY_DBLOCK_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for fixed array data block") /* Get temporary pointer to serialized header */ @@ -932,7 +932,7 @@ HDfprintf(stderr, "%s: addr = %a\n", FUNC, addr); H5E_THROW(H5E_CANTGET, "can't get actual buffer") /* Read and validate data block page from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_DBLK_PAGE, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FARRAY_DBLK_PAGE, H5AC_FARRAY_DBLK_PAGE_ID, addr, size, size, dxpl_id, buf, &computed_chksum) < 0) H5E_THROW(H5E_BADVALUE, "incorrect metadata checksum for fixed array data block page") /* Get temporary pointer to serialized header */ @@ -1598,6 +1598,32 @@ H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags) /*------------------------------------------------------------------------- + * Function: H5FD_set_feature_flags + * + * Purpose: Set the feature flags for the VFD + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Vailin Choi; Oct 2013 + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(file); + + /* Set the file's feature flags */ + file->feature_flags = feature_flags; + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5FD_set_feature_flags() */ + + +/*------------------------------------------------------------------------- * Function: H5FD_get_fs_type_map * * Purpose: Retrieve the free space type mapping for the VFD diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 600cae1..b21ecca 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -134,6 +134,7 @@ H5_DLL herr_t H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr); H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file); H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); +H5_DLL herr_t H5FD_set_feature_flags(H5FD_t *file, unsigned long feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); H5_DLL herr_t H5FD_read(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/); diff --git a/src/H5FScache.c b/src/H5FScache.c index 9e93fdf..c3511ac 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -183,7 +183,7 @@ H5FS_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_FSPACE, H5E_NOSPACE, NULL, "can't get actual buffer") /* Read and validate header from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FSPACE_HDR, addr, fspace->hdr_size, fspace->hdr_size, dxpl_id, hdr, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FSPACE_HDR, H5AC_FSPACE_HDR_ID, addr, fspace->hdr_size, fspace->hdr_size, dxpl_id, hdr, &computed_chksum) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for free space header") p = hdr; @@ -575,7 +575,7 @@ H5FS_cache_sinfo_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Read and validate free space sections from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FSPACE_SINFO, udata->fspace->sect_addr, (size_t)udata->fspace->sect_size, (size_t)udata->fspace->sect_size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FSPACE_SINFO, H5AC_FSPACE_SINFO_ID, udata->fspace->sect_addr, (size_t)udata->fspace->sect_size, (size_t)udata->fspace->sect_size, dxpl_id, buf, &computed_chksum) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, NULL, "incorrect metadata checksum for free space sections") /* Deserialize free sections from buffer available */ diff --git a/src/H5Fio.c b/src/H5Fio.c index bd8c39a..6c87284 100644 --- a/src/H5Fio.c +++ b/src/H5Fio.c @@ -291,9 +291,11 @@ H5F_get_checksums(uint8_t *buf, size_t chk_size, uint32_t *s_chksum/*out*/, uint * a) read the piece of metadata * b) calculate checksum for the buffer of metadata * c) decode the checksum stored in the buffer of metadata - d) compare the computed checksum with its stored checksum + * d) compare the computed checksum with its stored checksum * The library will perform (a) to (d) above for "f->read_attempts" * times or until the checksum comparison in (d) passes. + * This routine also tracks the # of retries via + * H5F_track_metadata_read_retries() * * Return: Non-negative on success/Negative on failure * @@ -302,13 +304,14 @@ H5F_get_checksums(uint8_t *buf, size_t chk_size, uint32_t *s_chksum/*out*/, uint *------------------------------------------------------------------------- */ herr_t -H5F_read_check_metadata(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t read_size, size_t chk_size, +H5F_read_check_metadata(H5F_t *f, H5FD_mem_t type, H5AC_type_t actype, haddr_t addr, size_t read_size, size_t chk_size, hid_t dxpl_id, uint8_t *buf/*out*/, uint32_t *chksum/*out*/) { - size_t tries, max_tries; + size_t tries, max_tries; /* The # of read attempts */ + size_t retries; /* The # of retries */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -332,8 +335,14 @@ H5F_read_check_metadata(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t re if(tries == 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "incorrect metadatda checksum after all read attempts (%u) for %u bytes:c_chksum=%u, s_chkum=%u", max_tries, chk_size, computed_chksum, stored_chksum) - else if((max_tries - tries + 1) > 1) - HDfprintf(stderr, "%s: SUCCESS after %u attempts; type=%u\n", FUNC, max_tries - tries + 1, type); + + /* Calculate and track the # of retries */ + retries = max_tries - tries; + if(retries) { /* Does not track 0 retry */ + HDfprintf(stderr, "%s: SUCCESS after %u retries; actype=%u\n", FUNC, retries, actype); + if(H5F_track_metadata_read_retries(f, actype, retries) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "cannot track read tries = %u ", retries) + } /* Return the computed checksum */ if(chksum) diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index b8d623a..c4f7c02 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -275,6 +275,8 @@ struct H5F_t { hbool_t closing; /* File is in the process of being closed */ struct H5F_t *parent; /* Parent file that this file is mounted to */ unsigned nmounts; /* Number of children mounted to this file */ + uint32_t *retries[H5AC_NTYPES]; /* Track # of read retries for metdata items with checksum */ + unsigned retries_nbins; /* # of bins for each retries[] */ }; diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 5f81cb7..cac34b7 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -462,7 +462,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; #define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */ #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ -#define H5F_ACS_READ_ATTEMPTS_NAME "read_attempts" /* # of read attempts */ +#define H5F_ACS_METADATA_READ_ATTEMPTS_NAME "metadata_read_attempts" /* # of metadata read attempts */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ #define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ @@ -507,8 +507,8 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; #define H5_SIZEOF_CHKSUM 4 -#define H5F_READ_ATTEMPTS 1 /* Default # of read attempts for non-swmr access */ -#define H5F_SWMR_READ_ATTEMPTS 100 /* Default # of read attempts for swmr access */ +#define H5F_METADATA_READ_ATTEMPTS 1 /* Default # of read attempts for non-SWMR access */ +#define H5F_SWMR_METADATA_READ_ATTEMPTS 100 /* Default # of read attempts for SWMR access */ /* v1 B-tree node signature */ #define H5B_MAGIC "TREE" @@ -639,9 +639,11 @@ H5_DLL herr_t H5F_flush_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); H5_DLL herr_t H5F_evict_tagged_metadata(H5F_t * f, haddr_t tag, hid_t dxpl_id); /* Function that read and verify a piece of metadata with checksum */ -H5_DLL herr_t H5F_read_check_metadata(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t read_size, size_t chk_size, +H5_DLL herr_t H5F_read_check_metadata(H5F_t *f, H5FD_mem_t type, unsigned actype, haddr_t addr, size_t read_size, size_t chk_size, hid_t dxpl_id, uint8_t *buf/*out*/, uint32_t *chksum/*out*/); H5_DLL herr_t H5F_get_checksums(uint8_t *buf, size_t chk_size, uint32_t *s_chksum, uint32_t *c_chksum); +/* Routine to track the # of retries */ +H5_DLL herr_t H5F_track_metadata_read_retries(H5F_t *f, unsigned actype, unsigned retries); /* Address-related functions */ H5_DLL void H5F_addr_encode(const H5F_t *f, uint8_t **pp, haddr_t addr); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index b0907e0..b2c1b6b 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -185,6 +185,13 @@ typedef enum H5F_file_space_type_t { H5F_FILE_SPACE_NTYPES /* must be last */ } H5F_file_space_type_t; +/* Data structure to report the collection of read retries for metadata items with checksum */ +/* Used by public routine H5Fget_metadata_read_retries_info() */ +#define NUM_METADATA_READ_RETRIES 21 +typedef struct H5F_retries_info_t { + unsigned nbins; + uint32_t *retries[NUM_METADATA_READ_RETRIES]; +} H5F_retries_info_t; #ifdef __cplusplus extern "C" { @@ -223,6 +230,7 @@ H5_DLL herr_t H5Fget_mdc_size(hid_t file_id, H5_DLL herr_t H5Freset_mdc_hit_rate_stats(hid_t file_id); H5_DLL ssize_t H5Fget_name(hid_t obj_id, char *name, size_t size); H5_DLL herr_t H5Fget_info2(hid_t obj_id, H5F_info2_t *finfo); +H5_DLL herr_t H5Fget_metadata_read_retries_info(hid_t file_id, H5F_retries_info_t *info); H5_DLL ssize_t H5Fget_free_sections(hid_t file_id, H5F_mem_t type, size_t nsects, H5F_sect_info_t *sect_info/*out*/); H5_DLL herr_t H5Fclear_elink_file_cache(hid_t file_id); diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 3d906c7..4216bbe 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -127,9 +127,10 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) size_t variable_size; /*variable sizeof superblock */ uint8_t *p; /* Temporary pointer into encoding buffer */ unsigned super_vers; /* Superblock version */ - hbool_t *dirtied = (hbool_t *)_udata; /* Set up dirtied out value */ + hbool_t *dirtied = (hbool_t *)_udata; /* Set up dirtied out value */ size_t tries, max_tries; /* The # of read attempts to try */ - size_t fixed_tries; /* The # of read attempts to try */ + size_t fixed_tries; /* The # of read attempts to try for the fixed-size portion */ + size_t retries; /* The # of retries */ uint32_t computed_chksum; /* Computed checksum */ uint32_t stored_chksum; /* Checksum read from file */ H5F_super_t *ret_value; /* Return value */ @@ -240,8 +241,13 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) if(tries == 0) /* After all tries (for SWMR access) or after 1 try (for non-SWMR) */ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "bad checksum or bad byte number in superblock") - else if((max_tries - tries + 1) > 1) - HDfprintf(stderr, "%s: SUCCESS after %u attempts\n", FUNC, max_tries - tries + 1); + + retries = max_tries - tries; + if(retries) { /* Does not track 0 retry */ + HDfprintf(stderr, "%s: SUCCESS after %u retries\n", FUNC, retries); + if(H5F_track_metadata_read_retries(f, H5AC_SUPERBLOCK_ID, retries) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "cannot track read retries = %u ", retries) + } /* Check for older version of superblock format */ if(super_vers < HDF5_SUPERBLOCK_VERSION_2) { diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 2b098be..c91ef1b 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -408,7 +408,8 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ size_t tries, max_tries; /* The # of read attempts */ - size_t fixed_tries; + size_t fixed_tries; /* The # of read attempts for the minimum portion */ + size_t retries; /* The # of retries */ H5HF_hdr_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -488,8 +489,14 @@ H5HF_cache_hdr_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(tries == 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum after all tries (%u) for fractal heap header", max_tries) - else if((max_tries - tries + 1) > 1) - HDfprintf(stderr, "%s: SUCCESS after %u attempts\n", FUNC, max_tries - tries + 1); + + /* Calculate and track the # of retry */ + retries = max_tries - tries; + if(retries) { /* Does not track 0 retry */ + HDfprintf(stderr, "%s: SUCCESS after %u retries\n", FUNC, retries); + if(H5F_track_metadata_read_retries(f, H5AC_FHEAP_HDR_ID, retries) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "cannot track read tries = %u ", retries) + } p = buf; @@ -845,7 +852,7 @@ H5HF_cache_iblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, NULL, "can't get actual buffer") /* Read and validate indirect block from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_FHEAP_IBLOCK, addr, iblock->size, iblock->size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_FHEAP_IBLOCK, H5AC_FHEAP_IBLOCK_ID, addr, iblock->size, iblock->size, dxpl_id, buf, &computed_chksum) < 0) HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "incorrect metadata checksum for fractal heap indirect block") /* Get temporary pointer to serialized indirect block */ @@ -1308,6 +1315,7 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) uint32_t computed_chksum; /* Computed metadata checksum value */ uint32_t stored_chksum; /* Metadata checksum value */ size_t tries, max_tries; /* The # of read attempts */ + size_t retries; /* The # of retries */ size_t chk_size; /* The size for validating checksum */ uint8_t *chk_p; /* Pointer to the area for validating checksum */ size_t read_size; /* Size of filtered direct block to read */ @@ -1431,8 +1439,14 @@ H5HF_cache_dblock_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(tries == 0) HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "incorrect metadata checksum after all tries (%u) for fractal heap direct block", max_tries) - else if((max_tries - tries + 1) > 1) - HDfprintf(stderr, "%s: SUCCESS after %u attempts\n", FUNC, max_tries - tries + 1); + + /* Calculate and track the # of retries */ + retries = max_tries - tries; + if(retries) { /* Does not track 0 retry */ + HDfprintf(stderr, "%s: SUCCESS after %u retries\n", FUNC, retries); + if(H5F_track_metadata_read_retries(f, H5AC_FHEAP_DBLOCK_ID, retries) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_BADVALUE, NULL, "cannot track read retries = %u ", retries) + } /* Start decoding direct block */ p = dblock->blk; diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 3a087e5..35d7f44 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -319,6 +319,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) size_t buf_size; /* Size of prefix+chunk #0 buffer */ haddr_t eoa; /* Relative end of file address */ size_t tries, max_tries; /* The # of read attempts */ + size_t retries; /* The # of retries */ size_t fixed_tries; /* The # of read attempts for prefix */ uint32_t stored_chksum; /* Stored metadata checksum value */ uint32_t computed_chksum; /* Computed metadata checksum value */ @@ -420,8 +421,14 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) if(tries == 0) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "incorrect metadata checksum for object header chunk after all read tries (%u) for %u bytes", max_tries, buf_size) - else if((max_tries - tries + 1) > 1) - HDfprintf(stderr, "%s: SUCCESS after %u attempts\n", FUNC, max_tries - tries + 1); + + /* Calculate and track the # of retries */ + retries = max_tries - tries; + if(retries) { /* Does not track 0 retry */ + HDfprintf(stderr, "%s: SUCCESS after %u retries\n", FUNC, retries); + if(H5F_track_metadata_read_retries(f, H5AC_OHDR_ID, retries) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "cannot track read retries = %u ", retries) + } /* File-specific, non-stored information */ oh->sizeof_size = H5F_SIZEOF_SIZE(udata->common.f); @@ -818,7 +825,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* Read rest of the raw data */ if(udata->oh->version == H5O_VERSION_2 && udata->decoding) { /* Read and validate object header continuation chunk */ - if(H5F_read_check_metadata(f, H5FD_MEM_OHDR, addr, udata->size, udata->size, dxpl_id, buf, NULL) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_OHDR, H5AC_OHDR_CHK_ID, addr, udata->size, udata->size, dxpl_id, buf, NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADVALUE, NULL, "incorrect metadata checksum for object header continuation chunk") } else { /* Read the header object continuation chunk */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index adae24f..269f064 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -160,11 +160,11 @@ #define H5F_ACS_FILE_IMAGE_INFO_DEL H5P_file_image_info_del #define H5F_ACS_FILE_IMAGE_INFO_COPY H5P_file_image_info_copy #define H5F_ACS_FILE_IMAGE_INFO_CLOSE H5P_file_image_info_close -/* Definition for # of read attempts */ -#define H5F_ACS_READ_ATTEMPTS_SIZE sizeof(unsigned) -#define H5F_ACS_READ_ATTEMPTS_DEF 0 -#define H5F_ACS_READ_ATTEMPTS_ENC H5P__encode_unsigned -#define H5F_ACS_READ_ATTEMPTS_DEC H5P__decode_unsigned +/* Definition for # of metadata read attempts */ +#define H5F_ACS_METADATA_READ_ATTEMPTS_SIZE sizeof(unsigned) +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEF 0 +#define H5F_ACS_METADATA_READ_ATTEMPTS_ENC H5P__encode_unsigned +#define H5F_ACS_METADATA_READ_ATTEMPTS_DEC H5P__decode_unsigned /******************/ /* Local Typedefs */ @@ -251,7 +251,7 @@ static const hbool_t H5F_def_latest_format_g = H5F_ACS_LATEST_FORMAT_DEF; static const hbool_t H5F_def_want_posix_fd_g = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ static const unsigned H5F_def_efc_size_g = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ static const H5FD_file_image_info_t H5F_def_file_image_info_g = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ -static const unsigned H5F_def_read_attempts_g = H5F_ACS_READ_ATTEMPTS_DEF; /* Default setting for the # of read attempts */ +static const unsigned H5F_def_metadata_read_attempts_g = H5F_ACS_METADATA_READ_ATTEMPTS_DEF; /* Default setting for the # of metadata read attempts */ /*------------------------------------------------------------------------- @@ -402,8 +402,8 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the # of read attempts */ - if(H5P_register_real(pclass, H5F_ACS_READ_ATTEMPTS_NAME, H5F_ACS_READ_ATTEMPTS_SIZE, &H5F_def_read_attempts_g, - NULL, NULL, NULL, H5F_ACS_READ_ATTEMPTS_ENC, H5F_ACS_READ_ATTEMPTS_DEC, + if(H5P_register_real(pclass, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, H5F_ACS_METADATA_READ_ATTEMPTS_SIZE, &H5F_def_metadata_read_attempts_g, + NULL, NULL, NULL, H5F_ACS_METADATA_READ_ATTEMPTS_ENC, H5F_ACS_METADATA_READ_ATTEMPTS_DEC, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") done: @@ -2991,13 +2991,15 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) /*------------------------------------------------------------------------- - * Function: H5Pset_read_attempts + * Function: H5Pset_metadata_read_attempts * * Purpose: Sets the # of read attempts in the file access property list * when reading metadata with checksum. - * The # of read attempts set via this routine will apply only - * when opening file with SWMR access. When opening file with - * non-SWMR access, the # of read attempts will always be 1. + * The # of read attempts set via this routine will only apply + * when opening a file with SWMR access. + * The # of read attempts set via this routine does not have + * any effect when opening a file with non-SWMR access; for this + * case, the # of read attempts will be always be 1. * * Return: Non-negative on success/Negative on failure * @@ -3006,7 +3008,7 @@ H5P__facc_multi_type_dec(const void **_pp, void *_value) *------------------------------------------------------------------------- */ herr_t -H5Pset_read_attempts(hid_t plist_id, unsigned attempts) +H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -3016,25 +3018,25 @@ H5Pset_read_attempts(hid_t plist_id, unsigned attempts) /* Cannot set the # of attempts to 0 */ if(attempts <= 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "number of attempts must be greater than 0"); + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "number of metadatata read attempts must be greater than 0"); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") /* Set values */ - if(H5P_set(plist, H5F_ACS_READ_ATTEMPTS_NAME, &attempts) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set # of read attempts") + if(H5P_set(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, &attempts) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set # of metadata read attempts") done: FUNC_LEAVE_API(ret_value) -} /* H5Pset_read_attempts() */ +} /* H5Pset_metadata_read_attempts() */ /*------------------------------------------------------------------------- - * Function: H5Pget_read_attempts + * Function: H5Pget_metadata_read_attempts * - * Purpose: Returns the # of read attempts set in the file access property list. + * Purpose: Returns the # of metadata read attempts set in the file access property list. * * Return: Non-negative on success/Negative on failure * @@ -3043,7 +3045,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Pget_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) +H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* Return value */ @@ -3058,13 +3060,13 @@ H5Pget_read_attempts(hid_t plist_id, unsigned *attempts/*out*/) /* Get values */ if(attempts) { /* Get the # of read attempts set */ - if(H5P_get(plist, H5F_ACS_READ_ATTEMPTS_NAME, attempts) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get alignment") + if(H5P_get(plist, H5F_ACS_METADATA_READ_ATTEMPTS_NAME, attempts) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get the number of metadata read attempts") /* If not set, return the default value */ - if(*attempts == H5F_ACS_READ_ATTEMPTS_DEF) /* 0 */ - *attempts = H5F_READ_ATTEMPTS; + if(*attempts == H5F_ACS_METADATA_READ_ATTEMPTS_DEF) /* 0 */ + *attempts = H5F_METADATA_READ_ATTEMPTS; } done: FUNC_LEAVE_API(ret_value) -} /* end H5Pget_read_attempts() */ +} /* end H5Pget_metadata_read_attempts() */ diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index f2b9e8f..5caedf6 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -344,8 +344,8 @@ H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); H5_DLL herr_t H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr); -H5_DLL herr_t H5Pset_read_attempts(hid_t plist_id, unsigned attempts); -H5_DLL herr_t H5Pget_read_attempts(hid_t plist_id, unsigned *attempts/*out*/); +H5_DLL herr_t H5Pset_metadata_read_attempts(hid_t plist_id, unsigned attempts); +H5_DLL herr_t H5Pget_metadata_read_attempts(hid_t plist_id, unsigned *attempts/*out*/); /* Dataset creation property list (DCPL) routines */ H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index c5b333f..b01fcdc 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -159,7 +159,7 @@ H5SM_table_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *udata) HGOTO_ERROR(H5E_SOHM, H5E_NOSPACE, NULL, "can't get actual buffer") /* Read and validate shared message table from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_SOHM_TABLE, addr, table->table_size, table->table_size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_SOHM_TABLE, H5AC_SOHM_TABLE_ID, addr, table->table_size, table->table_size, dxpl_id, buf, &computed_chksum) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, NULL, "incorrect metadata checksum for shared message table") /* Get temporary pointer to serialized table */ @@ -494,7 +494,7 @@ H5SM_list_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) chk_size = H5SM_LIST_SIZE(udata->f, udata->header->num_messages); /* Read and validate shared message list from disk */ - if(H5F_read_check_metadata(f, H5FD_MEM_SOHM_INDEX, addr, udata->header->list_size, chk_size, dxpl_id, buf, &computed_chksum) < 0) + if(H5F_read_check_metadata(f, H5FD_MEM_SOHM_INDEX, H5AC_SOHM_LIST_ID, addr, udata->header->list_size, chk_size, dxpl_id, buf, &computed_chksum) < 0) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, NULL, "incorrect metadata checksum for shared message list") |