diff options
Diffstat (limited to 'src/H5Dbtree2.c')
-rw-r--r-- | src/H5Dbtree2.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/H5Dbtree2.c b/src/H5Dbtree2.c index 9de609f..3b9b803 100644 --- a/src/H5Dbtree2.c +++ b/src/H5Dbtree2.c @@ -1161,10 +1161,14 @@ H5D__bt2_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *u HDassert(udata); /* Check if the v2 B-tree is open yet */ - if(NULL == idx_info->storage->u.btree2.bt2) + if(NULL == idx_info->storage->u.btree2.bt2) { /* Open existing v2 B-tree */ if(H5D__bt2_idx_open(idx_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't open v2 B-tree") + } /* end if */ + else /* Patch the top level file pointer contained in bt2 if needed */ + if(H5B2_patch_file(idx_info->storage->u.btree2.bt2, idx_info->f) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch v2 B-tree file pointer") /* Set convenience pointer to v2 B-tree structure */ bt2 = idx_info->storage->u.btree2.bt2; @@ -1479,6 +1483,11 @@ H5D__bt2_idx_dest(const H5D_chk_idx_info_t *idx_info) /* Check if the v2-btree is open */ if(idx_info->storage->u.btree2.bt2) { + + /* Patch the top level file pointer contained in bt2 if needed */ + if(H5B2_patch_file(idx_info->storage->u.btree2.bt2, idx_info->f) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "can't patch v2 B-tree file pointer") + /* Close v2 B-tree */ if(H5B2_close(idx_info->storage->u.btree2.bt2, idx_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't close v2 B-tree") |