diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-01-14 14:19:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 14:19:48 (GMT) |
commit | 0d8529055da9ab23162e698309cc6da1dd93f99e (patch) | |
tree | d89353233b2c5c396578fdb47268072a83fcfa09 /src/H5FD.c | |
parent | b1eb47ac4dce3f5bd548fb3bee0f630679b1eee8 (diff) | |
download | hdf5-0d8529055da9ab23162e698309cc6da1dd93f99e.zip hdf5-0d8529055da9ab23162e698309cc6da1dd93f99e.tar.gz hdf5-0d8529055da9ab23162e698309cc6da1dd93f99e.tar.bz2 |
Removes lock/unlock callbacks from ros3 and hdfs VFDs (#258)
* Removes no-op callback stubs from read-only VFDs
Also changes VFD registration to allow read-only VFDs with no
write callback to be registered.
* Adds a RELEASE.txt note for HDFFV-11205
For the read-only VFD registration change
* Revert "Removes no-op callback stubs from read-only VFDs"
This reverts commit a7a95497305d64d2de783fdb0e3186a532446a4a.
* Removes lock callbacks from ros3 and hdfs VFDs
Diffstat (limited to 'src/H5FD.c')
-rw-r--r-- | src/H5FD.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -231,9 +231,9 @@ H5FDregister(const H5FD_class_t *cls) "'get_eoa' and/or 'set_eoa' methods are not defined") if (!cls->get_eof) HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, "'get_eof' method is not defined") - if (!cls->read) + if (!cls->read || !cls->write) HGOTO_ERROR(H5E_ARGS, H5E_UNINITIALIZED, H5I_INVALID_HID, - "'read' method is not defined") + "'read' and/or 'write' method is not defined") for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) if (cls->fl_map[type] < H5FD_MEM_NOLIST || cls->fl_map[type] >= H5FD_MEM_NTYPES) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid free-list mapping") @@ -277,7 +277,7 @@ H5FD_register(const void *_cls, size_t size, hbool_t app_ref) HDassert(cls->open && cls->close); HDassert(cls->get_eoa && cls->set_eoa); HDassert(cls->get_eof); - HDassert(cls->read); + HDassert(cls->read && cls->write); for (type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; type++) { HDassert(cls->fl_map[type] >= H5FD_MEM_NOLIST && cls->fl_map[type] < H5FD_MEM_NTYPES); } @@ -1417,10 +1417,6 @@ H5FDwrite(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t siz if (!buf) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "result buffer parameter can't be NULL") - /* Make sure this isn't being called on a read-only VFD */ - if (!file->cls->write) - HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "write request made to read-only VFD") - /* Get the default dataset transfer property list if the user didn't provide one */ if (H5P_DEFAULT == dxpl_id) dxpl_id = H5P_DATASET_XFER_DEFAULT; |