diff options
author | Quincey Koziol <koziol@koziol.gov> | 2019-12-21 04:41:00 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@koziol.gov> | 2020-01-04 16:02:39 (GMT) |
commit | fa599f450832c6284969c47b8e2cad1f5c6752c7 (patch) | |
tree | d5fca85471b901bbd52ca1bba5f3a7891bc36869 /src/H5VLnative_dataset.c | |
parent | 7d87aea63fb7387b88b7fd8057feb9e42e53bd8c (diff) | |
download | hdf5-fa599f450832c6284969c47b8e2cad1f5c6752c7.zip hdf5-fa599f450832c6284969c47b8e2cad1f5c6752c7.tar.gz hdf5-fa599f450832c6284969c47b8e2cad1f5c6752c7.tar.bz2 |
Refactor H5Dvlen_get_buf_size to use optional dataset operation, with generic fallback for VOL connectors that don't implement operation
Diffstat (limited to 'src/H5VLnative_dataset.c')
-rw-r--r-- | src/H5VLnative_dataset.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c index f9065c1..bea2c50 100644 --- a/src/H5VLnative_dataset.c +++ b/src/H5VLnative_dataset.c @@ -309,18 +309,6 @@ H5VL__native_dataset_get(void *obj, H5VL_dataset_get_t get_type, break; } - /* H5Dvlen_get_buf_size */ - case H5VL_DATASET_GET_VLEN_BUF_SIZE: - { - hid_t type_id = HDva_arg(arguments, hid_t); - hid_t space_id = HDva_arg(arguments, hid_t); - hsize_t *size = HDva_arg(arguments, hsize_t *); - - if(H5D__vlen_get_buf_size(dset, type_id, space_id, size) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of vlen buf needed") - break; - } - default: HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't get this type of information from dataset") } /* end switch */ @@ -618,6 +606,20 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type, break; } + case H5VL_NATIVE_DATASET_GET_VLEN_BUF_SIZE: + { /* H5Dvlen_get_buf_size */ + hid_t type_id = HDva_arg(arguments, hid_t); + hid_t space_id = HDva_arg(arguments, hid_t); + hsize_t *size = HDva_arg(arguments, hsize_t *); + + dset = (H5D_t *)obj; + + if(H5D__vlen_get_buf_size(dset, type_id, space_id, size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get size of vlen buf needed") + break; + } + + default: HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, FAIL, "invalid optional operation") } /* end switch */ |