diff options
author | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-01-27 20:38:38 (GMT) |
---|---|---|
committer | Bill Wendling <wendling@ncsa.uiuc.edu> | 2003-01-27 20:38:38 (GMT) |
commit | 749c50fcd861429c408cb21b6e595addafa959f2 (patch) | |
tree | b61c79b80b21c8f33b4bc740901c217d149fe564 /src/H5FPclient.c | |
parent | a6542d06b12340af99731eacb1d9687cdc8738ed (diff) | |
download | hdf5-749c50fcd861429c408cb21b6e595addafa959f2.zip hdf5-749c50fcd861429c408cb21b6e595addafa959f2.tar.gz hdf5-749c50fcd861429c408cb21b6e595addafa959f2.tar.bz2 |
[svn-r6336] Purpose:
Update
Description:
This is the first conversion of the FPHDF5 code to be a metadata
cache. There's an extra error message. I rewrote the sync/change code
to be read metadata/write metadata instead.
I still need to hook these changes into the HDF5 code so that it
looks at the SAP first before checking the file for metadata.
Platforms tested:
Linux
Diffstat (limited to 'src/H5FPclient.c')
-rw-r--r-- | src/H5FPclient.c | 413 |
1 files changed, 97 insertions, 316 deletions
diff --git a/src/H5FPclient.c b/src/H5FPclient.c index e3b7d09..d1a029c 100644 --- a/src/H5FPclient.c +++ b/src/H5FPclient.c @@ -16,6 +16,7 @@ #define H5G_PACKAGE /*suppress error about including H5Gpkg */ #include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata Cache */ #include "H5Dprivate.h" /* Dataset Functions */ #include "H5Eprivate.h" /* Error Handling */ #include "H5Gpkg.h" /* Group functions */ @@ -38,44 +39,10 @@ static int interface_initialize_g = 0; /* local functions */ static unsigned H5FP_gen_request_id(void); -static herr_t H5FP_update_file_cache(hid_t file_id, struct SAP_sync *sap_sync, uint8_t *msg); /** Public Library (non-API) Functions **/ /* - * Function: H5FP_fill_fphdf5_struct - * Purpose: Nice function to fill in the H5O_fphdf5_t structure - * before transmission to the SAP. - * Return: Nothing: Doesn't fail after asserts pass. - * Programmer: Bill Wendling, 13. November, 2002 - * Modifications: - */ -void -H5FP_fill_fphdf5_struct(H5O_fphdf5_t *fphdf5, uint8_t *oid, haddr_t header, - struct H5S_simple_t *sdim, H5T_t *dtype, time_t *mtime, - H5O_layout_t *layout, H5O_name_t *group, H5O_name_t *dataset, - struct H5P_genplist_t *plist) -{ - /* check args */ - assert(fphdf5); - assert(oid); - assert(sdim); - assert(dtype); - assert(layout); - assert(plist); - - HDmemcpy(fphdf5->oid, oid, sizeof(fphdf5->oid)); - fphdf5->header = header; - fphdf5->layout = layout; - fphdf5->sdim = sdim; - fphdf5->mtime = mtime; - fphdf5->group = group; - fphdf5->dset = dataset; - fphdf5->dtype = dtype; - fphdf5->plist = plist; -} - -/* * Function: H5FP_request_open * Purpose: Request an open of a file from the SAP. You pass in the * metadata string (MDATA) (the filename), it's length in @@ -88,20 +55,16 @@ H5FP_fill_fphdf5_struct(H5O_fphdf5_t *fphdf5, uint8_t *oid, haddr_t header, * opening the file, though, should call this function so * that they can get the file ID that the SAP assigns to it. * - * N.B. This could be expanded to handle the opening of more - * than just a file, if that becomes necessary. Right now, - * we are only keeping track of file opens. - * * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 28. August, 2002 * Modifications: */ herr_t -H5FP_request_open(const char *mdata, int md_len, enum sap_obj_type obj_type, +H5FP_request_open(const char *mdata, int md_size, H5FP_obj_t obj_type, unsigned *file_id, unsigned *req_id) { - struct SAP_request req; + H5FP_request req; MPI_Status mpi_status; int ret_value = SUCCEED, mrc; @@ -119,14 +82,14 @@ H5FP_request_open(const char *mdata, int md_len, enum sap_obj_type obj_type, req.req_type = H5FP_REQ_OPEN; req.req_id = H5FP_gen_request_id(); req.proc_rank = H5FP_my_rank; - req.md_len = md_len; + req.md_size = md_size; req.obj_type = obj_type; - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); - if (H5FP_send_metadata(mdata, md_len, (int)H5FP_sap_rank)) + if (H5FP_send_metadata(mdata, md_size, (int)H5FP_sap_rank)) HGOTO_ERROR(H5E_FPHDF5, H5E_CANTSENDMDATA, FAIL, "can't send metadata to server"); } @@ -155,11 +118,11 @@ done: * Modifications: */ herr_t -H5FP_request_lock(unsigned int sap_file_id, unsigned char *obj_oid, - enum sap_lock_type rw_lock, int last, unsigned *req_id, - enum sap_status *status) +H5FP_request_lock(unsigned file_id, unsigned char *obj_oid, + H5FP_lock_t rw_lock, int last, unsigned *req_id, + H5FP_status_t *status) { - struct SAP_request req; + H5FP_request req; int ret_value = SUCCEED, mrc; FUNC_ENTER_NOAPI(H5FP_request_lock, FAIL); @@ -172,13 +135,13 @@ H5FP_request_lock(unsigned int sap_file_id, unsigned char *obj_oid, *status = H5FP_STATUS_OK; req.req_type = last ? H5FP_REQ_LOCK_END : H5FP_REQ_LOCK; req.req_id = H5FP_gen_request_id(); - req.sap_file_id = sap_file_id; + req.file_id = file_id; req.rw_lock = rw_lock; - req.md_len = 0; + req.md_size = 0; req.proc_rank = H5FP_my_rank; H5FP_COPY_OID(req.oid, obj_oid); - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); @@ -187,12 +150,12 @@ H5FP_request_lock(unsigned int sap_file_id, unsigned char *obj_oid, * On the last lock in the lock-group to be acquired, we expect a * reply from the SAP */ - struct SAP_reply sap_reply; + H5FP_reply sap_reply; MPI_Status mpi_status; HDmemset(&mpi_status, 0, sizeof(mpi_status)); - if ((mrc = MPI_Recv(&sap_reply, 1, SAP_reply_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply_t, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); @@ -220,33 +183,30 @@ done: * Modifications: */ herr_t -H5FP_request_release_lock(unsigned int sap_file_id, unsigned char *obj_oid, - int last, unsigned *req_id, enum sap_status *status) +H5FP_request_release_lock(unsigned file_id, unsigned char *obj_oid, + int last, unsigned *req_id, H5FP_status_t *status) { - struct SAP_request req; + H5FP_request req; herr_t ret_value = SUCCEED; int mrc; FUNC_ENTER_NOAPI(H5FP_request_release_lock, FAIL); + assert(obj_oid); assert(req_id); assert(status); HDmemset(&req, 0, sizeof(req)); *status = H5FP_STATUS_OK; + H5FP_COPY_OID(req.oid, obj_oid); req.req_type = last ? H5FP_REQ_RELEASE_END : H5FP_REQ_RELEASE; req.req_id = H5FP_gen_request_id(); - req.sap_file_id = sap_file_id; - req.md_len = 0; + req.file_id = file_id; + req.md_size = 0; req.proc_rank = H5FP_my_rank; - if (obj_oid) - H5FP_COPY_OID(req.oid, obj_oid); - else - HDmemset(req.oid, '\0', sizeof(req.oid)); - - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); @@ -255,12 +215,12 @@ H5FP_request_release_lock(unsigned int sap_file_id, unsigned char *obj_oid, * On the last lock released in this lock-group, we expect a * reply from the SAP */ - struct SAP_reply sap_reply; + H5FP_reply sap_reply; MPI_Status mpi_status; HDmemset(&mpi_status, 0, sizeof(mpi_status)); - if ((mrc = MPI_Recv(&sap_reply, 1, SAP_reply_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply_t, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); @@ -276,151 +236,93 @@ done: } /* - * Function: H5FP_request_change - * Purpose: Tell the SAP that we want to change the structure of the file. - * Include the information the SAP will need to send to the - * other processes so that they can be synced with what you - * are doing. The request ID is returned in a pointer - * supplied by the user. + * Function: H5FP_request_write_metadata + * Purpose: Tell the SAP that we want to change a piece of metadata + * associated with the file. The request ID is returned in a + * pointer supplied by the user. * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 02. August, 2002 * Modifications: */ herr_t -H5FP_request_change(unsigned int sap_file_id, unsigned char *obj_oid, - enum sap_obj_type obj_type, enum sap_action action, - int mdata_len, const char *mdata, unsigned *req_id, - enum sap_status *status) +H5FP_request_write_metadata(unsigned file_id, unsigned char *obj_oid, + H5FP_obj_t obj_type, H5AC_subid_t type_id, + haddr_t addr, int mdata_size, const char *mdata, + unsigned *req_id, H5FP_status_t *status) { - struct SAP_reply sap_reply; + H5FP_reply sap_reply; MPI_Status mpi_status; - struct SAP_request req; + H5FP_request req; herr_t ret_value = SUCCEED; int mrc; FUNC_ENTER_NOAPI(H5FP_request_change, FAIL); assert(mdata); + assert(obj_oid); + assert(req_id); + assert(status); + HDmemset(&req, 0, sizeof(req)); - req.req_type = H5FP_REQ_CHANGE; + H5FP_COPY_OID(req.oid, obj_oid); + req.req_type = H5FP_REQ_WRITE; req.req_id = H5FP_gen_request_id(); - req.sap_file_id = sap_file_id; - req.obj_type = obj_type; - req.action = action; - req.md_len = mdata_len; req.proc_rank = H5FP_my_rank; + req.file_id = file_id; + req.obj_type = obj_type; + req.type_id = type_id; + req.addr = addr; + req.md_size = mdata_size; - if (obj_oid) - H5FP_COPY_OID(req.oid, obj_oid); - else - HDmemset(req.oid, '\0', sizeof(req.oid)); - - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); /* The first MPI_Send will have been sent before this one will be read. */ - if (H5FP_send_metadata(mdata, mdata_len, (int)H5FP_sap_rank) != SUCCEED) + if (H5FP_send_metadata(mdata, mdata_size, (int)H5FP_sap_rank) != SUCCEED) HGOTO_ERROR(H5E_FPHDF5, H5E_CANTSENDMDATA, FAIL, "can't send metadata to server"); HDmemset(&mpi_status, 0, sizeof(mpi_status)); - if ((mrc = MPI_Recv(&sap_reply, 1, SAP_reply_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply_t, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); *status = sap_reply.status; if (sap_reply.status != H5FP_STATUS_OK) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTUNLOCK, FAIL, "can't register change with server"); + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't write metadata to server"); done: *req_id = req.req_id; FUNC_LEAVE_NOAPI(ret_value); } -#if 0 -herr_t -H5FP_generate_message(fid_t fid, const char *dataset, const char *group, - H5D_t *dset, H5S_t *space, H5O_fphdf5_t *fphdf5 /* out */) -{ - hobj_ref_t gr_ref, ds_ref; - H5O_efl_t efl; - H5F_t *file = NULL; - H5S_t *space = NULL; - H5G_entry_t *ent = NULL; - int i; - herr_t ret_value = SUCCEED; - - FUNC_ENTER_NOAPI(H5FP_generate_message, FAIL); - - if ((file = H5I_object(file_id)) == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); - - if ((grp = H5G_open(file, group)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - - if ((ent = H5G_entof(grp)) == NULL) - /* this will never be executed */ - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to get entry info of group"); - - memcpy(fphdf5->oid, (void *)&ent->header, sizeof(ent->header)); - - if ((loc = H5G_loc(did)) == NULL) { - exit(1); - } - - memcpy(ds_ref.oid, (void *)&loc->header, sizeof(loc->header)); - - memcpy(fphdf5.oid, ds_ref.oid, sizeof(ds_ref.oid)); - fphdf5->header = dset->ent.header; - fphdf5->layout = &dset->layout; - fphdf5->sdim = &(space->extent.u.simple); -#if 0 - fphdf5->mtime = ; -#endif - fphdf5->group = group; - fphdf5->dset = dataset; - fphdf5->dtype = dset->type; - - if ((fphdf5->plist = H5P_object_verify(dset->dcpl_id, - H5P_DATASET_CREATE)) == NULL) { - exit(1); - } - - if (H5P_get(fphdf5->plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - - fphdf5->efl = &efl; - -done: - FUNC_LEAVE_NOAPI(ret_value); -} -#endif - /* - * Function: H5FP_request_sync - * Purpose: Tell the SAP that we want all of the structural changes - * made on the file that we don't know about. The request ID - * is returned in a pointer supplied by the user. The status - * of the SAP is returned to the user in the supplied STATUS - * pointer. + * Function: H5FP_request_read_metadata + * Purpose: Read a piece of metadata from the SAP. That is, if the + * SAP has access to that metadata. If not, then we'll need + * to read it from disk. * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 02. August, 2002 * Modifications: */ herr_t -H5FP_request_sync(unsigned int sap_file_id, hid_t hdf_file_id, - unsigned *req_id, enum sap_status *status) +H5FP_request_read_metadata(unsigned file_id, H5FP_obj_t obj_type, + H5AC_subid_t type_id, haddr_t addr, size_t size, + uint8_t **buf, unsigned *req_id, + H5FP_status_t *status) { - struct SAP_request req; + H5FP_request req; + H5FP_read sap_read; /* metadata info read from the SAP's cache */ herr_t ret_value = SUCCEED; + MPI_Status mpi_status; int mrc; - FUNC_ENTER_NOAPI(H5FP_request_sync, FAIL); + FUNC_ENTER_NOAPI(H5FP_request_read_metadata, FAIL); assert(req_id); assert(status); @@ -428,64 +330,45 @@ H5FP_request_sync(unsigned int sap_file_id, hid_t hdf_file_id, HDmemset(&req, 0, sizeof(req)); *status = H5FP_STATUS_OK; - req.req_type = H5FP_REQ_SYNC; + req.req_type = H5FP_REQ_READ; req.req_id = H5FP_gen_request_id(); - req.sap_file_id = sap_file_id; + req.file_id = file_id; req.proc_rank = H5FP_my_rank; + req.obj_type = obj_type; + req.type_id = type_id; + req.addr = addr; - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); - for (;;) { - MPI_Status mpi_status; - struct SAP_sync sap_sync; + HDmemset(&mpi_status, 0, sizeof(mpi_status)); + if ((mrc = MPI_Recv(&sap_read, 1, H5FP_read_t, (int)H5FP_sap_rank, H5FP_TAG_READ, + H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) + HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); + + if (sap_read.status == H5FP_STATUS_OK) { + /* use the info in the H5FP_read_t structure to update the metadata */ + memset(*buf, '\0', size); HDmemset(&mpi_status, 0, sizeof(mpi_status)); - if ((mrc = MPI_Recv(&sap_sync, 1, SAP_sync_t, (int)H5FP_sap_rank, H5FP_TAG_SYNC, - H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) + if ((mrc = MPI_Recv(*buf, sap_read.md_size, MPI_BYTE, (int)H5FP_sap_rank, + H5FP_TAG_METADATA, H5FP_SAP_COMM, + &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); - - if (sap_sync.status != H5FP_STATUS_OK) { - *status = sap_sync.status; - HGOTO_DONE(FAIL); - } - + } else { /* - * use the info in the SAP_sync_t structure to update the - * metadata + * FIXME!!! + * + * The metadata wasn't in the SAP's cache. Should read from disk + * now. */ - if (sap_sync.md_len) { - uint8_t *buf; - - if ((buf = (uint8_t *)HDcalloc((size_t)sap_sync.md_len + 1, 1)) == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "out of memory"); - - HDmemset(&mpi_status, 0, sizeof(mpi_status)); - - if ((mrc = MPI_Recv(buf, sap_sync.md_len, MPI_BYTE, (int)H5FP_sap_rank, - H5FP_TAG_METADATA, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) { - HDfree(buf); - HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); - } - - /* - * FIXME: perform whatever metadata updates we can with the - * metadata returned from the SAP - */ - if (H5FP_update_file_cache(hdf_file_id, &sap_sync, buf) != SUCCEED) - HGOTO_DONE(FAIL); - - HDfree(buf); - } - - if (sap_sync.last_msg) - break; } done: *req_id = req.req_id; + *status = sap_read.status; FUNC_LEAVE_NOAPI(ret_value); } @@ -501,20 +384,23 @@ done: * Modifications: */ herr_t -H5FP_request_close(unsigned sap_file_id, unsigned *req_id) +H5FP_request_close(unsigned file_id, unsigned *req_id) { - struct SAP_request req; + H5FP_request req; int ret_value = SUCCEED, mrc; FUNC_ENTER_NOAPI(H5FP_request_close, FAIL); + assert(req_id); + HDmemset(&req, 0, sizeof(req)); + req.req_type = H5FP_REQ_CLOSE; req.req_id = H5FP_gen_request_id(); - req.sap_file_id = sap_file_id; + req.file_id = file_id; req.proc_rank = H5FP_my_rank; - if ((mrc = MPI_Send(&req, 1, SAP_request_t, (int)H5FP_sap_rank, + if ((mrc = MPI_Send(&req, 1, H5FP_request_t, (int)H5FP_sap_rank, H5FP_TAG_REQUEST, H5FP_SAP_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Send failed", mrc); @@ -524,7 +410,11 @@ done: FUNC_LEAVE_NOAPI(ret_value); } -/** Private Functions **/ +/* + *===----------------------------------------------------------------------=== + * Functions Private to Client Module + *===----------------------------------------------------------------------=== + */ /* * Function: H5FP_gen_request_id @@ -543,113 +433,4 @@ H5FP_gen_request_id() FUNC_LEAVE_NOAPI(i++); } -/* - * Function: H5FP_update_file_cache - * Purpose: Take the information returned by a "sync" call and update - * the file cache. The MSG parameter should be an encoded - * version of the H5O_fphdf5_t object. - * Return: Success: SUCCEED - * Failure: FAIL - * Programmer: Bill Wendling, 16. December, 2002 - * Modifications: - */ -static herr_t -H5FP_update_file_cache(hid_t file_id, struct SAP_sync *sap_sync, uint8_t *msg) -{ - herr_t ret_value = SUCCEED; - H5G_entry_t *ent = NULL, *file_ent = NULL; - H5O_fphdf5_t *fmeta = NULL; - H5S_t *space = NULL; - H5F_t *file = NULL; - H5G_t *grp = NULL; - H5D_t *dset = NULL; - - FUNC_ENTER_NOINIT(H5FP_update_file_cache); - - /* check args */ - assert(sap_sync); - assert(msg); - - if ((file = H5I_object(file_id)) == NULL) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier"); - - if ((fmeta = H5O_FPHDF5[0].decode(file, msg, NULL)) == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "out of memory"); - - if ((file_ent = H5G_loc(file_id)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - - if ((grp = H5G_open(file_ent, fmeta->group->s)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group"); - - switch (sap_sync->action) { -#ifdef OLD_WAY - case H5FP_ACT_CREATE: - if (sap_sync->obj_type == H5FP_OBJ_DATASET) { - H5O_efl_t efl; - - if ((ent = H5MM_malloc(sizeof(H5G_entry_t))) == NULL) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "out of memory"); - - if ((space = H5S_create(H5S_SIMPLE)) == NULL) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, - "can't create simple dataspace"); - - if (H5S_set_extent_simple(space, fmeta->sdim->rank, - fmeta->sdim->size, fmeta->sdim->max) < 0) - HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "can't set dimensions"); - - if (H5D_update_entry_info(file, ent, H5G_entof(grp), - fmeta->dset->s, space, - fmeta->plist, fmeta->layout, fmeta->dtype, - FALSE, fmeta->header) == FAIL) - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTINIT, FAIL, "can't update metadata cache"); - - if (H5P_get(fmeta->plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - - if (H5D_update_external_storage_info(file, ent, &efl, fmeta->layout) == FAIL) - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTINIT, FAIL, - "can't update external file layout metadata cache"); - } - - break; - - case H5FP_ACT_EXTEND: - if (sap_sync->obj_type == H5FP_OBJ_DATASET) { - if ((dset = H5D_open(H5G_entof(grp), fmeta->dset->s)) == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open dataset"); - - if (H5D_extend(dset, fmeta->sdim->size) != SUCCEED) - HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset"); - } - - break; -#endif /* OLD_WAY */ - - case H5FP_ACT_DELETE: - default: - break; - } - -done: - /* cleanup */ - if (fmeta) - H5O_FPHDF5[0].free(fmeta); - - if (dset) - H5D_close(dset); - - if (grp) - H5G_close(grp); - - if (space) - H5S_close(space); - - if (ret_value == FAIL) - H5MM_xfree(ent); - - FUNC_LEAVE_NOAPI(ret_value); -} - #endif /* H5_HAVE_FPHDF5 */ |