Source
339
339
*/
340
340
341
341
/* Increase the size of the data space */
342
342
space = dataset->shared->space;
343
343
if((changed = H5S_extend(space, size)) < 0)
344
344
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to increase size of data space")
345
345
346
346
/* Updated the dataset's info if the dataspace was successfully extended */
347
347
if(changed) {
348
348
/* Update the index values for the cached chunks for this dataset */
349
-
if(H5D_CHUNKED == dataset->shared->layout.type)
349
+
if(H5D_CHUNKED == dataset->shared->layout.type) {
350
+
if(H5D_chunk_set_info(dataset) < 0)
351
+
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks")
350
352
if(H5D_chunk_update_cache(dataset, dxpl_id) < 0)
351
353
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices")
354
+
} /* end if */
352
355
353
356
/* Allocate space for the new parts of the dataset, if appropriate */
354
357
fill = &dataset->shared->dcpl_cache.fill;
355
358
if(fill->alloc_time == H5D_ALLOC_TIME_EARLY)
356
359
if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_EXTEND, FALSE) < 0)
357
360
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value")
358
361
359
362
/* Mark the dataspace as dirty, for later writing to the file */
360
363
dataset->shared->space_dirty = TRUE;
361
364
} /* end if */