diff options
author | David Young <dyoung@hdfgroup.org> | 2019-12-09 16:30:58 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2019-12-09 16:30:58 (GMT) |
commit | c8f533cfc33ac743227cbed8eba361c715a2976f (patch) | |
tree | bcae5320f80bac774647cacbbd8493604f9384d2 /src/H5Fquery.c | |
parent | adcf8a315e82c0848d126e7e46b662930c081896 (diff) | |
download | hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.zip hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.gz hdf5-c8f533cfc33ac743227cbed8eba361c715a2976f.tar.bz2 |
Merge all of my changes from merge-back-to-feature-vfd_swmr-attempt-1,
including the merge of `hdffv/hdf5/develop`, back to the branch that Vailin and
I share.
Now I need to put this branch on a fork with a less confusing name than
vchoi_fork!
Diffstat (limited to 'src/H5Fquery.c')
-rw-r--r-- | src/H5Fquery.c | 183 |
1 files changed, 155 insertions, 28 deletions
diff --git a/src/H5Fquery.c b/src/H5Fquery.c index 1dadd15..cae9429 100644 --- a/src/H5Fquery.c +++ b/src/H5Fquery.c @@ -75,6 +75,28 @@ /*------------------------------------------------------------------------- + * Function: H5F_shared_get_intent + * + * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags + * (Mainly added to stop non-file routines from poking about in the + * H5F_shared_t data structure) + * + * Return: 'intent' on success/abort on failure (shouldn't fail) + *------------------------------------------------------------------------- + */ +unsigned +H5F_shared_get_intent(const H5F_shared_t *f_sh) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f_sh); + + FUNC_LEAVE_NOAPI(f_sh->flags) +} /* end H5F_shared_get_intent() */ + + +/*------------------------------------------------------------------------- * Function: H5F_get_intent * * Purpose: Quick and dirty routine to retrieve the file's 'intent' flags @@ -207,9 +229,9 @@ H5F_get_extpath(const H5F_t *f) FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); - HDassert(f->extpath); + HDassert(f->shared->extpath); - FUNC_LEAVE_NOAPI(f->extpath) + FUNC_LEAVE_NOAPI(f->shared->extpath) } /* end H5F_get_extpath() */ @@ -221,7 +243,7 @@ H5F_get_extpath(const H5F_t *f) * Return: 'shared' on success/abort on failure (shouldn't fail) *------------------------------------------------------------------------- */ -H5F_file_t * +H5F_shared_t * H5F_get_shared(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ @@ -277,23 +299,23 @@ H5F_get_nopen_objs(const H5F_t *f) /*------------------------------------------------------------------------- - * Function: H5F_get_file_id + * Function: H5F_file_id_exists * - * Purpose: Retrieve the file's 'file_id' value + * Purpose: Determines if a file ID exists for this file struct * - * Return: 'file_id' on success/abort on failure (shouldn't fail) + * Return: TRUE/FALSE *------------------------------------------------------------------------- */ -hid_t -H5F_get_file_id(const H5F_t *f) +hbool_t +H5F_file_id_exists(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); - FUNC_LEAVE_NOAPI(f->file_id) -} /* end H5F_get_file_id() */ + FUNC_LEAVE_NOAPI(f->id_exists) +} /* end H5F_file_id_exists() */ /*------------------------------------------------------------------------- @@ -514,6 +536,25 @@ H5F_sym_leaf_k(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_get_min_dset_ohdr + * + * Purpose: Get the setting flag for minimized dataset object headers + * + * Return: TRUE/FALSE as set in file + *------------------------------------------------------------------------- + */ +hbool_t +H5F_get_min_dset_ohdr(const H5F_t *f) +{ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f); + + FUNC_LEAVE_NOAPI(f->shared->crt_dset_min_ohdr_flag) +} /* end H5F_get_min_dset_ohdr */ + + +/*------------------------------------------------------------------------- * Function: H5F_Kvalue * * Purpose: Replaced a macro to retrieve a B-tree key value for a certain @@ -808,6 +849,27 @@ H5F_store_msg_crt_idx(const H5F_t *f) /*------------------------------------------------------------------------- + * Function: H5F_shared_has_feature + * + * Purpose: Check if a file has a particular feature enabled + * + * Return: Success: Non-negative - TRUE or FALSE + * Failure: Negative (should not happen) + *------------------------------------------------------------------------- + */ +hbool_t +H5F_shared_has_feature(const H5F_shared_t *f_sh, unsigned feature) +{ + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ + FUNC_ENTER_NOAPI_NOINIT_NOERR + + HDassert(f_sh); + + FUNC_LEAVE_NOAPI((hbool_t)(f_sh->lf->feature_flags & feature)) +} /* end H5F_shared_has_feature() */ + + +/*------------------------------------------------------------------------- * Function: H5F_has_feature * * Purpose: Check if a file has a particular feature enabled @@ -885,6 +947,32 @@ done: /*------------------------------------------------------------------------- + * Function: H5F_shared_get_eoa + * + * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value + * + * Return: Non-negative on success/Negative on failure + *------------------------------------------------------------------------- + */ +haddr_t +H5F_shared_get_eoa(const H5F_shared_t *f_sh, H5FD_mem_t type) +{ + haddr_t ret_value = HADDR_UNDEF; /* Return value */ + + FUNC_ENTER_NOAPI(HADDR_UNDEF) + + HDassert(f_sh); + + /* Dispatch to driver */ + if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(f_sh->lf, type))) + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_shared_get_eoa() */ + + +/*------------------------------------------------------------------------- * Function: H5F_get_eoa * * Purpose: Quick and dirty routine to retrieve the file's 'eoa' value @@ -904,7 +992,7 @@ H5F_get_eoa(const H5F_t *f, H5FD_mem_t type) /* Dispatch to driver */ if(HADDR_UNDEF == (ret_value = H5FD_get_eoa(f->shared->lf, type))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") + HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") done: FUNC_LEAVE_NOAPI(ret_value) @@ -1007,7 +1095,7 @@ H5F_coll_md_read(const H5F_t *f) HDassert(f); - FUNC_LEAVE_NOAPI(f->coll_md_read) + FUNC_LEAVE_NOAPI(f->shared->coll_md_read) } /* end H5F_coll_md_read() */ #endif /* H5_HAVE_PARALLEL */ @@ -1171,18 +1259,17 @@ H5F_get_point_of_no_return(const H5F_t *f) FUNC_LEAVE_NOAPI(f->shared->point_of_no_return) } /* end H5F_get_point_of_no_return() */ - /*------------------------------------------------------------------------- - * Function: H5F_get_first_alloc_dealloc + * Function: H5F_get_null_fsm_addr * - * Purpose: Retrieve the 'first alloc / dealloc' value for the file. + * Purpose: Retrieve the 'null_fsm_addr' value for the file. * - * Return: Success: Non-negative, the 'first_alloc_dealloc' + * Return: Success: Non-negative, the 'null_fsm_addr' * Failure: (can't happen) *------------------------------------------------------------------------- */ hbool_t -H5F_get_first_alloc_dealloc(const H5F_t *f) +H5F_get_null_fsm_addr(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR @@ -1190,30 +1277,70 @@ H5F_get_first_alloc_dealloc(const H5F_t *f) HDassert(f); HDassert(f->shared); - FUNC_LEAVE_NOAPI(f->shared->first_alloc_dealloc) -} /* end H5F_get_first_alloc_dealloc() */ + FUNC_LEAVE_NOAPI(f->shared->null_fsm_addr) +} /* end H5F_get_null_fsm_addr() */ /*------------------------------------------------------------------------- - * Function: H5F_get_eoa_pre_fsm_fsalloc + * Function: H5F_get_vol_cls * - * Purpose: Retrieve the 'EOA pre-FSM fsalloc' value for the file. + * Purpose: Get the VOL class for the file + * + * Return: VOL class pointer for file, can't fail + * + * Programmer: Quincey Koziol + * Saturday, August 17, 2019 * - * Return: Success: Non-negative, the 'EOA pre-FSM fsalloc' - * Failure: (can't happen) *------------------------------------------------------------------------- */ -haddr_t -H5F_get_eoa_pre_fsm_fsalloc(const H5F_t *f) +const H5VL_class_t * +H5F_get_vol_cls(const H5F_t *f) { - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(f); HDassert(f->shared); - FUNC_LEAVE_NOAPI(f->shared->eoa_pre_fsm_fsalloc) -} /* end H5F_get_eoa_pre_fsm_fsalloc() */ + FUNC_LEAVE_NOAPI(f->shared->vol_cls) +} /* end H5F_get_vol_cls */ + + +/*------------------------------------------------------------------------- + * Function: H5F_get_cont_info + * + * Purpose: Get the VOL container info for the file + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Quincey Koziol + * Saturday, August 17, 2019 + * + *------------------------------------------------------------------------- + */ +herr_t +H5F__get_cont_info(const H5F_t *f, H5VL_file_cont_info_t *info) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_PACKAGE + + /* Sanity checks */ + HDassert(f); + HDassert(f->shared); + + /* Verify structure version */ + if(info->version != H5VL_CONTAINER_INFO_VERSION) + HGOTO_ERROR(H5E_FILE, H5E_VERSION, FAIL, "wrong container info version #") + + /* Set the container info fields */ + info->feature_flags = 0; /* None currently defined */ + info->token_size = H5F_SIZEOF_ADDR(f); + info->blob_id_size = H5HG_HEAP_ID_SIZE(f); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_get_cont_info */ /*------------------------------------------------------------------------- |