diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2019-10-29 19:38:50 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2019-11-08 21:14:33 (GMT) |
commit | 1dbec40d465072540f8507c524ae7b909a6b1cf0 (patch) | |
tree | 111dd9bb4925da3be08a4a5ae63f7bffb16d6ee0 /src/H5VLnative_blob.c | |
parent | afd4b291315e39e3966eadaf8ae9894b30e9504e (diff) | |
download | hdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.zip hdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.tar.gz hdf5-1dbec40d465072540f8507c524ae7b909a6b1cf0.tar.bz2 |
Implement H5VLget_file_type() to return a copy of a datatype with the
location set to be in a file. Only meant to be used by VOL connectors.
Implement H5VLpeek_connector_id() to support connectors querying their
own IDs. Fix app_ref with connector IDs in a couple places (external
VOLs registered as default through ENV should be visible to the
application). Modify vlen and reference interfaces to work with
arbitrary VOL connectors. Implement file "post open" specific
callback, to enable connectors to update their file structs after a
wrap context has been set.
Diffstat (limited to 'src/H5VLnative_blob.c')
-rw-r--r-- | src/H5VLnative_blob.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/H5VLnative_blob.c b/src/H5VLnative_blob.c index b16b407..6c7f9b2 100644 --- a/src/H5VLnative_blob.c +++ b/src/H5VLnative_blob.c @@ -109,12 +109,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t *size, +H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t size, void H5_ATTR_UNUSED *ctx) { H5F_t *f = (H5F_t *)obj; /* Retrieve file pointer */ const uint8_t *id = (const uint8_t *)blob_id; /* Pointer to the disk blob ID */ H5HG_t hobjid; /* Global heap ID for sequence */ + size_t hobj_size; /* Global heap object size returned from H5HG_read() */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -131,9 +132,13 @@ H5VL__native_blob_get(void *obj, const void *blob_id, void *buf, size_t *size, /* Check if this sequence actually has any data */ if(hobjid.addr > 0) /* Read the VL information from disk */ - if(NULL == H5HG_read(f, &hobjid, buf, size)) + if(NULL == H5HG_read(f, &hobjid, buf, &hobj_size)) HGOTO_ERROR(H5E_VOL, H5E_READERROR, FAIL, "unable to read VL information") + /* Verify the size is correct */ + if(hobj_size != size) + HGOTO_ERROR(H5E_VOL, H5E_CANTDECODE, FAIL, "Expected global heap object size does not match") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5VL__native_blob_get() */ @@ -175,7 +180,7 @@ H5VL__native_blob_specific(void *obj, void *blob_id, H5F_addr_decode(f, &id, &(hobjid.addr)); UINT32DECODE(id, hobjid.idx); - /* Free heap object */ + /* Get heap object's size */ if(hobjid.addr > 0) { if(H5HG_get_obj_size(f, &hobjid, size) < 0) HGOTO_ERROR(H5E_VOL, H5E_CANTREMOVE, FAIL, "unable to remove heap object") |