diff options
Diffstat (limited to 'src/H5HFman.c')
-rw-r--r-- | src/H5HFman.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/H5HFman.c b/src/H5HFman.c index 5bdc769..3fb0cfb 100644 --- a/src/H5HFman.c +++ b/src/H5HFman.c @@ -44,6 +44,19 @@ /* Local Macros */ /****************/ +/* Macro to check if we can apply all filters in the pipeline. Use whenever + * performing a modification operation */ + #define H5HF_MAN_WRITE_CHECK_PLINE(HDR) \ +{ \ + if(!((HDR)->checked_filters)) { \ + if((HDR)->pline.nused) \ + if(H5Z_can_apply_direct(&((HDR)->pline)) < 0) \ + HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "I/O filters can't operate on this heap") \ + \ + (HDR)->checked_filters = TRUE; \ + } /* end if */ \ +} + /******************/ /* Local Typedefs */ @@ -116,6 +129,9 @@ HDfprintf(stderr, "%s: obj_size = %Zu\n", FUNC, obj_size); HDassert(obj); HDassert(id); + /* Check pipeline */ + H5HF_MAN_WRITE_CHECK_PLINE(hdr) + /* Look for free space */ if((node_found = H5HF_space_find(hdr, dxpl_id, (hsize_t)obj_size, &sec_node)) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTALLOC, FAIL, "can't locate free space in fractal heap") @@ -272,6 +288,9 @@ H5HF_man_op_real(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, /* Set the access mode for the direct block */ if(op_flags & H5HF_OP_MODIFY) { + /* Check pipeline */ + H5HF_MAN_WRITE_CHECK_PLINE(hdr) + dblock_access = H5AC_WRITE; dblock_cache_flags = H5AC__DIRTIED_FLAG; } /* end if */ @@ -533,6 +552,9 @@ H5HF_man_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) HDassert(hdr); HDassert(id); + /* Check pipeline */ + H5HF_MAN_WRITE_CHECK_PLINE(hdr) + /* Skip over the flag byte */ id++; |