Source
389
389
* Purpose: Copy compact storage raw data from SRC file to DST file.
390
390
*
391
391
* Return: Non-negative on success, negative on failure.
392
392
*
393
393
* Programmer: Peter Cao
394
394
* December 11, 2005
395
395
*
396
396
*-------------------------------------------------------------------------
397
397
*/
398
398
herr_t
399
-
H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst,
399
+
H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *_storage_src, H5F_t *f_dst,
400
400
H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info,
401
401
hid_t dxpl_id)
402
402
{
403
403
hid_t tid_src = -1; /* Datatype ID for source datatype */
404
404
hid_t tid_dst = -1; /* Datatype ID for destination datatype */
405
405
hid_t tid_mem = -1; /* Datatype ID for memory datatype */
406
406
void *buf = NULL; /* Buffer for copying data */
407
407
void *bkg = NULL; /* Temporary buffer for copying data */
408
408
void *reclaim_buf = NULL; /* Buffer for reclaiming data */
409
409
hid_t buf_sid = -1; /* ID for buffer dataspace */
410
+
H5D_shared_t *shared_fo = cpy_info->shared_fo; /* Pointer to the shared struct for dataset object */
411
+
H5O_storage_compact_t *storage_src = _storage_src; /* Pointer to storage_src */
410
412
herr_t ret_value = SUCCEED; /* Return value */
411
413
412
414
FUNC_ENTER_PACKAGE
413
415
414
416
/* Check args */
415
417
HDassert(f_src);
416
418
HDassert(storage_src);
417
419
HDassert(f_dst);
418
420
HDassert(storage_dst);
419
421
HDassert(dt_src);
420
422
423
+
/* If the dataset is open in the file, point to "layout" in the shared struct */
424
+
if(shared_fo != NULL)
425
+
storage_src = &(shared_fo->layout.storage.u.compact);
426
+
421
427
/* Allocate space for destination data */
422
428
if(NULL == (storage_dst->buf = H5MM_malloc(storage_src->size)))
423
429
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate memory for compact dataset")
424
430
425
431
/* Create datatype ID for src datatype, so it gets freed */
426
432
if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0)
427
433
HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype")
428
434
429
435
/* If there's a VLEN source datatype, do type conversion information */
430
436
if(H5T_detect_class(dt_src, H5T_VLEN, FALSE) > 0) {