summaryrefslogtreecommitdiffstats
path: root/src/H5Faccum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Faccum.c')
-rw-r--r--src/H5Faccum.c175
1 files changed, 78 insertions, 97 deletions
diff --git a/src/H5Faccum.c b/src/H5Faccum.c
index e84cfda..74a170b 100644
--- a/src/H5Faccum.c
+++ b/src/H5Faccum.c
@@ -38,6 +38,7 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Fpkg.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
+#include "H5MMprivate.h" /* Memory management */
#include "H5VMprivate.h" /* Vectors and arrays */
@@ -110,31 +111,27 @@ H5FL_BLK_DEFINE_STATIC(meta_accum);
*-------------------------------------------------------------------------
*/
herr_t
-H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr,
+H5F__accum_read(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t size, void *buf/*out*/)
{
- H5FD_io_info_t fdio_info; /* File driver I/O info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_t *file; /* File driver pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- HDassert(fio_info);
- HDassert(fio_info->f);
- HDassert(fio_info->meta_dxpl);
- HDassert(fio_info->raw_dxpl);
+ /* Sanity checks */
+ HDassert(f_sh);
HDassert(buf);
/* Translate to file driver I/O info object */
- fdio_info.file = fio_info->f->shared->lf;
- fdio_info.meta_dxpl = fio_info->meta_dxpl;
- fdio_info.raw_dxpl = fio_info->raw_dxpl;
+ file = f_sh->lf;
/* Check if this information is in the metadata accumulator */
- if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
+ if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
/* Set up alias for file's metadata accumulator info */
- accum = &fio_info->f->shared->accum;
+ accum = &f_sh->accum;
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
@@ -183,7 +180,7 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add
accum->dirty_off += amount_before;
/* Dispatch to driver */
- if(H5FD_read(&fdio_info, map_type, addr, amount_before, accum->buf) < 0)
+ if(H5FD_read(file, map_type, addr, amount_before, accum->buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end if */
else
@@ -197,12 +194,12 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add
H5_CHECKED_ASSIGN(amount_after, size_t, ((addr + size) - (accum->loc + accum->size)), hsize_t);
/* Dispatch to driver */
- if(H5FD_read(&fdio_info, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0)
+ if(H5FD_read(file, map_type, (accum->loc + accum->size), amount_after, (accum->buf + accum->size + amount_before)) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end if */
/* Copy the data out of the buffer */
- HDmemcpy(buf, accum->buf + (addr - new_addr), size);
+ H5MM_memcpy(buf, accum->buf + (addr - new_addr), size);
/* Adjust the accumulator address & size */
accum->loc = new_addr;
@@ -211,13 +208,13 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add
/* Current read doesn't overlap with metadata accumulator, read it from file */
else {
/* Dispatch to driver */
- if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0)
+ if(H5FD_read(file, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end else */
} /* end if */
else {
/* Read the data */
- if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0)
+ if(H5FD_read(file, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
/* Check for overlap w/dirty accumulator */
@@ -254,13 +251,13 @@ H5F__accum_read(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t add
} /* end else */
/* Copy the dirty region to buffer */
- HDmemcpy((unsigned char *)buf + buf_off, (unsigned char *)accum->buf + accum->dirty_off + dirty_off, overlap_size);
+ H5MM_memcpy((unsigned char *)buf + buf_off, (unsigned char *)accum->buf + accum->dirty_off + dirty_off, overlap_size);
} /* end if */
} /* end else */
} /* end if */
else {
/* Read the data */
- if(H5FD_read(&fdio_info, map_type, addr, size, buf) < 0)
+ if(H5FD_read(file, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed")
} /* end else */
@@ -283,7 +280,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info,
+H5F__accum_adjust(H5F_meta_accum_t *accum, H5FD_t *file,
H5F_accum_adjust_t adjust, size_t size)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -291,7 +288,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info,
FUNC_ENTER_STATIC
HDassert(accum);
- HDassert(fdio_info);
+ HDassert(file);
HDassert(H5F_ACCUM_APPEND == adjust || H5F_ACCUM_PREPEND == adjust);
HDassert(size > 0);
HDassert(size <= H5F_ACCUM_MAX_SIZE);
@@ -349,7 +346,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info,
/* Check if the dirty region overlaps the region to eliminate from the accumulator */
if((accum->size - shrink_size) < (accum->dirty_off + accum->dirty_len)) {
/* Write out the dirty region from the metadata accumulator, with dispatch to driver */
- if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed")
/* Reset accumulator dirty flag */
@@ -360,7 +357,7 @@ H5F__accum_adjust(H5F_meta_accum_t *accum, const H5FD_io_info_t *fdio_info,
/* Check if the dirty region overlaps the region to eliminate from the accumulator */
if(shrink_size > accum->dirty_off) {
/* Write out the dirty region from the metadata accumulator, with dispatch to driver */
- if(H5FD_write(fdio_info, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, (accum->loc + accum->dirty_off), accum->dirty_len, (accum->buf + accum->dirty_off)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_WRITEERROR, FAIL, "file write failed")
/* Reset accumulator dirty flag */
@@ -422,32 +419,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t addr,
+H5F__accum_write(H5F_shared_t *f_sh, H5FD_mem_t map_type, haddr_t addr,
size_t size, const void *buf)
{
- H5FD_io_info_t fdio_info; /* File driver I/O info */
- herr_t ret_value = SUCCEED; /* Return value */
+ H5FD_t *file; /* File driver pointer */
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- HDassert(fio_info);
- HDassert(fio_info->f);
- HDassert(H5F_INTENT(fio_info->f) & H5F_ACC_RDWR);
- HDassert(fio_info->meta_dxpl);
- HDassert(fio_info->raw_dxpl);
+ /* Sanity checks */
+ HDassert(f_sh);
+ HDassert(H5F_SHARED_INTENT(f_sh) & H5F_ACC_RDWR);
HDassert(buf);
- /* Translate to file driver I/O info object */
- fdio_info.file = fio_info->f->shared->lf;
- fdio_info.meta_dxpl = fio_info->meta_dxpl;
- fdio_info.raw_dxpl = fio_info->raw_dxpl;
+ /* Translate to file driver pointer */
+ file = f_sh->lf;
/* Check for accumulating metadata */
- if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
+ if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) {
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
/* Set up alias for file's metadata accumulator info */
- accum = &fio_info->f->shared->accum;
+ accum = &f_sh->accum;
if(size < H5F_ACCUM_MAX_SIZE) {
/* Sanity check */
@@ -458,14 +451,14 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
/* Check if the new metadata adjoins the beginning of the current accumulator */
if((addr + size) == accum->loc) {
/* Check if we need to adjust accumulator size */
- if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, size) < 0)
+ if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
/* Move the existing metadata to the proper location */
HDmemmove(accum->buf + size, accum->buf, accum->size);
/* Copy the new metadata at the front */
- HDmemcpy(accum->buf, buf, size);
+ H5MM_memcpy(accum->buf, buf, size);
/* Set the new size & location of the metadata accumulator */
accum->loc = addr;
@@ -483,11 +476,11 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
/* Check if the new metadata adjoins the end of the current accumulator */
else if(addr == (accum->loc + accum->size)) {
/* Check if we need to adjust accumulator size */
- if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, size) < 0)
+ if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
/* Copy the new metadata to the end */
- HDmemcpy(accum->buf + accum->size, buf, size);
+ H5MM_memcpy(accum->buf + accum->size, buf, size);
/* Adjust the dirty region and mark accumulator dirty */
if(accum->dirty)
@@ -510,7 +503,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
size_t dirty_off = (size_t)(addr - accum->loc);
/* Copy the new metadata to the proper location within the accumulator */
- HDmemcpy(accum->buf + dirty_off, buf, size);
+ H5MM_memcpy(accum->buf + dirty_off, buf, size);
/* Adjust the dirty region and mark accumulator dirty */
if(accum->dirty) {
@@ -543,7 +536,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
H5_CHECKED_ASSIGN(add_size, size_t, (accum->loc - addr), hsize_t);
/* Check if we need to adjust accumulator size */
- if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_PREPEND, add_size) < 0)
+ if(H5F__accum_adjust(accum, file, H5F_ACCUM_PREPEND, add_size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
/* Calculate the proper offset of the existing metadata */
@@ -553,7 +546,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
HDmemmove(accum->buf + size, accum->buf + old_offset, (accum->size - old_offset));
/* Copy the new metadata at the front */
- HDmemcpy(accum->buf, buf, size);
+ H5MM_memcpy(accum->buf, buf, size);
/* Set the new size & location of the metadata accumulator */
accum->loc = addr;
@@ -583,14 +576,14 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
H5_CHECKED_ASSIGN(add_size, size_t, (addr + size) - (accum->loc + accum->size), hsize_t);
/* Check if we need to adjust accumulator size */
- if(H5F__accum_adjust(accum, &fdio_info, H5F_ACCUM_APPEND, add_size) < 0)
+ if(H5F__accum_adjust(accum, file, H5F_ACCUM_APPEND, add_size) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESIZE, FAIL, "can't adjust metadata accumulator")
/* Compute offset of dirty region (after adjusting accumulator) */
dirty_off = (size_t)(addr - accum->loc);
/* Copy the new metadata to the end */
- HDmemcpy(accum->buf + dirty_off, buf, size);
+ H5MM_memcpy(accum->buf + dirty_off, buf, size);
/* Set the new size of the metadata accumulator */
accum->size += add_size;
@@ -633,7 +626,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
} /* end if */
/* Copy the new metadata to the buffer */
- HDmemcpy(accum->buf, buf, size);
+ H5MM_memcpy(accum->buf, buf, size);
/* Set the new size & location of the metadata accumulator */
accum->loc = addr;
@@ -649,7 +642,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
else {
/* Write out the existing metadata accumulator, with dispatch to driver */
if(accum->dirty) {
- if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, accum->loc + accum->dirty_off, accum->dirty_len, accum->buf + accum->dirty_off) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Reset accumulator dirty flag */
@@ -696,7 +689,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
accum->size = size;
/* Store the piece of metadata in the accumulator */
- HDmemcpy(accum->buf, buf, size);
+ H5MM_memcpy(accum->buf, buf, size);
/* Adjust the dirty region and mark accumulator dirty */
accum->dirty_off = 0;
@@ -729,7 +722,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
accum->size = size;
/* Store the piece of metadata in the accumulator */
- HDmemcpy(accum->buf, buf, size);
+ H5MM_memcpy(accum->buf, buf, size);
/* Adjust the dirty region and mark accumulator dirty */
accum->dirty_off = 0;
@@ -739,13 +732,13 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
} /* end if */
else {
/* Make certain that data in accumulator is visible before new write */
- if((H5F_INTENT(fio_info->f) & H5F_ACC_SWMR_WRITE) > 0)
+ if((H5F_SHARED_INTENT(f_sh) & H5F_ACC_SWMR_WRITE) > 0)
/* Flush if dirty and reset accumulator */
- if(H5F__accum_reset(fio_info, TRUE) < 0)
+ if(H5F__accum_reset(f_sh, TRUE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
/* Write the data */
- if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0)
+ if(H5FD_write(file, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Check for overlap w/accumulator */
@@ -790,7 +783,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
} /* end if */
else { /* Access covers whole accumulator */
/* Reset accumulator, but don't flush */
- if(H5F__accum_reset(fio_info, FALSE) < 0)
+ if(H5F__accum_reset(f_sh, FALSE) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator")
} /* end else */
} /* end if */
@@ -830,7 +823,7 @@ H5F__accum_write(const H5F_io_info2_t *fio_info, H5FD_mem_t map_type, haddr_t ad
} /* end if */
else {
/* Write the data */
- if(H5FD_write(&fdio_info, map_type, addr, size, buf) < 0)
+ if(H5FD_write(file, map_type, addr, size, buf) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
} /* end else */
@@ -854,31 +847,26 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
+H5F__accum_free(H5F_shared_t *f_sh, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr,
hsize_t size)
{
H5F_meta_accum_t *accum; /* Alias for file's metadata accumulator */
- H5FD_io_info_t fdio_info; /* File driver I/O info */
+ H5FD_t *file; /* File driver pointer */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
/* check arguments */
- HDassert(fio_info);
- HDassert(fio_info->f);
- HDassert(fio_info->meta_dxpl);
- HDassert(fio_info->raw_dxpl);
+ HDassert(f_sh);
/* Set up alias for file's metadata accumulator info */
- accum = &fio_info->f->shared->accum;
+ accum = &f_sh->accum;
- /* Translate to file driver I/O info object */
- fdio_info.file = fio_info->f->shared->lf;
- fdio_info.meta_dxpl = fio_info->meta_dxpl;
- fdio_info.raw_dxpl = fio_info->raw_dxpl;
+ /* Translate to file driver pointer */
+ file = f_sh->lf;
/* Adjust the metadata accumulator to remove the freed block, if it overlaps */
- if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA)
+ if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA)
&& H5F_addr_overlap(addr, size, accum->loc, accum->size)) {
size_t overlap_size; /* Size of overlap with accumulator */
@@ -949,7 +937,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type,
/* Check if block to free is entirely before dirty region */
if(H5F_addr_le(tail_addr, dirty_start)) {
/* Write out the entire dirty region of the accumulator */
- if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start, accum->dirty_len, accum->buf + accum->dirty_off) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
} /* end if */
/* Block to free overlaps with some/all of dirty region */
@@ -964,7 +952,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type,
HDassert(write_size > 0);
/* Write out the unfreed dirty region of the accumulator */
- if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
} /* end if */
@@ -984,7 +972,7 @@ H5F__accum_free(const H5F_io_info2_t *fio_info, H5FD_mem_t H5_ATTR_UNUSED type,
HDassert(write_size > 0);
/* Write out the unfreed end of the dirty region of the accumulator */
- if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, dirty_start + dirty_delta, write_size, accum->buf + accum->dirty_off + dirty_delta) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
} /* end if */
@@ -1025,32 +1013,28 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__accum_flush(const H5F_io_info2_t *fio_info)
+H5F__accum_flush(H5F_shared_t *f_sh)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
- HDassert(fio_info);
- HDassert(fio_info->f);
- HDassert(fio_info->meta_dxpl);
- HDassert(fio_info->raw_dxpl);
+ /* Sanity checks */
+ HDassert(f_sh);
/* Check if we need to flush out the metadata accumulator */
- if((fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && fio_info->f->shared->accum.dirty) {
- H5FD_io_info_t fdio_info; /* File driver I/O info */
+ if((f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && f_sh->accum.dirty) {
+ H5FD_t *file; /* File driver pointer */
- /* Translate to file driver I/O info object */
- fdio_info.file = fio_info->f->shared->lf;
- fdio_info.meta_dxpl = fio_info->meta_dxpl;
- fdio_info.raw_dxpl = fio_info->raw_dxpl;
+ /* Translate to file driver pointer */
+ file = f_sh->lf;
/* Flush the metadata contents */
- if(H5FD_write(&fdio_info, H5FD_MEM_DEFAULT, fio_info->f->shared->accum.loc + fio_info->f->shared->accum.dirty_off, fio_info->f->shared->accum.dirty_len, fio_info->f->shared->accum.buf + fio_info->f->shared->accum.dirty_off) < 0)
+ if(H5FD_write(file, H5FD_MEM_DEFAULT, f_sh->accum.loc + f_sh->accum.dirty_off, f_sh->accum.dirty_len, f_sh->accum.buf + f_sh->accum.dirty_off) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
/* Reset the dirty flag */
- fio_info->f->shared->accum.dirty = FALSE;
+ f_sh->accum.dirty = FALSE;
} /* end if */
done:
@@ -1072,34 +1056,31 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5F__accum_reset(const H5F_io_info2_t *fio_info, hbool_t flush)
+H5F__accum_reset(H5F_shared_t *f_sh, hbool_t flush)
{
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_PACKAGE
- HDassert(fio_info);
- HDassert(fio_info->f);
+ /* Sanity checks */
+ HDassert(f_sh);
/* Flush any dirty data in accumulator, if requested */
if(flush)
- if(H5F__accum_flush(fio_info) < 0)
+ if(H5F__accum_flush(f_sh) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTFLUSH, FAIL, "can't flush metadata accumulator")
/* Check if we need to reset the metadata accumulator information */
- if(fio_info->f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) {
- /* Sanity check */
- HDassert(!fio_info->f->closing || FALSE == fio_info->f->shared->accum.dirty);
-
+ if(f_sh->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) {
/* Free the buffer */
- if(fio_info->f->shared->accum.buf)
- fio_info->f->shared->accum.buf = H5FL_BLK_FREE(meta_accum, fio_info->f->shared->accum.buf);
+ if(f_sh->accum.buf)
+ f_sh->accum.buf = H5FL_BLK_FREE(meta_accum, f_sh->accum.buf);
/* Reset the buffer sizes & location */
- fio_info->f->shared->accum.alloc_size = fio_info->f->shared->accum.size = 0;
- fio_info->f->shared->accum.loc = HADDR_UNDEF;
- fio_info->f->shared->accum.dirty = FALSE;
- fio_info->f->shared->accum.dirty_len = 0;
+ f_sh->accum.alloc_size = f_sh->accum.size = 0;
+ f_sh->accum.loc = HADDR_UNDEF;
+ f_sh->accum.dirty = FALSE;
+ f_sh->accum.dirty_len = 0;
} /* end if */
done: