diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-02 22:30:16 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-02 22:30:16 (GMT) |
commit | 19105560d05e18a2793ef330bac1234aed2e8914 (patch) | |
tree | 10d0e34de12191c45aa89cd0c7b68b0db2c5e3c4 /src/H5Dchunk.c | |
parent | b359f8d3b37b03748346fd87b9c20cbd95b8db8e (diff) | |
download | hdf5-19105560d05e18a2793ef330bac1234aed2e8914.zip hdf5-19105560d05e18a2793ef330bac1234aed2e8914.tar.gz hdf5-19105560d05e18a2793ef330bac1234aed2e8914.tar.bz2 |
[svn-r16536] Description:
Bring v16532 back from trunk to v1.8 branch:
Pass the chunk "user data" to H5D_chunk_unlock(), so that chunks with
an address already aren't reallocated.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
(h5committest not needed here, performed on trunk)
Diffstat (limited to 'src/H5Dchunk.c')
-rw-r--r-- | src/H5Dchunk.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index bbe57a0..2f35609 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -1580,7 +1580,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, idx_hint, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ @@ -1734,7 +1734,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0) + if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, idx_hint, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") /* Advance to next chunk in list */ @@ -2736,8 +2736,8 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint, - void *chunk, uint32_t naccessed) +H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, + hbool_t dirty, unsigned idx_hint, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */ const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); @@ -2747,6 +2747,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint, FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_unlock) HDassert(io_info); + HDassert(udata); if(UINT_MAX == idx_hint) { /* @@ -2762,7 +2763,7 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, hbool_t dirty, unsigned idx_hint, x.dirty = TRUE; HDmemcpy(x.offset, io_info->store->chunk.offset, layout->u.chunk.ndims * sizeof(x.offset[0])); HDassert(layout->u.chunk.size > 0); - x.chunk_addr = HADDR_UNDEF; + x.chunk_addr = udata->addr; x.chunk_size = layout->u.chunk.size; H5_ASSIGN_OVERFLOW(x.alloc_size, x.chunk_size, uint32_t, size_t); x.chunk = (uint8_t *)chunk; @@ -3324,7 +3325,7 @@ H5D_chunk_prune_fill(const H5D_chunk_rec_t *chunk_rec, H5D_chunk_it_ud1_t *udata bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ - if(H5D_chunk_unlock(io_info, TRUE, idx_hint, chunk, bytes_accessed) < 0) + if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, idx_hint, chunk, bytes_accessed) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk") done: |