diff options
Diffstat (limited to 'test/mf.c')
-rw-r--r-- | test/mf.c | 4061 |
1 files changed, 2022 insertions, 2039 deletions
@@ -13,28 +13,30 @@ /* * Tests for file memory management consist of 3 parts: - * test_mf_eoa_*() tests for file meomory that interact with file allocation - * test_mf_fs_*() tests for file memory that interact with the free-space manager - * test_mf_aggr_*() tests for file memory that interact with the aggregators - * test_mf_align_*() tests for file memory with alignment setting - * test_filespace_*() tests for file space management - * test_page_*() tests for file space paging + * test_mf_eoa_*() tests for file meomory that interact with file allocation + * test_mf_fs_*() tests for file memory that interact with the free-space manager + * test_mf_aggr_*() tests for file memory that interact with the aggregators + * test_mf_align_*() tests for file memory with alignment setting + * test_filespace_*() tests for file space management + * test_page_*() tests for file space paging */ #include "h5test.h" -#define H5MF_FRIEND /*suppress error about including H5MFpkg */ +#define H5MF_FRIEND /*suppress error about including H5MFpkg */ #include "H5MFpkg.h" -#define H5FS_FRIEND /*suppress error about including H5FSpkg */ +#define H5FS_FRIEND /*suppress error about including H5FSpkg */ #include "H5FSpkg.h" -#define H5F_FRIEND /*suppress error about including H5Fpkg */ +#define H5F_FRIEND /*suppress error about including H5Fpkg */ #define H5F_TESTING #include "H5Fpkg.h" +#include "H5CXprivate.h" /* API Contexts */ #include "H5FLprivate.h" #include "H5Iprivate.h" +#include "H5VLprivate.h" /* Virtual Object Layer */ #include "H5VMprivate.h" #define FILENAME_LEN 1024 @@ -136,7 +138,7 @@ static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl); static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl); static unsigned test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); -static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); +static unsigned test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); static unsigned test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format); @@ -210,15 +212,15 @@ error: static unsigned test_mf_eoa(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MM_alloc() of file allocation"); @@ -254,26 +256,26 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if (new_ma_addr != ma_addr) TEST_ERROR if (addr1 < (haddr_t)file_size) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if (new_ma_addr != ma_addr) TEST_ERROR @@ -296,11 +298,11 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -316,11 +318,11 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return(0); @@ -328,7 +330,7 @@ test_mf_eoa(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa() */ @@ -338,32 +340,32 @@ error: * To verify that an allocated block from file allocation is shrunk. * * Set up: - * Turn off using meta/small data aggregator - * There is nothing in free-space manager - * - * Test 1: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 30 : succeed - * Test 2: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 20 : fail - * Test 3: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 40 : fail - * Test 4: Allocate a block of 30 from file allocation - * H5MF_try_shrink() the block by 20 from the end: succeed + * Turn off using meta/small data aggregator + * There is nothing in free-space manager + * + * Test 1: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 30 : succeed + * Test 2: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 20 : fail + * Test 3: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 40 : fail + * Test 4: Allocate a block of 30 from file allocation + * H5MF_try_shrink() the block by 20 from the end: succeed * *------------------------------------------------------------------------- */ static unsigned test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size = 0, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr = 0; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + H5FD_mem_t type; + haddr_t addr = 0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_shrink() of file allocation: test 1"); @@ -399,19 +401,19 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != ma_size) TEST_ERROR @@ -431,17 +433,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if(new_ma_addr != ma_addr) TEST_ERROR if(new_ma_size != ma_size) @@ -458,11 +460,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation: test 2"); @@ -476,22 +478,22 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 - 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != ma_size) TEST_ERROR @@ -506,11 +508,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if(new_file_size != (file_size + TBLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ @@ -525,17 +527,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should not succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) + if(H5MF_try_shrink(f, type, addr, (hsize_t)TBLOCK_SIZE30 + 10) > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != ma_size) TEST_ERROR @@ -550,11 +552,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if(new_file_size != (file_size + TBLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation: test 4"); @@ -568,17 +570,17 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* should succeed in shrinking */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) + if(H5MF_try_shrink(f, type, addr+10, (hsize_t)(TBLOCK_SIZE30 - 10)) <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &ma_size); if(new_ma_addr != ma_addr) TEST_ERROR if(new_ma_size != ma_size) @@ -598,11 +600,11 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); @@ -610,7 +612,7 @@ test_mf_eoa_shrink(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa_shrink() */ @@ -620,29 +622,29 @@ error: * To verify that an allocated block from file allocation is extended. * * Set up: - * Turn off using meta/small data aggregator - * There is nothing in free-space manager + * Turn off using meta/small data aggregator + * There is nothing in free-space manager * * Test 1: Allocate a block of 30 - * H5MF_try_extend() the block of size 30 by 50: succeed + * H5MF_try_extend() the block of size 30 by 50: succeed * * Test 2: Allocate a block of 30 - * H5MF_try_extend() the block of size 20 by 50: fail + * H5MF_try_extend() the block of size 20 by 50: fail *------------------------------------------------------------------------- */ static unsigned test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* File size */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* File size */ H5FD_mem_t type; - haddr_t addr; + haddr_t addr; htri_t was_extended; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_extend() of file allocation: test 1"); @@ -680,18 +682,18 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if (addr < (haddr_t)file_size) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr) TEST_ERROR @@ -711,17 +713,17 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* should succeed */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); if(was_extended <= 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr) TEST_ERROR @@ -736,11 +738,11 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if(new_file_size != (file_size + TBLOCK_SIZE30 + TBLOCK_SIZE50)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of file allocation: test 2"); @@ -758,30 +760,30 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); if(addr < (haddr_t)file_size) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != ma_addr) TEST_ERROR - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)(TBLOCK_SIZE50)); /* should not succeed */ if(was_extended > 0) TEST_ERROR /* nothing should be changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr) TEST_ERROR @@ -799,11 +801,11 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); @@ -811,7 +813,7 @@ test_mf_eoa_extend(const char *env_h5_drvr, hid_t fapl) error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_eoa_extend() */ @@ -821,7 +823,7 @@ error: * To verify that temporary blocks are allocated correctly * * Set up: - * There is nothing in free-space manager + * There is nothing in free-space manager * * Tests: * Allocate a reasonable-sized temporary block @@ -853,13 +855,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Can't run this test with multi-file VFDs */ if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi") && HDstrcmp(env_h5_drvr, "family")) { - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ haddr_t maxaddr; /* File's max. address */ - haddr_t tmp_addr; /* Temporary space file address */ - haddr_t norm_addr; /* Normal space file address */ - haddr_t check_addr; /* File address for checking for errors */ + haddr_t tmp_addr; /* Temporary space file address */ + haddr_t norm_addr; /* Normal space file address */ + haddr_t check_addr; /* File address for checking for errors */ unsigned char buf = 0; /* Buffer to read/write with */ herr_t status; /* Generic status value */ @@ -898,11 +900,11 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Retrieve the file's maxaddr */ - if(H5F_get_maxaddr_test(file, &maxaddr) < 0) + if(H5F__get_maxaddr_test(file, &maxaddr) < 0) FAIL_STACK_ERROR /* Allocate some temporary address space */ @@ -917,19 +919,19 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Reading & writing with a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_read(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR H5E_BEGIN_TRY { - status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), H5AC_ind_read_dxpl_id, &buf); + status = H5F_block_write(f, H5FD_MEM_SUPER, tmp_addr, sizeof(buf), &buf); } H5E_END_TRY; if(status >= 0) TEST_ERROR /* Freeing a temporary address value should fail */ H5E_BEGIN_TRY { - status = H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, tmp_addr, (hsize_t)TBLOCK_SIZE30); + status = H5MF_xfree(f, H5FD_MEM_SUPER, tmp_addr, (hsize_t)TBLOCK_SIZE30); } H5E_END_TRY; if(status >= 0) TEST_ERROR @@ -952,7 +954,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 1/3 of the file as temporary address space */ @@ -962,7 +964,7 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Allocate 1/3 of the file as normal address space */ - if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)))) + if(HADDR_UNDEF == (norm_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)))) FAIL_STACK_ERROR if(H5F_IS_TMP_ADDR(f, norm_addr)) TEST_ERROR @@ -976,13 +978,13 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Test that pushing normal space allocation into temporary space fails */ H5E_BEGIN_TRY { - check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)(maxaddr / 3)); + check_addr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)(maxaddr / 3)); } H5E_END_TRY; if(H5F_addr_defined(check_addr)) TEST_ERROR /* Free the normal block (so the file doesn't blow up to a huge size) */ - if(H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, norm_addr, (hsize_t)(maxaddr / 3)) < 0) + if(H5MF_xfree(f, H5FD_MEM_DRAW, norm_addr, (hsize_t)(maxaddr / 3)) < 0) FAIL_STACK_ERROR /* Close the file */ @@ -997,18 +999,18 @@ test_mf_tmp(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support continuous address space"); + SKIPPED(); + HDputs(" Current VFD doesn't support continuous address space"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_tmp() */ @@ -1018,21 +1020,21 @@ error: * To verify that the free-space manager is created or opened * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator *------------------------------------------------------------------------- */ static unsigned test_mf_fs_start(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ H5FS_stat_t state; - TESTING("H5MF_create_fstype()/H5MF_open_fstype() of free-space manager"); + TESTING("H5MF_create_fstype()/H5MF__open_fstype() of free-space manager"); /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -1060,11 +1062,11 @@ test_mf_fs_start(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1086,19 +1088,19 @@ test_mf_fs_start(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_start() */ @@ -1109,36 +1111,36 @@ error: * To verify that a block is allocated/freed from/to the free-space manager * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator * * Test 1: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=30 - * The returned space's address should be same as section A's address - * Deallocate the block which will be returned to the free-space manager + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=30 + * The returned space's address should be same as section A's address + * Deallocate the block which will be returned to the free-space manager * Test 2: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=20 - * The returned space's address should be same as section A's address - * There should still be space of 10 left in the free-space manager - * Deallocate the block which will be returned to free-space manager + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=20 + * The returned space's address should be same as section A's address + * There should still be space of 10 left in the free-space manager + * Deallocate the block which will be returned to free-space manager * Test 3: - * Add section A to free-space manager (addr=70, size=30) - * Allocate a block of size=40 - * The free-space manager is unable to fulfill the request - * The block is allocated from file allocation - * Deallocate the block which will be returned to free-space manager - * (the space is shrunk and freed since it is at end of file) + * Add section A to free-space manager (addr=70, size=30) + * Allocate a block of size=40 + * The free-space manager is unable to fulfill the request + * The block is allocated from file allocation + * Deallocate the block which will be returned to free-space manager + * (the space is shrunk and freed since it is at end of file) *------------------------------------------------------------------------- */ static unsigned test_mf_fs_alloc_free(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - h5_stat_size_t file_size, new_file_size; /* file size */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node = NULL; haddr_t addr; haddr_t tmp; @@ -1172,11 +1174,11 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1185,10 +1187,10 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1200,11 +1202,11 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space */ if(addr != TBLOCK_ADDR70) - TEST_ERROR + TEST_ERROR state.tot_space -= TBLOCK_SIZE30; state.tot_sect_count -= 1; @@ -1214,7 +1216,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); state.tot_space += TBLOCK_SIZE30; state.tot_sect_count += 1; @@ -1223,7 +1225,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1238,9 +1240,9 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 2"); @@ -1249,11 +1251,11 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1262,10 +1264,10 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1277,11 +1279,11 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Allocate a block of 20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE20)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE20)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) - TEST_ERROR + TEST_ERROR /* should still have 1 section of size 10 left in free-space manager */ state.tot_space -= (TBLOCK_SIZE20); @@ -1290,7 +1292,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE20)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE20)); /* Still 1 section in free-space because of merging */ state.tot_space += TBLOCK_SIZE20; @@ -1298,7 +1300,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) @@ -1313,9 +1315,9 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc()/H5MF_xfree() of free-space manager:test 3"); @@ -1324,11 +1326,11 @@ test_mf_fs_alloc_free(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1337,10 +1339,10 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1356,7 +1358,7 @@ test_mf_fs_alloc_free(hid_t fapl) * Since free-space manager cannot fulfull the request, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is not section A in free-space */ if(addr == TBLOCK_ADDR70) @@ -1367,7 +1369,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Remove section A from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR /* Verify that the block is section A in free-space */ @@ -1379,7 +1381,7 @@ test_mf_fs_alloc_free(hid_t fapl) TEST_ERROR /* Free the block of size 40 to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE40)); /* * Free-space info is the same. @@ -1398,19 +1400,19 @@ test_mf_fs_alloc_free(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_alloc_free() */ @@ -1421,47 +1423,47 @@ error: * To verify that a block allocated from the free-space manager can be extended * * Set up: - * Turn off using meta/small data aggregator + * Turn off using meta/small data aggregator * * Test 1: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=50 - * Succeed: section A adjoins section B (70+30=100 which is section B's address) and - * requested-size (50) is equal to the size of section B + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=50 + * Succeed: section A adjoins section B (70+30=100 which is section B's address) and + * requested-size (50) is equal to the size of section B * Test 2: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=60 - * Fail: section A adjoins section B (70+30=100 which is section B's address) but - * requested-size (60) > size of section B (50) + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=60 + * Fail: section A adjoins section B (70+30=100 which is section B's address) but + * requested-size (60) > size of section B (50) * * Test 3: - * Add section A to free-space manager: addr=70, size=30 - * Allocate a block of size 30 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by requested-size=40 - * Succeed: section A adjoins section B (70+30=100 which is section B's address) and - * requested-size (40) < size of section B (50), therefore, - * a section of 10 is left in the free-space manager + * Add section A to free-space manager: addr=70, size=30 + * Allocate a block of size 30 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by requested-size=40 + * Succeed: section A adjoins section B (70+30=100 which is section B's address) and + * requested-size (40) < size of section B (50), therefore, + * a section of 10 is left in the free-space manager * Test 4: - * Add section A to free-space manager: addr=70, size=20 - * Allocate a block of size 20 from free-space manager - * Add section B to free-space manager: addr=100, size=50 - * Try to extend the allocated block by 50 from the free-space_manager: - * Fail: section A does not adjoin section B (70+20 != address of section B) even though - * the requested-size (50) equal to size of section B (50) + * Add section A to free-space manager: addr=70, size=20 + * Allocate a block of size 20 from free-space manager + * Add section B to free-space manager: addr=100, size=50 + * Try to extend the allocated block by 50 from the free-space_manager: + * Fail: section A does not adjoin section B (70+20 != address of section B) even though + * the requested-size (50) equal to size of section B (50) *------------------------------------------------------------------------- */ static unsigned test_mf_fs_extend(hid_t fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl_new = -1; /* copy of fapl */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl_new = -1; /* copy of fapl */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ H5MF_free_section_t *sect_node1 = NULL, *sect_node2=NULL; haddr_t addr; @@ -1497,11 +1499,11 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1510,10 +1512,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1525,7 +1527,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1539,10 +1541,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section B */ - sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1553,11 +1555,11 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)TBLOCK_SIZE50); /* should succeed */ if(was_extended <= 0) - TEST_ERROR + TEST_ERROR /* Section B is removed from free-space manager */ state.tot_space -= TBLOCK_SIZE50; @@ -1568,7 +1570,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); /* Verify that the extended block is back into free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE50); @@ -1579,12 +1581,12 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the extended block */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != TBLOCK_ADDR70) TEST_ERROR - + if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -1594,9 +1596,9 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 2"); @@ -1605,11 +1607,11 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1618,10 +1620,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1633,7 +1635,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1647,10 +1649,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section B */ - sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1661,18 +1663,18 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE50+10)); /* Should not be able to extend the allocated block */ if(was_extended) - TEST_ERROR + TEST_ERROR /* free-space info should remain the same */ if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state)) TEST_ERROR /* Free the allocated block A to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* the returned section A is merged with section B in free-space */ /* rest of the info remains the same */ @@ -1682,7 +1684,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR @@ -1696,9 +1698,9 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 3"); @@ -1707,11 +1709,11 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1720,10 +1722,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1735,7 +1737,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of 30 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1749,10 +1751,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section B */ - sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1763,11 +1765,11 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE30, (hsize_t)(TBLOCK_SIZE40)); /* Should succeed in extending the allocated block */ if(was_extended <=0) - TEST_ERROR + TEST_ERROR /* Should have 1 section of size=10 left in free-space manager */ state.tot_space -= (TBLOCK_SIZE40); @@ -1775,7 +1777,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Free the extended block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE40)); /* rest info is same, the extended section returned is merged with the section in free-space */ state.tot_space += (TBLOCK_SIZE30+TBLOCK_SIZE40); @@ -1784,9 +1786,9 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove the merged sections A & B from free-space */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR - + if(tmp != addr) TEST_ERROR if(H5Fclose(file) < 0) @@ -1798,9 +1800,9 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if (new_file_size != file_size) - TEST_ERROR + TEST_ERROR - PASSED() + PASSED(); TESTING("H5MF_try_extend() of free-space manager:test 4"); @@ -1809,11 +1811,11 @@ test_mf_fs_extend(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -1822,10 +1824,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section A */ - sect_node1 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10)); + sect_node1 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10)); /* Add section A of size=20 to free-space */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node1)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -1837,7 +1839,7 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Allocate a block of size=20 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10)); /* Verify that the allocated block is section A in free-space manager */ if(addr != TBLOCK_ADDR70) @@ -1851,10 +1853,10 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Create section B */ - sect_node2 = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); + sect_node2 = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR100, (hsize_t)TBLOCK_SIZE50); /* Add section B to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node2)) FAIL_STACK_ERROR state.tot_space += TBLOCK_SIZE50; @@ -1865,18 +1867,18 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Try to extend the allocated block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)TBLOCK_ADDR70, (hsize_t)(TBLOCK_SIZE30-10), (hsize_t)TBLOCK_SIZE50); /* Should not succeed in extending the allocated block */ if(was_extended) - TEST_ERROR + TEST_ERROR /* Free-space info should be the same */ if(check_stats(f, f->shared->fs_man[H5FD_MEM_SUPER], &state)) TEST_ERROR /* Free the allocated block */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE30-10)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE30-10)); state.tot_space += (TBLOCK_SIZE30-10); state.tot_sect_count += 1; @@ -1886,13 +1888,13 @@ test_mf_fs_extend(hid_t fapl) TEST_ERROR /* Remove section A from free-space manger */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE30-10), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != addr) TEST_ERROR /* Remove section B from free-space manager */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50, f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(H5Fclose(file) < 0) @@ -1904,19 +1906,19 @@ test_mf_fs_extend(hid_t fapl) /* Verify the file is the correct size */ if(new_file_size != file_size) - TEST_ERROR + TEST_ERROR if(H5Pclose(fapl_new) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); error: H5E_BEGIN_TRY { H5Pclose(fapl_new); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_extend() */ @@ -1925,26 +1927,26 @@ error: *------------------------------------------------------------------------- * To verify that an aggregator is absorbed into a section. * - * Test 1: To aborb the aggregator onto the beginning of the section - * Allocate block A from meta_aggr - * Create a free-space section node with an address that adjoins - * the end of meta_aggr and a size to make the aggregator - * get absorbed into the section. - * The adding of the section to free-space will call H5MF_aggr_absorb(), - * which will absorb meta_aggr to the section: - * section size + remaining size of aggregator is > aggr->alloc_size, - * section is allowed to absorb an aggregator (allow_sect_absorb is true) - * - * Test 2: To absorb the aggregator onto the end of the section - * Allocate block A from meta_aggr - * Allocate block B from sdata_aggr - * Create a free-space section node with an address that adjoins - * the beginning of meta_aggr and a size to make the - * aggregator get absorbed into the section. - * The adding of the section to free-space will call H5MF_aggr_absorb(), - * which will absorb meta_aggr to the section: - * section size + remaining size of aggregator is > aggr->alloc_size, - * section is allowed to absorb an aggregator (allow_sect_absorb is true) + * Test 1: To aborb the aggregator onto the beginning of the section + * Allocate block A from meta_aggr + * Create a free-space section node with an address that adjoins + * the end of meta_aggr and a size to make the aggregator + * get absorbed into the section. + * The adding of the section to free-space will call H5MF_aggr_absorb(), + * which will absorb meta_aggr to the section: + * section size + remaining size of aggregator is > aggr->alloc_size, + * section is allowed to absorb an aggregator (allow_sect_absorb is true) + * + * Test 2: To absorb the aggregator onto the end of the section + * Allocate block A from meta_aggr + * Allocate block B from sdata_aggr + * Create a free-space section node with an address that adjoins + * the beginning of meta_aggr and a size to make the + * aggregator get absorbed into the section. + * The adding of the section to free-space will call H5MF_aggr_absorb(), + * which will absorb meta_aggr to the section: + * section size + remaining size of aggregator is > aggr->alloc_size, + * section is allowed to absorb an aggregator (allow_sect_absorb is true) *------------------------------------------------------------------------- */ static unsigned @@ -1958,7 +1960,7 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) haddr_t ma_addr=HADDR_UNDEF; hsize_t ma_size=0; H5MF_free_section_t *sect_node=NULL; - hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ + hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("A free-space section absorbs an aggregator: test 1"); @@ -1981,12 +1983,12 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) - FAIL_STACK_ERROR + /* Start up H5FD_MEM_SUPER free-space manager */ + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) TEST_ERROR @@ -1994,19 +1996,19 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* Create a section */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)(ma_addr+ma_size), (hsize_t)TBLOCK_SIZE2048); /* Add a section to free-space that adjoins end of the aggregator */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_addr+ma_size), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR if(tmp != ma_addr) TEST_ERROR @@ -2016,16 +2018,16 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("A free-space section absorbs an aggregator: test 2"); @@ -2037,11 +2039,11 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -2050,24 +2052,24 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a section from meta_aggr */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); /* Allocate a section from sdata_aggr */ - saddr = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Add a section to free-space that adjoins the beginning of meta_aggr */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)addr, (hsize_t)TBLOCK_SIZE30); /* When adding, meta_aggr is absorbed onto the end of the section */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR /* Verify that the section did absorb the aggregator */ - if(H5MF_find_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) + if(H5MF__find_sect(f, H5FD_MEM_SUPER, (hsize_t)(ma_size+TBLOCK_SIZE30), f->shared->fs_man[H5FD_MEM_SUPER], &tmp) != TRUE) TEST_ERROR - if((tmp + TBLOCK_SIZE30) != ma_addr) + if((tmp + TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* restore info to meta_aggr */ @@ -2075,25 +2077,25 @@ test_mf_fs_absorb(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.size = ma_size; /* Remove section from meta_aggr */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE30); /* Remove section from sdata_aggr */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_fs_absorb() */ @@ -2102,32 +2104,32 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from meta_aggr - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from meta_aggr + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ hid_t fcpl; /* File creation property list */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 1"); @@ -2163,23 +2165,23 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) TEST_ERROR /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - if((addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) + if((addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30)) == HADDR_UNDEF) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - if((addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) + if((addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50)) == HADDR_UNDEF) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR if(ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50))) @@ -2201,13 +2203,13 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) TEST_ERROR /* Free the two blocks: order matters because of H5F_FSPACE_STRATEGY_AGGR strategy */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50) < 0) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30) < 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -2224,18 +2226,18 @@ test_mf_aggr_alloc1(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fcpl) < 0) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); } H5E_END_TRY; return(1); @@ -2245,38 +2247,38 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate third block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * A block of request-size is extended via file allocation and is merged with meta_aggr - * The block of 2058 is allocated out of meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate third block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and is >= meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * A block of request-size is extended via file allocation and is merged with meta_aggr + * The block of 2058 is allocated out of meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 2"); @@ -2304,28 +2306,28 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR if (ma_size != (TBLOCK_SIZE2048 - (TBLOCK_SIZE30 + TBLOCK_SIZE50))) TEST_ERROR - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3+TBLOCK_SIZE2058) != ma_addr) TEST_ERROR @@ -2350,10 +2352,10 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30+TBLOCK_SIZE50+TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2366,18 +2368,18 @@ test_mf_aggr_alloc2(const char *env_h5_drvr, hid_t fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc2() */ @@ -2386,53 +2388,53 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr : (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in sdata_aggr - * - * Allocate the third block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: A block of request-size is obtained via file allocation - * The new block's address is returned - * Nothing is changed in meta_aggr and sdata_aggr - * - * Allocate fourth block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * The fourth block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr + * Allocate first block (30) from meta_aggr : (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in other_aggr and is < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in sdata_aggr + * + * Allocate the third block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: A block of request-size is obtained via file allocation + * The new block's address is returned + * Nothing is changed in meta_aggr and sdata_aggr + * + * Allocate fourth block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * The fourth block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, addr4, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; - haddr_t sdata_addr=HADDR_UNDEF; - hsize_t sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, addr4, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; + haddr_t sdata_addr=HADDR_UNDEF; + hsize_t sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator: test 3"); @@ -2460,21 +2462,21 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR @@ -2483,16 +2485,16 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block, which is from file allocation not from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2058)); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE2058)); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); /* info for meta_aggr shouldn't be changed */ if(addr3 != (sdata_addr+sdata_size)) TEST_ERROR @@ -2500,8 +2502,8 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) if((new_ma_addr != ma_addr) || (new_ma_size != ma_size)) TEST_ERROR /* Allocate fourth block, which should be from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr4+TBLOCK_SIZE50) != ma_addr) TEST_ERROR @@ -2509,11 +2511,11 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2526,18 +2528,18 @@ test_mf_aggr_alloc3(const char *env_h5_drvr, hid_t fapl) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc3() */ @@ -2547,55 +2549,55 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * There is space of 2018 left in meta_aggr - * The first block of 30 is allocated from there - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * - * Allocate the second block (2018) from sdata_aggr: - * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size - * request-size is < sdata_aggr->alloc_size - * Result: - * The block is allocated from what is left in sdata_aggr (all used up) - * - * Allocate third block (50) from sdata_aggr : - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is extended via file allocation - * The third block of 50 is allocated from there - * There is space of 1998 left in the sdata_aggr - * - * Allocate second block (2058) from meta_aggr: - * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * unused spaced in sdata_aggr is freed to free-space and is shrunk - * sdata_aggr is reset to 0 - * A block of request-size is obtained via file allocation - * The new block's address is returned - * The block does not adjoin meta_aggr - * meta_aggr's info is unchanged + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * There is space of 2018 left in meta_aggr + * The first block of 30 is allocated from there + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * + * Allocate the second block (2018) from sdata_aggr: + * request-size is <= what is left in sdata_aggr and < sdata_aggr->alloc_size + * request-size is < sdata_aggr->alloc_size + * Result: + * The block is allocated from what is left in sdata_aggr (all used up) + * + * Allocate third block (50) from sdata_aggr : + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is extended via file allocation + * The third block of 50 is allocated from there + * There is space of 1998 left in the sdata_aggr + * + * Allocate second block (2058) from meta_aggr: + * request-size is > what is left in meta_aggr and >= meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * unused spaced in sdata_aggr is freed to free-space and is shrunk + * sdata_aggr is reset to 0 + * A block of request-size is obtained via file allocation + * The new block's address is returned + * The block does not adjoin meta_aggr + * meta_aggr's info is unchanged *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, saddr1, saddr2, saddr3; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, saddr1, saddr2, saddr3; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 4"); @@ -2623,14 +2625,14 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -2639,20 +2641,20 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr2 = H5MF_alloc(f, stype, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if(saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr3+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -2660,27 +2662,27 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate second block of 2058, which is from file allocation, not from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); if(addr2 != sdata_addr) TEST_ERROR /* sdata_aggr is reset 0 */ - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((sdata_addr != 0) && (sdata_size != 0)) TEST_ERROR /* info is unchanged in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if((new_ma_addr != ma_addr) && (new_ma_size != ma_size)) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2058); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2693,18 +2695,18 @@ test_mf_aggr_alloc4(const char *env_h5_drvr, hid_t fapl) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc4() */ @@ -2713,37 +2715,37 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocate from there + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocate from there * - * Allocate second block (50) from meta_aggr: - * request-size is < what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left there - * There is space of 1968 left in the meta_aggr + * Allocate second block (50) from meta_aggr: + * request-size is < what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left there + * There is space of 1968 left in the meta_aggr * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size - * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr - * The block of 1970 is allocated from there - * There is space of 2046 left in meta_aggr + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size + * Result: A block of meta_aggr->alloc_size is extended via file allocation and is absorbed into the meta_aggr + * The block of 1970 is allocated from there + * There is space of 2046 left in meta_aggr * *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* File size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_alloc() of meta/sdata aggregator:test 5"); @@ -2771,20 +2773,20 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) TEST_ERROR @@ -2792,8 +2794,8 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(addr3 != ma_addr) TEST_ERROR if((addr3+TBLOCK_SIZE1970) != new_ma_addr) TEST_ERROR @@ -2801,9 +2803,9 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2816,18 +2818,18 @@ test_mf_aggr_alloc5(const char *env_h5_drvr, hid_t fapl) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc5() */ @@ -2836,47 +2838,47 @@ error: *------------------------------------------------------------------------- * To verify that blocks are allocated from the aggregator * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in meta_aggr - * There is space of 1968 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from there - * There is space of 2018 left in sdata_aggr - * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is obtained via file allocation. - * The block does not adjoin meta_aggr - * sdata_aggr is untouched - * meta_aggr's unused space of [880, 1968] is freed to free-space - * meta_aggr is updated to point to the new block + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in meta_aggr + * There is space of 1968 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr and is < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from there + * There is space of 2018 left in sdata_aggr + * + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and < meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is obtained via file allocation. + * The block does not adjoin meta_aggr + * sdata_aggr is untouched + * meta_aggr's unused space of [880, 1968] is freed to free-space + * meta_aggr is updated to point to the new block *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; /* file size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; H5FS_stat_t state; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -2905,21 +2907,21 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR type = H5FD_MEM_SUPER; /* Allocate first block from meta_aggr */ - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(addr2+TBLOCK_SIZE50 != ma_addr) TEST_ERROR @@ -2928,16 +2930,16 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR if(sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if((addr3+TBLOCK_SIZE1970) != new_ma_addr) TEST_ERROR if(addr3 != (sdata_addr+sdata_size)) TEST_ERROR @@ -2956,10 +2958,10 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -2972,18 +2974,18 @@ test_mf_aggr_alloc6(const char *env_h5_drvr, hid_t fapl) if(new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc6() */ @@ -2998,52 +3000,52 @@ error: * A block of meta_aggr->alloc_size is obtained via file allocation * The first block of 30 is allocated from there * - * Allocate second block (50) from meta_aggr: - * request-size is <= what is left in meta_aggr - * Result: - * The second block of 50 is allocated from what is left in the aggregator - * There is space of 1968 left in the meta_aggr - * - * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) - * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocate from there - * - * Allocate second block (2018) from sdata_aggr: - * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size - * Result: - * The second block of 2018 is allocated from what is left in sdata_aggr (all used up) - * - * Allocate third block (50) from sdata_aggr: - * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is extended via file allocation - * The third block of 50 is allocated from there - * - * Allocate third block (1970) from meta_aggr: - * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * unused space in sdata_aggr is freed to free-space and is shrunk - * sdata_aggr is reset to 0 - * A block of meta_aggr->alloc_size is obtained via file allocation - * The block does not adjoin meta_aggr - * meta_aggr's unused space of [880, 1968] is freed to free-space - * meta_aggr is updated to point to the new block + * Allocate second block (50) from meta_aggr: + * request-size is <= what is left in meta_aggr + * Result: + * The second block of 50 is allocated from what is left in the aggregator + * There is space of 1968 left in the meta_aggr + * + * Allocate first block (30) from sdata_aggr: (nothing in sdata_aggr) + * request-size is > what is left in sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocate from there + * + * Allocate second block (2018) from sdata_aggr: + * request-size is <= what is left in sdata_aggr and is < sdata_aggr->alloc_size + * Result: + * The second block of 2018 is allocated from what is left in sdata_aggr (all used up) + * + * Allocate third block (50) from sdata_aggr: + * request-size is > what is left in sdata_aggr and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is extended via file allocation + * The third block of 50 is allocated from there + * + * Allocate third block (1970) from meta_aggr: + * request-size is > what is left in meta_aggr and is < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * unused space in sdata_aggr is freed to free-space and is shrunk + * sdata_aggr is reset to 0 + * A block of meta_aggr->alloc_size is obtained via file allocation + * The block does not adjoin meta_aggr + * meta_aggr's unused space of [880, 1968] is freed to free-space + * meta_aggr is updated to point to the new block *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size, file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1, saddr2, saddr3; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0; H5FS_stat_t state; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -3072,19 +3074,19 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the second block from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr2+TBLOCK_SIZE50 != ma_addr) TEST_ERROR @@ -3093,38 +3095,38 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* Allocate the second block from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2048 - TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr2+(TBLOCK_SIZE2048 - TBLOCK_SIZE30)) != sdata_addr) TEST_ERROR if (sdata_size != 0) TEST_ERROR /* Allocate the third block from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr3+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR if (sdata_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE50)) TEST_ERROR /* Allocate the third block from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if (addr3 != sdata_addr) TEST_ERROR if ((addr3 + TBLOCK_SIZE1970) != ma_addr) TEST_ERROR if (ma_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE1970)) TEST_ERROR /* sdata_aggr info is reset to 0 */ - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if (sdata_addr != HADDR_UNDEF) TEST_ERROR if (sdata_size != 0) TEST_ERROR @@ -3138,12 +3140,12 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free all the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr2, (hsize_t)(TBLOCK_SIZE2048 - TBLOCK_SIZE30)); + H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3156,18 +3158,18 @@ test_mf_aggr_alloc7(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_alloc7() */ @@ -3176,38 +3178,38 @@ error: *------------------------------------------------------------------------- * To verify that a block can be extended from the aggregator * - * Test 1: Allocate block A from meta_aggr which is at end of file - * Try to extend the block which adjoins the aggregator that is at end of file - * a. block size < (% * aggr->alloc_size) - * The block is allocated from the aggregator - * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size - * The block is extended by aggr->alloc_size and the block is allocated from the aggregator - * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size - * The block is extended by extended-request and the block is allocated from the aggregator - * - * Test 2: Allocate block A from meta_aggr - * Allocate block B from sdata_aggr so that meta_aggr is not at end of file - * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request - * H5MF_try_extend() succeeds: the block is extended into the aggregator - * - * Test 3: Allocate block A from meta_aggr - * Allocate block B from sdata_aggr so that meta_aggr is not at end of file - * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request - * H5MF_try_extend() fails + * Test 1: Allocate block A from meta_aggr which is at end of file + * Try to extend the block which adjoins the aggregator that is at end of file + * a. block size < (% * aggr->alloc_size) + * The block is allocated from the aggregator + * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size + * The block is extended by aggr->alloc_size and the block is allocated from the aggregator + * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size + * The block is extended by extended-request and the block is allocated from the aggregator + * + * Test 2: Allocate block A from meta_aggr + * Allocate block B from sdata_aggr so that meta_aggr is not at end of file + * Try to extend a block which adjoins meta_aggr and meta_aggr can fulfill the extended-request + * H5MF_try_extend() succeeds: the block is extended into the aggregator + * + * Test 3: Allocate block A from meta_aggr + * Allocate block B from sdata_aggr so that meta_aggr is not at end of file + * Try to extend a block which adjoins meta_aggr but meta_aggr cannot fulfill the extended-request + * H5MF_try_extend() fails *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; - H5FD_mem_t type, stype; - haddr_t new_addr, addr, saddr; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; - htri_t was_extended; + H5FD_mem_t type, stype; + haddr_t new_addr, addr, saddr; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + htri_t was_extended; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 1"); @@ -3235,13 +3237,13 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -3252,52 +3254,52 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* Try to extend the block by an amount < (% * aggr->alloc_size) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); /* should succeed */ if(!was_extended) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != (addr+TBLOCK_SIZE50)) TEST_ERROR if(new_ma_size != (f->shared->meta_aggr.alloc_size - TBLOCK_SIZE50)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE50); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE700)); /* should succeed */ if(!was_extended) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != (addr + TBLOCK_SIZE700)) TEST_ERROR if(new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TBLOCK_SIZE700)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE700); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE700); /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE2058)); /* should succeed */ if(!was_extended) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != (addr + TBLOCK_SIZE2058)) TEST_ERROR if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE2058); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3310,11 +3312,11 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 2"); @@ -3326,20 +3328,20 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate the first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3350,12 +3352,12 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* should be able to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(!was_extended) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != (addr+TBLOCK_SIZE50)) TEST_ERROR @@ -3366,8 +3368,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3380,11 +3382,11 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_extend() of meta/sdata aggregator: test 3"); @@ -3396,20 +3398,20 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate first block from meta_aggr */ type = H5FD_MEM_SUPER; - addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate first block from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + saddr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr+TBLOCK_SIZE50) != sdata_addr) TEST_ERROR @@ -3420,12 +3422,12 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; /* unable to fulfill request from the aggreqator itself */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); + was_extended = H5MF_try_extend(f, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TBLOCK_SIZE50)); if(was_extended) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != addr) TEST_ERROR if (new_ma_size != 0) TEST_ERROR @@ -3434,8 +3436,8 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) f->shared->meta_aggr.addr = ma_addr; f->shared->meta_aggr.size = ma_size; - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3448,18 +3450,18 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if(file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_extend() */ @@ -3470,35 +3472,35 @@ error: * * MF_try_shrink() only allows blocks to be absorbed into an aggregator * - * Test 1: H5MF_alloc() block A from meta_aggr - * H5MF_try_shrink() block A should merge it back into meta_aggr - * since block A adjoins the beginning of meta_aggr + * Test 1: H5MF_alloc() block A from meta_aggr + * H5MF_try_shrink() block A should merge it back into meta_aggr + * since block A adjoins the beginning of meta_aggr * - * Test 2: H5MF_alloc() block A from meta_aggr - * H5MF_alloc() block B from sdata_aggr - * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr - * because sec2 driver is FLMAP_DICHOTOMY by default + * Test 2: H5MF_alloc() block A from meta_aggr + * H5MF_alloc() block B from sdata_aggr + * H5MF_try_shrink() block B should merge it back to the end of sdata_aggr + * because sec2 driver is FLMAP_DICHOTOMY by default * - * Test 3: H5MF_alloc() block A from meta_aggr - * H5MF_alloc() block B from meta_aggr - * H5MF_alloc() block C from meta_aggr - * H5MF_try_shrink() block B should fail since it does not adjoin the - * beginning nor the end of meta_aggr + * Test 3: H5MF_alloc() block A from meta_aggr + * H5MF_alloc() block B from meta_aggr + * H5MF_alloc() block C from meta_aggr + * H5MF_try_shrink() block B should fail since it does not adjoin the + * beginning nor the end of meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t empty_size = 0, file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - haddr_t new_sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0; - hsize_t sdata_size=0, new_sdata_size=0; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + haddr_t new_sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0; + hsize_t sdata_size=0, new_sdata_size=0; hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 1"); @@ -3526,23 +3528,23 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); ma_addr = new_ma_addr - TBLOCK_SIZE30; if((addr1 + TBLOCK_SIZE30) != new_ma_addr) TEST_ERROR /* should succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE30) <= 0) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != ma_addr) TEST_ERROR @@ -3557,11 +3559,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 2"); @@ -3573,37 +3575,37 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR if(ma_size != (TBLOCK_SIZE2048 - TBLOCK_SIZE30)) TEST_ERROR /* Allocate block B from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), NULL, &sdata_size); /* should succeed */ - if(H5MF_try_shrink(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, stype, saddr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); if(new_sdata_addr != saddr1) TEST_ERROR if(new_sdata_size != sdata_size + TBLOCK_SIZE50) TEST_ERROR /* meta_aggr info should be updated because the block is absorbed into the meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr) TEST_ERROR if (new_ma_size != (ma_size)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3616,11 +3618,11 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ TESTING("H5MF_try_shrink() of meta/sdata aggregator: test 3"); @@ -3632,40 +3634,40 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate block A from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR /* Allocate block B from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* Allocate block C from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + addr3 = H5MF_alloc(f, type, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3+TBLOCK_SIZE30+TBLOCK_SIZE50) != ma_addr) TEST_ERROR /* should not succeed */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50) > 0) + if(H5MF_try_shrink(f, type, addr2, (hsize_t)TBLOCK_SIZE50) > 0) TEST_ERROR /* aggregator info should be the same as before */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if(new_ma_addr != ma_addr) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)(TBLOCK_SIZE30+TBLOCK_SIZE50)); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3678,18 +3680,18 @@ test_mf_aggr_absorb(const char *env_h5_drvr, hid_t fapl) if(file_size != empty_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support metadata aggregator"); + SKIPPED(); + HDputs(" Current VFD doesn't support metadata aggregator"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_aggr_absorb() */ @@ -3701,46 +3703,46 @@ error: * Alignment = 1024 or 4096 * * Test 1: - * Turn off using meta data aggregator - * Allocate a block of 30 which should be from file allocation - * Result: - * The return address should be aligned - * A fragment [800, 224] or [800, 3296] is freed to free-space - * EOA is 1054 or 4126 - * - * Allocate a block of 50 which should be from file allocation - * Result: - * The return address should be aligned - * A fragment [1054, 994] or [4126, 4066] is freed to free-space - * EOA is 2098 or 8242 + * Turn off using metadata aggregator + * Allocate a block of 30 which should be from file allocation + * Result: + * The return address should be aligned + * A fragment [800, 224] or [800, 3296] is freed to free-space + * EOA is 1054 or 4126 + * + * Allocate a block of 50 which should be from file allocation + * Result: + * The return address should be aligned + * A fragment [1054, 994] or [4126, 4066] is freed to free-space + * EOA is 2098 or 8242 * Test 2: - * Turn off using meta data aggregator - * Allocate a block which should be from file allocation - * The return address should be aligned - * H5MF_try_shrink() the block with aligned address should succeed + * Turn off using metadata aggregator + * Allocate a block which should be from file allocation + * The return address should be aligned + * H5MF_try_shrink() the block with aligned address should succeed * * Test 3: - * Turn off using meta data aggregator - * Allocate a block which should be from file allocation - * The return address should be aligned - * H5MF_try_extend() the block with aligned address should succeed + * Turn off using metadata aggregator + * Allocate a block which should be from file allocation + * The return address should be aligned + * H5MF_try_extend() the block with aligned address should succeed *------------------------------------------------------------------------- */ static unsigned test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - hid_t fapl1 = -1; - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + hid_t fapl1 = -1; + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size, new_file_size; - H5FD_mem_t type; - haddr_t addr1, addr2; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0; - htri_t was_extended; + H5FD_mem_t type; + haddr_t addr1, addr2; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0; + htri_t was_extended; H5FS_stat_t state; - hsize_t alignment=0, mis_align=0, tmp=0, accum=0; + hsize_t alignment=0, mis_align=0, tmp=0, accum=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MM_alloc() of file allocation with alignment: test 1"); @@ -3781,7 +3783,7 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -3792,13 +3794,13 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from file allocation */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR /* there should be nothing in the aggregator */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(ma_addr || ma_size) TEST_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -3816,13 +3818,13 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; accum += (mis_align + TBLOCK_SIZE50); - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR /* there should be nothing in the aggregator */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(ma_addr || ma_size) TEST_ERROR if(mis_align) { @@ -3833,8 +3835,8 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); if(H5Fclose(file) < 0) FAIL_STACK_ERROR @@ -3845,11 +3847,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != file_size) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ TESTING("H5MF_try_shrink() of file allocation with alignment: test 2"); @@ -3863,12 +3865,12 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if (addr1 % alignment) TEST_ERROR @@ -3885,11 +3887,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* shrink the block */ - if(H5MF_try_shrink(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) + if(H5MF_try_shrink(f, type, addr1, (hsize_t)TBLOCK_SIZE50) <= 0) TEST_ERROR if(H5Fclose(file) < 0) @@ -3900,11 +3902,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != (file_size-TBLOCK_SIZE50)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ TESTING("H5MF_try_extend() of file allocation with alignment: test 3"); @@ -3918,12 +3920,12 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* allocate a block of 50 */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* address should be aligned */ if(addr1 % alignment) TEST_ERROR @@ -3940,11 +3942,11 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); + was_extended = H5MF_try_extend(f, type, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE50, (hsize_t)TBLOCK_SIZE30); if(was_extended <=0) TEST_ERROR @@ -3956,18 +3958,18 @@ test_mf_align_eoa(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (new_file_size != (file_size+TBLOCK_SIZE30)) TEST_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_eoa() */ @@ -3979,43 +3981,43 @@ error: * Alignment = 1024 or 4096 * * Test 1: - * Add section A with an aligned address to free-space manager (addr=alignment, size=50) - * Allocate a block of size=50 - * The returned space's address should be same as section A's address + * Add section A with an aligned address to free-space manager (addr=alignment, size=50) + * Allocate a block of size=50 + * The returned space's address should be same as section A's address * * Test 2: - * Add section A to free-space manager (addr=70, size=8000): - * section A is mis-aligned but the size is big enough for allocation with alignment - * Allocate a block of size=600 - * The returned space should be allocated from section A with an aligned address: - * address=alignment size=600 - * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096) - * the fragment left from aligning section A: [70, 954] or [70, 4026] - * the section left after allocating block A: [1624, 416] or [4696, 3374] - * H5MF_try_extend() the block of size 600 by 200 should succeed: - * the existing fragment left from aligning section A: [70, 954] or [70, 4026] - * the section left after extending block A: [1824, 216] or [4896, 3174] + * Add section A to free-space manager (addr=70, size=8000): + * section A is mis-aligned but the size is big enough for allocation with alignment + * Allocate a block of size=600 + * The returned space should be allocated from section A with an aligned address: + * address=alignment size=600 + * There will be 2 sections in free-space: (alignment = 1024 or alignment = 4096) + * the fragment left from aligning section A: [70, 954] or [70, 4026] + * the section left after allocating block A: [1624, 416] or [4696, 3374] + * H5MF_try_extend() the block of size 600 by 200 should succeed: + * the existing fragment left from aligning section A: [70, 954] or [70, 4026] + * the section left after extending block A: [1824, 216] or [4896, 3174] * * Test 3: - * Add section A to free-space manager (addr=70, size=700): - * section A is mis-aligned but the size is not big enough for allocation with alignment - * Allocate a block of size=40 - * The free-space manager is unable to fulfill the request - * The block is allocated from file allocation and should be aligned + * Add section A to free-space manager (addr=70, size=700): + * section A is mis-aligned but the size is not big enough for allocation with alignment + * Allocate a block of size=40 + * The free-space manager is unable to fulfill the request + * The block is allocated from file allocation and should be aligned *------------------------------------------------------------------------- */ static unsigned test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ h5_stat_size_t file_size; - H5F_t *f = NULL; /* Internal file object pointer */ + H5F_t *f = NULL; /* Internal file object pointer */ H5MF_free_section_t *sect_node = NULL; - haddr_t addr; + haddr_t addr; H5FS_stat_t state; htri_t was_extended; - hsize_t alignment=0, tmp=0, mis_align=0; + hsize_t alignment=0, tmp=0, mis_align=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of free-space manager with alignment: test 1"); @@ -4040,11 +4042,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4053,10 +4055,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)alignment, (hsize_t)TBLOCK_SIZE50); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4068,7 +4070,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 50 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is section A in free-space */ if(addr != (haddr_t)alignment) TEST_ERROR @@ -4082,7 +4084,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)TBLOCK_SIZE50); state.tot_space += TBLOCK_SIZE50; state.tot_sect_count += 1; @@ -4093,7 +4095,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc() of free-space manager with alignment: test 2"); @@ -4103,11 +4105,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4116,10 +4118,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE8000); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4131,7 +4133,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Allocate a block of 600 */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE600); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE600); /* Verify that the allocated block is aligned */ if (addr % alignment) TEST_ERROR @@ -4145,7 +4147,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* try to extend the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); + was_extended = H5MF_try_extend(f, H5FD_MEM_SUPER, (haddr_t)addr, (hsize_t)TBLOCK_SIZE600, (hsize_t)TBLOCK_SIZE200); if(was_extended <=0) TEST_ERROR @@ -4156,7 +4158,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Free the block to free-space manager */ - H5MF_xfree(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); + H5MF_xfree(f, H5FD_MEM_SUPER, addr, (hsize_t)(TBLOCK_SIZE600+TBLOCK_SIZE200)); /* only 1 section in free-space because of merging */ state.tot_space += (TBLOCK_SIZE600+TBLOCK_SIZE200); @@ -4168,7 +4170,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); TESTING("H5MF_alloc() of free-space manager with alignment: test 3"); @@ -4186,11 +4188,11 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_start_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) + if(H5MF__start_fstype(f, (H5F_mem_page_t)H5FD_MEM_SUPER) < 0) FAIL_STACK_ERROR if(f->shared->fs_state[H5FD_MEM_SUPER] != H5F_FS_STATE_OPEN) @@ -4199,10 +4201,10 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) TEST_ERROR /* Create section A */ - sect_node = H5MF_sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700); + sect_node = H5MF__sect_new(H5MF_FSPACE_SECT_SIMPLE, (haddr_t)TBLOCK_ADDR70, (hsize_t)TBLOCK_SIZE700); /* Add section A to free-space manager */ - if(H5MF_add_sect(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) + if(H5MF__add_sect(f, H5FD_MEM_SUPER, f->shared->fs_man[H5FD_MEM_SUPER], sect_node)) FAIL_STACK_ERROR HDmemset(&state, 0, sizeof(H5FS_stat_t)); @@ -4217,7 +4219,7 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * Since free-space manager cannot fulfull the request because of alignment, * the block is obtained from file allocation */ - addr = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)(TBLOCK_SIZE40)); + addr = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)(TBLOCK_SIZE40)); /* Verify that the allocated block is aligned */ if(addr % alignment) @@ -4243,18 +4245,18 @@ test_mf_align_fs(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_fs() */ @@ -4263,114 +4265,114 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (nothing in the aggregator) - * request-size > aggr->size and < aggr->alloc_size - * Result: - * An "aggr->alloc_size" block is allocated from file allocation for the aggregator - * EOA is 3072 - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * There is space of 2018 left in meta_aggr - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in meta_aggr - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) > aggr->size - * request-size < meta_aggr->alloc_size - * fragment size < (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr - * EOA is 5120 - * The third block of 80 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974] - * There is space of 1968 left in meta_aggr - * - * Allocate fourth block (1970) from meta_aggr: - * (request-size + fragment size) is <= aggr->size - * fragment size > (aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size)) - * is extended from file allocation for meta_aggr - * The third block of 1970 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944] - * There is space of 1968 left in meta_aggr - * EOA is at 8034 - * - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (aggregator is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left in meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The third block of 80 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046] - * There is space of 2018 left in meta_aggr - * EOA is at 14386 - * - * Allocate fourth block (1970) from meta_aggr: - * (request-size + fragment size) > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment size > (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The fourth block of 1970 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016] - * There is space of 2018 left in meta_aggr - * EOA is at 20372 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (nothing in the aggregator) + * request-size > aggr->size and < aggr->alloc_size + * Result: + * An "aggr->alloc_size" block is allocated from file allocation for the aggregator + * EOA is 3072 + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * There is space of 2018 left in meta_aggr + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in meta_aggr + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) > aggr->size + * request-size < meta_aggr->alloc_size + * fragment size < (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of "meta_aggr->alloc_size" is extended from file allocation for meta_aggr + * EOA is 5120 + * The third block of 80 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[2098, 974] + * There is space of 1968 left in meta_aggr + * + * Allocate fourth block (1970) from meta_aggr: + * (request-size + fragment size) is <= aggr->size + * fragment size > (aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of aggr->alloc_size + fragment size - (aggr->alloc_size - request-size)) + * is extended from file allocation for meta_aggr + * The third block of 1970 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3152, 944] + * There is space of 1968 left in meta_aggr + * EOA is at 8034 + * + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (aggregator is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left in meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The third block of 80 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[8242, 4046] + * There is space of 2018 left in meta_aggr + * EOA is at 14386 + * + * Allocate fourth block (1970) from meta_aggr: + * (request-size + fragment size) > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment size > (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size + (fragment size - (meta_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The fourth block of 1970 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[12368, 4016] + * There is space of 2018 left in meta_aggr + * EOA is at 20372 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ - H5FD_mem_t type; - haddr_t addr1, addr2, addr3, addr4; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3, addr4; H5FS_stat_t state; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -4406,7 +4408,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -4415,7 +4417,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4428,7 +4430,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1 + TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -4439,7 +4441,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4451,7 +4453,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2 + TBLOCK_SIZE50) != ma_addr) TEST_ERROR @@ -4461,7 +4463,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if ((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -4473,7 +4475,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3 + TBLOCK_SIZE80) != ma_addr) TEST_ERROR @@ -4484,7 +4486,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1970 from meta_aggr */ - addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1970); + addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1970); /* Verify that the allocated block is aligned */ if(addr4 % alignment) TEST_ERROR @@ -4496,7 +4498,7 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr4 + TBLOCK_SIZE1970) != ma_addr) TEST_ERROR @@ -4505,26 +4507,26 @@ test_mf_align_alloc1(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(check_stats(f, f->shared->fs_man[type], &state)) TEST_ERROR - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE1970); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE1970); if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc1() */ @@ -4533,101 +4535,101 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (50) from meta_aggr: - * (request-size+fragment size) <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in meta_aggr - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is obtained via file allocation - * The first block of 30 is allocated from sdata_aggr and should be aligned - * EOA is 5120 - * - * Allocate third block (80) from meta_aggr: - * request-size+fragment size is > meta_aggr->size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * The unused space in meta_aggr is freed to free-space [2098, 974] - * meta_aggr is updated to point to the new block - * The third block of 80 is allocated from meta_aggr and should be aligned - * EOA is 7168 - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > aggr->size and < aggr->alloc_size - * Result: - * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) > aggr->size - * request-size < aggr->alloc_size - * fragment size > (aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size - * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size - * Result: - * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF - * meta_aggr is reset to 0 - * A block of sdata_aggr->alloc_size is obtained via file allocation - * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] - * The first block of 30 is allocated from sdata_aggr and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 14336 - * - * Allocate third block (80) from meta_aggr: - * (request-size + fragment size) is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator - * Fragment from alignment of file allocation is freed to free-space:[14336, 2048] - * other_aggr is [12318, 2018] - * The third block of 80 is allocated from the aggregator and should be aligned - * There is space of 1968 left in meta_aggr - * EOA is at 18432 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (50) from meta_aggr: + * (request-size+fragment size) <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in meta_aggr + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is obtained via file allocation + * The first block of 30 is allocated from sdata_aggr and should be aligned + * EOA is 5120 + * + * Allocate third block (80) from meta_aggr: + * request-size+fragment size is > meta_aggr->size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * The unused space in meta_aggr is freed to free-space [2098, 974] + * meta_aggr is updated to point to the new block + * The third block of 80 is allocated from meta_aggr and should be aligned + * EOA is 7168 + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > aggr->size and < aggr->alloc_size + * Result: + * A meta_aggr->alloc_size block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) > aggr->size + * request-size < aggr->alloc_size + * fragment size > (aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size is > sdata_aggr->size and < sdata_aggr->alloc_size + * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size + * Result: + * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk since at EOF + * meta_aggr is reset to 0 + * A block of sdata_aggr->alloc_size is obtained via file allocation + * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] + * The first block of 30 is allocated from sdata_aggr and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 14336 + * + * Allocate third block (80) from meta_aggr: + * (request-size + fragment size) is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator + * Fragment from alignment of file allocation is freed to free-space:[14336, 2048] + * other_aggr is [12318, 2018] + * The third block of 80 is allocated from the aggregator and should be aligned + * There is space of 1968 left in meta_aggr + * EOA is at 18432 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; /* File size */ - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3, saddr1; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3, saddr1; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 2"); @@ -4662,7 +4664,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -4671,7 +4673,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -4684,7 +4686,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1 + TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -4694,7 +4696,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if((tmp = ma_addr % alignment)) mis_align = alignment - tmp; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -4706,7 +4708,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2 + TBLOCK_SIZE50) != ma_addr) TEST_ERROR @@ -4716,11 +4718,11 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * * For alignment = 1024, alloc_size = 2048: * block 30 is allocated from (ma_addr + ma_size), - * which is already aligned + * which is already aligned * * For alignment = 4096, alloc_size = 2048: - * since remaining space in meta_aggr is freed and shrunk, - * block 30 is allocated from ma_addr + * since remaining space in meta_aggr is freed and shrunk, + * block 30 is allocated from ma_addr */ mis_align = 0; if((alignment == TEST_ALIGN1024) && (tmp = ((ma_addr + ma_size) % alignment))) @@ -4730,7 +4732,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* fragment for alignment of block 30 for sdata_aggr is freed to free-space */ if(mis_align) { @@ -4742,8 +4744,8 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Verify that the allocated block is aligned */ if (saddr1 % alignment) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if(sdata_addr != (saddr1 + TBLOCK_SIZE30)) TEST_ERROR @@ -4751,10 +4753,10 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) * Calculate fragment for the allocation of block 80 from meta_aggr: * * For alignment = 1024, alloc_size = 2048: - * fragment for unused space in meta_aggr is freed to free-space + * fragment for unused space in meta_aggr is freed to free-space * For alignment = 4096, alloc_size = 2048: - * fragment from alignment of ma_addr is freed - * block 30 is allocated from ma_addr + * fragment from alignment of ma_addr is freed + * block 30 is allocated from ma_addr */ mis_align = 0; if((alignment == TEST_ALIGN1024) && (tmp = (ma_addr % alignment))) @@ -4763,7 +4765,7 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (addr3 % alignment) TEST_ERROR @@ -4775,42 +4777,42 @@ test_mf_align_alloc2(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3 + TBLOCK_SIZE80) != ma_addr) TEST_ERROR /* Verify total size of free space after all the allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE50); - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE80); - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE80); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc2() */ @@ -4819,153 +4821,153 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (50) from meta_aggr: - * (request-size+fragment size) is <= aggr->size - * Result: - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 974 left in the aggregator - * - * Allocate first block (30) from other_aggr: (nothing in other_aggr) - * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size - * Result: - * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr - * The first block of 30 is allocated from other_aggr and should be aligned - * There is space of 2018 left in other_aggr->size - * EOA is 5120 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) < sdata_aggr->size - * Result: - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] - * There is space of 974 left in sdata_aggr - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) is >= sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * sdata_aggr is at EOA - * Result: - * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] - * There is space of 1968 left in sdata_aggr - * EOA is 7168 - * - * Allocate third block (1034) from meta_aggregator: - * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk - * sdata_aggr is reset to 0 - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space [5200, 944] - * The unused space in meta_aggr is freed to free-space [2098, 974] - * The meta_aggr is updated to point to the new space - * The block of 1034 is allocated from the new block and should be aligned - * There is space of 1014 left in meta_aggr - * EOA is 8192 - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > what is left in aggr->size and < aggr->alloc_size - * Result: - * A meta_aggr->alloc block is allocated from file allocation for the aggregator - * The first block of 30 is allocated from the aggregator and should be aligned - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * There is space of 2018 left in meta_aggr - * EOA is at 6144 - * - * Allocate second block (50) from meta_aggr: - * (request-size + fragment size) is > what is left in aggr->size - * request-size < aggr->alloc_size - * fragment size > (aggr->alloc_size - request-size) - * Result: - * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * The second block of 50 is allocated from the aggregator and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 left in meta_aggr - * EOA is at 10260 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request-size > sdata_aggr->size and < sdata_aggr->alloc_size - * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size - * Result: - * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk - * since at EOF - * meta_aggr is reset to 0 - * A block of sdata_aggr->alloc_size is obtained via file allocation - * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] - * The first block of 30 is allocated from sdata_aggr and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 14336 - * - * Allocate second block (50) from sdata_aggr: - * request-size is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)) - * is extended from file allocation for the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066] - * The second block of 50 is allocated from the aggregator and should be aligned - * There is space of 2018 left in the sdata_aggr - * EOA is at 18452 - * - * Allocate third block (80) from sdata_aggr: - * request-size + fragment size is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size) - * is allocated from file allocation for the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046] - * The third block of 80 is allocated from the aggregator and should be aligned - * There is space of 2018 left in the sdata_aggr - * EOA is at 22578 - * - * Allocate third block (1034) from meta_aggregator: - * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk - * sdata_aggr is reset to 0 - * There is nothing in meta_aggr - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space [20560, 4016] - * EOA is 26624 - * The meta_aggr is updated to point to the new space - * The block of 1034 is allocated from the new block and should be aligned - * There is space of 1014 left in meta_aggr + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation for the aggregator + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (50) from meta_aggr: + * (request-size+fragment size) is <= aggr->size + * Result: + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 974 left in the aggregator + * + * Allocate first block (30) from other_aggr: (nothing in other_aggr) + * request-size is > what is left in other_aggr->size and < other_aggr->alloc_size + * Result: + * A "other_aggr->alloc_size" block is allocated from file allocation for other_aggr + * The first block of 30 is allocated from other_aggr and should be aligned + * There is space of 2018 left in other_aggr->size + * EOA is 5120 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) < sdata_aggr->size + * Result: + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] + * There is space of 974 left in sdata_aggr + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) is >= sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * sdata_aggr is at EOA + * Result: + * Another block of sdata_aggr->alloc_size is extended from file allocation for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] + * There is space of 1968 left in sdata_aggr + * EOA is 7168 + * + * Allocate third block (1034) from meta_aggregator: + * (request-size + alignment) > meta_aggr->size but < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The unused space in sdata_aggr is freed to free-space [5200, 1968] then shrunk + * sdata_aggr is reset to 0 + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space [5200, 944] + * The unused space in meta_aggr is freed to free-space [2098, 974] + * The meta_aggr is updated to point to the new space + * The block of 1034 is allocated from the new block and should be aligned + * There is space of 1014 left in meta_aggr + * EOA is 8192 + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > what is left in aggr->size and < aggr->alloc_size + * Result: + * A meta_aggr->alloc block is allocated from file allocation for the aggregator + * The first block of 30 is allocated from the aggregator and should be aligned + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * There is space of 2018 left in meta_aggr + * EOA is at 6144 + * + * Allocate second block (50) from meta_aggr: + * (request-size + fragment size) is > what is left in aggr->size + * request-size < aggr->alloc_size + * fragment size > (aggr->alloc_size - request-size) + * Result: + * A block of aggr->alloc_size + (fragment size - (aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * The second block of 50 is allocated from the aggregator and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 left in meta_aggr + * EOA is at 10260 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request-size > sdata_aggr->size and < sdata_aggr->alloc_size + * meta_aggr is at EOA and has used up more than meta_aggr->alloc_size + * Result: + * The remaining space in meta_aggr is freed to free-space [8242, 2018] and shrunk + * since at EOF + * meta_aggr is reset to 0 + * A block of sdata_aggr->alloc_size is obtained via file allocation + * Fragment from alignment of file allocation is freed to free-space: [8242, 4046] + * The first block of 30 is allocated from sdata_aggr and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 14336 + * + * Allocate second block (50) from sdata_aggr: + * request-size is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size)) + * is extended from file allocation for the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[12318, 4066] + * The second block of 50 is allocated from the aggregator and should be aligned + * There is space of 2018 left in the sdata_aggr + * EOA is at 18452 + * + * Allocate third block (80) from sdata_aggr: + * request-size + fragment size is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of sdata_aggr->alloc_size + (fragment size - (sdata_aggr->alloc_size - request-size) + * is allocated from file allocation for the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[16434, 4046] + * The third block of 80 is allocated from the aggregator and should be aligned + * There is space of 2018 left in the sdata_aggr + * EOA is at 22578 + * + * Allocate third block (1034) from meta_aggregator: + * (request-size + fragment size) is > meta_aggr->size but request-size < meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space [20560, 2018] then shrunk + * sdata_aggr is reset to 0 + * There is nothing in meta_aggr + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space [20560, 4016] + * EOA is 26624 + * The meta_aggr is updated to point to the new space + * The block of 1034 is allocated from the new block and should be aligned + * There is space of 1014 left in meta_aggr *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, addr3; - haddr_t saddr1, saddr2, saddr3; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, addr3; + haddr_t saddr1, saddr2, saddr3; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, sdata_size=0, mis_align=0; - hsize_t alignment=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, sdata_size=0, mis_align=0; + hsize_t alignment=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5001,7 +5003,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* calculate fragment for alignment of block 30 */ @@ -5010,7 +5012,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5023,7 +5025,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1 + TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -5033,7 +5035,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5045,7 +5047,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2 + TBLOCK_SIZE50) != ma_addr) TEST_ERROR @@ -5068,7 +5070,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5080,7 +5082,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if(sdata_addr != (saddr1+TBLOCK_SIZE30)) TEST_ERROR /* calculate fragment for alignment of block 50 in sdata_aggr */ @@ -5089,7 +5091,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if(saddr2 % alignment) TEST_ERROR @@ -5101,7 +5103,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if(sdata_addr != (saddr2 + TBLOCK_SIZE50)) TEST_ERROR /* calculate fragment for alignment of block 80 in sdata_aggr */ @@ -5110,7 +5112,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if(saddr3 % alignment) TEST_ERROR @@ -5122,7 +5124,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if ((saddr3 + TBLOCK_SIZE80) != sdata_addr) TEST_ERROR @@ -5132,7 +5134,7 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 1034 for meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1034); /* Verify that the allocated block is aligned */ if(addr3 % alignment) TEST_ERROR @@ -5156,37 +5158,37 @@ test_mf_align_alloc3(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr3 + TBLOCK_SIZE1034) != ma_addr) TEST_ERROR /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc3() */ @@ -5196,81 +5198,81 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate second block (2058) from meta_aggr: - * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * The second block of 2058 + fragment is extended and merged together with meta_aggr - * The block of 2058 is allocated out of the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] - * There is space of 2018 (same as before) left in meta_aggr - * EOA is 6124 - * - * Allocate third block (5) from meta_aggr: - * request-size+fragment < meta_aggr->size - * Result: - * A block of 5 is allocated from the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014] - * There is space of 999 left in meta_aggr - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate second block (2058) from meta_aggr: - * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size - * meta_aggr is at EOA - * Result: - * The second block of 2058 + fragment is extended and merged together with meta_aggr - * The block of 2058 is allocated out of the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] - * There is space of 2018 (same as before) left in meta_aggr - * EOA is 12268 - * - * Allocate third block (5) from meta_aggr: - * request-size+fragment is > meta_aggr->size - * request-size < meta_aggr->alloc_size - * fragment < (meta_aggr->alloc_size - request-size) - * meta_aggr is at EOA - * Result: - * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator - * A block of 5 is allocated from the aggregator - * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038] - * There is space of 2023 left in meta_aggr + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate second block (2058) from meta_aggr: + * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * The second block of 2058 + fragment is extended and merged together with meta_aggr + * The block of 2058 is allocated out of the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[1054, 994] + * There is space of 2018 (same as before) left in meta_aggr + * EOA is 6124 + * + * Allocate third block (5) from meta_aggr: + * request-size+fragment < meta_aggr->size + * Result: + * A block of 5 is allocated from the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[4106, 1014] + * There is space of 999 left in meta_aggr + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate second block (2058) from meta_aggr: + * (request-size+fragment) is > meta_aggr->size and request-size is > meta_aggr->alloc_size + * meta_aggr is at EOA + * Result: + * The second block of 2058 + fragment is extended and merged together with meta_aggr + * The block of 2058 is allocated out of the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[4126, 4066] + * There is space of 2018 (same as before) left in meta_aggr + * EOA is 12268 + * + * Allocate third block (5) from meta_aggr: + * request-size+fragment is > meta_aggr->size + * request-size < meta_aggr->alloc_size + * fragment < (meta_aggr->alloc_size - request-size) + * meta_aggr is at EOA + * Result: + * A block of meta_aggr->alloc_size is extended from file allocation for the aggregator + * A block of 5 is allocated from the aggregator + * Fragment from alignment of aggregator allocation is freed to free-space:[10250, 2038] + * There is space of 2023 left in meta_aggr * *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type; - haddr_t addr1, addr2, addr3; + H5FD_mem_t type; + haddr_t addr1, addr2, addr3; H5FS_stat_t state; - haddr_t ma_addr=HADDR_UNDEF; - hsize_t ma_size=0, saved_ma_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF; + hsize_t ma_size=0, saved_ma_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5302,7 +5304,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5315,7 +5317,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR @@ -5328,7 +5330,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); saved_ma_size = ma_size; if((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -5338,7 +5340,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if(addr2 % alignment) TEST_ERROR @@ -5350,7 +5352,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state.serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr2 + TBLOCK_SIZE2058) != ma_addr) TEST_ERROR @@ -5363,7 +5365,7 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 5 from meta_aggr */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5); /* fragment for alignment of block 5 is freed to free-space */ if(mis_align) { @@ -5376,26 +5378,26 @@ test_mf_align_alloc4(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if(addr3 % alignment) TEST_ERROR /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &state)) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &state)) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc4() */ @@ -5404,84 +5406,84 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 3072 - * - * Allocate first block (30) from sdata_aggr: (nothing in the aggregator) - * A block of sdata_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 5120 - * - * Allocate second block (2058) from meta_aggr: - * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size - * Result: - * A block of 2058 is allocated from file allocation - * EOA is 7178 - * Nothing is changed in meta_aggr and sdata_aggr - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from meta_aggr and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate first block (30) from sdata_aggr: (meta_aggr is empty) - * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[6144, 2048] - * This fragment adjoins meta_aggr and fulfills "absorb" condition, - * the remaining space left in meta_aggr is absorbed into the fragment and - * freed to free-space: [4126, 2018] - * meta_aggr is reset to 0 - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 10240 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request_size is > meta_aggr->alloc_size - * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size - * Result: - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[10240, 2048] - * This fragment adjoins sdata_aggr and fulfills "absorb" condition, - * the remaining space left in sdata_aggr is absorbed into the fragment and - * freed to free-space: [8222, 2018] - * sdata_aggr is reset to 0 - * EOA is 14346 - * meta_aggr and sdata_aggr are all 0 + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 3072 + * + * Allocate first block (30) from sdata_aggr: (nothing in the aggregator) + * A block of sdata_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 5120 + * + * Allocate second block (2058) from meta_aggr: + * (request-size + fragment size) > meta_aggr->size and > meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up sdata_aggr->alloc_size + * Result: + * A block of 2058 is allocated from file allocation + * EOA is 7178 + * Nothing is changed in meta_aggr and sdata_aggr + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from meta_aggr and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate first block (30) from sdata_aggr: (meta_aggr is empty) + * meta_aggr is at EOA but has not used up more than meta_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[6144, 2048] + * This fragment adjoins meta_aggr and fulfills "absorb" condition, + * the remaining space left in meta_aggr is absorbed into the fragment and + * freed to free-space: [4126, 2018] + * meta_aggr is reset to 0 + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 10240 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request_size is > meta_aggr->alloc_size + * sdata_aggr is at EOA but has not used up more than sdata_aggr->alloc_size + * Result: + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[10240, 2048] + * This fragment adjoins sdata_aggr and fulfills "absorb" condition, + * the remaining space left in sdata_aggr is absorbed into the fragment and + * freed to free-space: [8222, 2018] + * sdata_aggr is reset to 0 + * EOA is 14346 + * meta_aggr and sdata_aggr are all 0 *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2, saddr1; + H5FD_mem_t type, stype; + haddr_t addr1, addr2, saddr1; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; - haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF; + haddr_t sdata_addr=HADDR_UNDEF, new_sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0, new_sdata_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ @@ -5513,7 +5515,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5526,12 +5528,12 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(addr1 % alignment) TEST_ERROR - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if((addr1 + TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -5550,7 +5552,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if(saddr1 % alignment) TEST_ERROR @@ -5562,7 +5564,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if((saddr1+TBLOCK_SIZE30) != sdata_addr) TEST_ERROR /* calculate fragment for alignment of block 2058 from meta_aggr */ @@ -5571,7 +5573,7 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -5584,41 +5586,41 @@ test_mf_align_alloc5(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) } /* Verify total size of free space after all allocations */ - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } /* nothing is changed in meta_aggr */ - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); if (new_ma_addr != ma_addr || new_ma_size != ma_size) TEST_ERROR /* nothing is changed in sdata_aggr */ - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &new_sdata_addr, &new_sdata_size); if (new_sdata_addr != sdata_addr || new_sdata_size != sdata_size) TEST_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_align_alloc5() */ @@ -5628,125 +5630,125 @@ error: *------------------------------------------------------------------------- * To verify that blocks allocated from the aggregator are aligned * - * Alignment = 1024 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is empty) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 224] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr->size - * EOA is 3072 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request_size > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 5120 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) <= sdata_aggr->size - * Result: - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] - * There is space of 974 left in sdata_aggr - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size < (sdata_aggr->alloc_size - request-size) - * Result: - * Another block of sdata_aggr->alloc_size block is extended from file allocation - * for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] - * There is space of 1968 left in sdata_aggr - * EOA is 7168 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request-size is > meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space and shrunk - * sdata_aggr is reset to 0 - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[5200, 944] - * EOA is at 8202 - * meta_aggr is unchanged - * - * Alignment = 4096 aggr->alloc_size = 2048 - * - * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy) - * request-size is > meta_aggr->size and < meta_aggr->alloc_size - * Result: - * A block of meta_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[800, 3296] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in meta_aggr - * EOA is 6144 - * - * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) - * request_size > sdata_aggr->size and < sdata_aggr->alloc_size - * Result: - * A block of sdata_aggr->alloc_size is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space: [6144, 2048] - * The first block of 30 is allocated from the aggregator and should be aligned - * There is space of 2018 left in sdata_aggr - * EOA is 10240 - * - * Allocate second block (50) from sdata_aggr: - * (request-size+fragment size) is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for the aggregator - * The second block of 50 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066] - * There is space of 2018 left in sdata_aggr - * EOA is at 14356 - * - * Allocate third block (80) from sdata_aggr: - * (request-size+fragment size) is > sdata_aggr->size - * request-size < sdata_aggr->alloc_size - * fragment size > (sdata_aggr->alloc_size - request-size) - * Result: - * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr - * The third block of 80 is allocated from sdata_aggr and should be aligned - * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046] - * There is space of 2018 left in sdata_aggr - * EOA is 18482 - * - * Allocate second block (2058) from meta_aggr: - * request-size + fragment size is > meta_aggr->size - * request-size is > meta_aggr->alloc_size - * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size - * Result: - * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018] - * sdata_aggr is reset to 0 - * A block of 2058 is allocated from file allocation - * Fragment from alignment of file allocation is freed to free-space:[16464, 4016] - * EOA is at 22538 - * meta_aggr is unchanged + * Alignment = 1024 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is empty) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 224] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr->size + * EOA is 3072 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request_size > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 5120 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) <= sdata_aggr->size + * Result: + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[3102, 994] + * There is space of 974 left in sdata_aggr + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size < (sdata_aggr->alloc_size - request-size) + * Result: + * Another block of sdata_aggr->alloc_size block is extended from file allocation + * for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[4146, 974] + * There is space of 1968 left in sdata_aggr + * EOA is 7168 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request-size is > meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space and shrunk + * sdata_aggr is reset to 0 + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[5200, 944] + * EOA is at 8202 + * meta_aggr is unchanged + * + * Alignment = 4096 aggr->alloc_size = 2048 + * + * Allocate first block (30) from meta_aggr: (meta_aggr is emtpy) + * request-size is > meta_aggr->size and < meta_aggr->alloc_size + * Result: + * A block of meta_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[800, 3296] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in meta_aggr + * EOA is 6144 + * + * Allocate first block (30) from sdata_aggr: (sdata_aggr is empty) + * request_size > sdata_aggr->size and < sdata_aggr->alloc_size + * Result: + * A block of sdata_aggr->alloc_size is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space: [6144, 2048] + * The first block of 30 is allocated from the aggregator and should be aligned + * There is space of 2018 left in sdata_aggr + * EOA is 10240 + * + * Allocate second block (50) from sdata_aggr: + * (request-size+fragment size) is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for the aggregator + * The second block of 50 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[8222, 4066] + * There is space of 2018 left in sdata_aggr + * EOA is at 14356 + * + * Allocate third block (80) from sdata_aggr: + * (request-size+fragment size) is > sdata_aggr->size + * request-size < sdata_aggr->alloc_size + * fragment size > (sdata_aggr->alloc_size - request-size) + * Result: + * A block of (fragment size + request-size) is extended from file allocation for sdata_aggr + * The third block of 80 is allocated from sdata_aggr and should be aligned + * Fragment from alignment of aggregator allocation is freed to free-space:[12338, 4046] + * There is space of 2018 left in sdata_aggr + * EOA is 18482 + * + * Allocate second block (2058) from meta_aggr: + * request-size + fragment size is > meta_aggr->size + * request-size is > meta_aggr->alloc_size + * sdata_aggr is at EOA and has used up more than sdata_aggr->alloc_size + * Result: + * The remaining space in sdata_aggr is freed to free-space and shrunk: [16464, 2018] + * sdata_aggr is reset to 0 + * A block of 2058 is allocated from file allocation + * Fragment from alignment of file allocation is freed to free-space:[16464, 4016] + * EOA is at 22538 + * meta_aggr is unchanged *------------------------------------------------------------------------- */ static unsigned test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ h5_stat_size_t file_size; - H5FD_mem_t type, stype; - haddr_t addr1, addr2; - haddr_t saddr1, saddr2, saddr3; + H5FD_mem_t type, stype; + haddr_t addr1, addr2; + haddr_t saddr1, saddr2, saddr3; H5FS_stat_t state[H5FD_MEM_NTYPES]; - haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; - hsize_t ma_size=0, new_ma_size=0, sdata_size=0; - hsize_t alignment=0, mis_align=0, tmp=0; + haddr_t ma_addr=HADDR_UNDEF, new_ma_addr=HADDR_UNDEF, sdata_addr=HADDR_UNDEF; + hsize_t ma_size=0, new_ma_size=0, sdata_size=0; + hsize_t alignment=0, mis_align=0, tmp=0; hbool_t have_alloc_vfd; /* Whether VFD used has an 'alloc' callback */ TESTING("H5MF_alloc() of meta/sdata aggregator with alignment: test 6"); @@ -5777,7 +5779,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* get alignment setting */ @@ -5790,7 +5792,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from meta_aggr */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (addr1 % alignment) TEST_ERROR @@ -5803,7 +5805,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size); if ((addr1+TBLOCK_SIZE30) != ma_addr) TEST_ERROR @@ -5814,7 +5816,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) /* Allocate a block of 30 from sdata_aggr */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that the allocated block is aligned */ if (saddr1 % alignment) TEST_ERROR @@ -5826,7 +5828,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if (sdata_addr != (saddr1+TBLOCK_SIZE30)) TEST_ERROR /* calculate fragment for alignment of block 50 in sdata_aggr */ @@ -5835,7 +5837,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 50 from sdata_aggr */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE50); /* Verify that the allocated block is aligned */ if (saddr2 % alignment) TEST_ERROR @@ -5847,7 +5849,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if (sdata_addr != (saddr2+TBLOCK_SIZE50)) TEST_ERROR /* calculate fragment for alignment of block 80 in sdata_aggr */ @@ -5856,7 +5858,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 80 from sdata_aggr */ - saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE80); /* Verify that the allocated block is aligned */ if (saddr3 % alignment) TEST_ERROR @@ -5868,7 +5870,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[stype].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if (sdata_addr != (saddr3+TBLOCK_SIZE80)) TEST_ERROR /* calculate fragment for alignment of block 2058 */ @@ -5878,7 +5880,7 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) mis_align = alignment - tmp; /* Allocate a block of 2058 from meta_aggr */ - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2058); + addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2058); /* Verify that the allocated block is aligned */ if (addr2 % alignment) TEST_ERROR @@ -5890,8 +5892,8 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) state[type].serial_sect_count += 1; } - H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); - H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); + H5MF__aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + H5MF__aggr_query(f, &(f->shared->sdata_aggr), &sdata_addr, &sdata_size); if (new_ma_addr != ma_addr && new_ma_size != ma_size) TEST_ERROR @@ -5899,34 +5901,34 @@ test_mf_align_alloc6(const char *env_h5_drvr, hid_t fapl, hid_t new_fapl) if (sdata_addr != HADDR_UNDEF || sdata_size != 0) TEST_ERROR - if(f->shared->fs_man[type]) { - if(check_stats(f, f->shared->fs_man[type], &(state[type]))) - TEST_ERROR - } - + if(f->shared->fs_man[type]) { + if(check_stats(f, f->shared->fs_man[type], &(state[type]))) + TEST_ERROR + } + - if(f->shared->fs_man[stype]) { - if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) - TEST_ERROR - } + if(f->shared->fs_man[stype]) { + if(check_stats(f, f->shared->fs_man[stype], &(state[stype]))) + TEST_ERROR + } if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } /* end if */ else { - SKIPPED(); - puts(" Current VFD doesn't support mis-aligned fragments"); + SKIPPED(); + HDputs(" Current VFD doesn't support mis-aligned fragments"); } /* end else */ - return(0); + return 0; error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; - return(1); + return 1; } /* test_mf_align_alloc6() */ /* @@ -6003,7 +6005,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Populate memb_fapl_arr, patch memb_addr so member file addresses * are aligned */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl_arr[mt] = memb_fapl; memb_addr[mt] = ((memb_addr[mt] + align - 1) / align) * align; } /* end for */ @@ -6013,7 +6015,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free memb_name */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) free(memb_name[mt]); } /* end else */ @@ -6027,14 +6029,14 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) TEST_ERROR /* Allocate a block of size align from meta_aggr. This should create an * aggregator that extends to the end of the file, with * block_size / 2 bytes remaining, and the end of the file aligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr1 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6043,7 +6045,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * aggregator to extend to the end of the file, with 0 bytes remaining, and * the end of the file aligned */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, align); + addr2 = H5MF_alloc(f, type, align); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6055,7 +6057,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * force the aggregator to extend to the end of the file, with 0 bytes * remaining, and the end of the file unaligned */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, block_size + (hsize_t)1); + addr1 = H5MF_alloc(f, type, block_size + (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr1 % align) TEST_ERROR @@ -6067,7 +6069,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) /* Allocate a block of size 1. This should extend the aggregator from * the previous allocation, and align the new block */ type = H5FD_MEM_SUPER; - addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)1); + addr2 = H5MF_alloc(f, type, (hsize_t)1); /* Verify that the allocated block is aligned */ if(addr2 % align) TEST_ERROR @@ -6076,7 +6078,7 @@ test_mf_bug1(const char *env_h5_drvr, hid_t fapl) * the previous */ if((addr2 - addr1) != (3 * align)) TEST_ERROR - PASSED() + PASSED(); /* Close file */ if(H5Fclose(file) < 0) @@ -6113,39 +6115,39 @@ test_mf_fs_persist_split(void) TESTING("File's free-space managers are persistent for split-file"); - /* for now, we don't support persistant free space managers + /* for now, we don't support persistent free space managers * with the split file driver. */ SKIPPED(); - HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n"); + HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n"); return 0; /* <========== note return */ /* File creation property list template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - /* for now, we don't support persistant free space managers + /* for now, we don't support persistent free space managers * with the split file driver. */ SKIPPED(); - HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n"); + HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n"); return 0; /* <========== note return */ /* File creation property list template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Set up split driver */ if(H5Pset_fapl_split(fapl, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT)<0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* File creation property list template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) - FAIL_STACK_ERROR + FAIL_STACK_ERROR /* Set the filename to use for this test (dependent on fapl) */ h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); @@ -6155,41 +6157,41 @@ test_mf_fs_persist_split(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6200,7 +6202,7 @@ test_mf_fs_persist_split(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6208,7 +6210,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6222,7 +6224,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6233,7 +6235,7 @@ test_mf_fs_persist_split(void) /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6247,13 +6249,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR @@ -6262,19 +6264,19 @@ test_mf_fs_persist_split(void) /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (baddr5 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (baddr6 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (baddr7 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8))) + if(HADDR_UNDEF == (baddr8 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE8))) FAIL_STACK_ERROR /* Put block #5 & #7 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, btype, baddr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) + if(H5MF_xfree(f, btype, baddr7, (hsize_t)TBLOCK_SIZE7) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6285,7 +6287,7 @@ test_mf_fs_persist_split(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_DRAW is not there */ @@ -6297,7 +6299,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6309,13 +6311,13 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) - FAIL_STACK_ERROR + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) + FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #7 from H5FD_MEM_BTREE free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE7))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE7))) FAIL_STACK_ERROR if(tmp_addr != baddr7) TEST_ERROR @@ -6329,7 +6331,7 @@ test_mf_fs_persist_split(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6337,7 +6339,7 @@ test_mf_fs_persist_split(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6356,7 +6358,7 @@ test_mf_fs_persist_split(void) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); @@ -6376,7 +6378,7 @@ error: HDmemset(memb_name, 0, sizeof memb_name); \ HDmemset(memb_addr, 0, sizeof memb_addr); \ HDmemset(sv, 0, sizeof sv); \ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { \ + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { \ memb_map[mt] = H5FD_MEM_SUPER; \ memb_fapl[mt] = H5P_DEFAULT; \ } \ @@ -6384,22 +6386,22 @@ error: memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; \ memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP; \ memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP; \ - sprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ + HDsprintf(sv[H5FD_MEM_SUPER], "%%s-%c.h5", 's'); \ memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER]; \ memb_addr[H5FD_MEM_SUPER] = 0; \ - sprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ + HDsprintf(sv[H5FD_MEM_BTREE], "%%s-%c.h5", 'b'); \ memb_name[H5FD_MEM_BTREE] = sv[H5FD_MEM_BTREE]; \ memb_addr[H5FD_MEM_BTREE] = HADDR_MAX/6; \ - sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ + HDsprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); \ memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW]; \ memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/3; \ - sprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ + HDsprintf(sv[H5FD_MEM_GHEAP], "%%s-%c.h5", 'g'); \ memb_name[H5FD_MEM_GHEAP] = sv[H5FD_MEM_GHEAP]; \ memb_addr[H5FD_MEM_GHEAP] = HADDR_MAX/2; \ - sprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ + HDsprintf(sv[H5FD_MEM_LHEAP], "%%s-%c.h5", 'l'); \ memb_name[H5FD_MEM_LHEAP] = sv[H5FD_MEM_LHEAP]; \ memb_addr[H5FD_MEM_LHEAP] = HADDR_MAX*2/3; \ - sprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ + HDsprintf(sv[H5FD_MEM_OHDR], "%%s-%c.h5", 'o'); \ memb_name[H5FD_MEM_OHDR] = sv[H5FD_MEM_OHDR]; \ memb_addr[H5FD_MEM_OHDR] = HADDR_MAX*5/6; \ } @@ -6435,18 +6437,18 @@ test_mf_fs_persist_multi(void) TESTING("File's free-space managers are persistent for multi-file"); - /* for now, we don't support persistant free space managers + /* for now, we don't support persistent free space managers * with the multi file driver. */ SKIPPED(); - HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n"); + HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n"); return 0; /* <========== note return */ - /* for now, we don't support persistant free space managers + /* for now, we don't support persistent free space managers * with the multi file driver. */ SKIPPED(); - HDfprintf(stdout, " Persistant FSMs disabled in multi file driver.\n"); + HDfprintf(stdout, " Persistent FSMs disabled in multi file driver.\n"); return 0; /* <========== note return */ /* File creation property list template */ @@ -6472,41 +6474,41 @@ test_mf_fs_persist_multi(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Allocate 4 blocks of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (saddr3 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (saddr4 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1, #3 into H5FD_MEM_DRAW free-space manager */ - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, stype, saddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6517,7 +6519,7 @@ test_mf_fs_persist_multi(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the H5FD_MEM_SUPER free-space manager is there */ @@ -6525,7 +6527,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6539,7 +6541,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager; block #3 still in free-space */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6549,7 +6551,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_DRAW free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)stype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)stype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6563,32 +6565,32 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve blocks #1 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != saddr1) TEST_ERROR /* Retrieve blocks #3 from H5FD_MEM_DRAW free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != saddr3) TEST_ERROR /* Allocate 4 blocks of type H5FD_MEM_BTREE */ btype = H5FD_MEM_BTREE; - if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (baddr1 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (baddr2 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (baddr3 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (baddr4 = H5MF_alloc(f, btype, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR /* Put block #1 & #3 into H5FD_MEM_BTREE free-space manager */ - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, btype, baddr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, btype, H5AC_ind_read_dxpl_id, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, btype, baddr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6599,7 +6601,7 @@ test_mf_fs_persist_multi(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that the free-space manager for H5FD_MEM_SUPER is there */ @@ -6607,7 +6609,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6619,7 +6621,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR @@ -6633,7 +6635,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_BTREE free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)btype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)btype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6648,13 +6650,13 @@ test_mf_fs_persist_multi(void) /* Allocate 2 blocks of type H5FD_MEM_GHEAP */ gtype = H5FD_MEM_GHEAP; - if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (gaddr2 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (gaddr1 = H5MF_alloc(f, gtype, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR /* Put block #2 into H5FD_MEM_GHEAP free-space manager */ - if(H5MF_xfree(f, gtype, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, gtype, gaddr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6665,21 +6667,21 @@ test_mf_fs_persist_multi(void) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* If H5FD_MEM_SUPER is there, should not find block #1 & #3 */ if(H5F_addr_defined(f->shared->fs_addr[type])) { /* Start up H5FD_MEM_SUPER free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)type) < 0) FAIL_STACK_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE1, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR - if((node_found = H5FS_sect_find(f, H5AC_ind_read_dxpl_id, f->shared->fs_man[type], + if((node_found = H5FS_sect_find(f, f->shared->fs_man[type], (hsize_t)TBLOCK_SIZE3, (H5FS_section_info_t **)&node)) < 0) FAIL_STACK_ERROR if(node_found) TEST_ERROR @@ -6690,7 +6692,7 @@ test_mf_fs_persist_multi(void) TEST_ERROR /* Start up H5FD_MEM_GHEAP free-space manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)gtype) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)gtype) < 0) FAIL_STACK_ERROR /* Get free-space info */ @@ -6709,7 +6711,7 @@ test_mf_fs_persist_multi(void) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); @@ -6746,7 +6748,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TESTING("File's free-space is persistent with new library format") else TESTING("File's free-space is persistent with old library format") - + if(HDstrcmp(env_h5_drvr, "split") && HDstrcmp(env_h5_drvr, "multi")) { /* File creation property list template */ @@ -6777,30 +6779,30 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6811,28 +6813,18 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* Verify that H5FD_MEM_SUPER free-space manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[tt])) TEST_ERROR - /* Since we are about to open a self referential free space - * manager prior to the first file space allocation / deallocation - * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid - * assertion failures on the first file space alloc / dealloc. - */ - if((f->shared->first_alloc_dealloc) && - (SUCCEED != - H5MF_tidy_self_referential_fsm_hack(f, H5AC_ind_read_dxpl_id))) - FAIL_STACK_ERROR - /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[tt])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)tt) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)tt) < 0) FAIL_STACK_ERROR /* Get info for free-space manager */ @@ -6847,13 +6839,13 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR if(tmp_addr != addr3) TEST_ERROR /* Retrieve block #1 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(tmp_addr != addr1) TEST_ERROR @@ -6866,7 +6858,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ @@ -6874,7 +6866,7 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) TEST_ERROR /* Retrieve block #5 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (tmp_addr = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR if(tmp_addr != addr5) TEST_ERROR @@ -6886,18 +6878,18 @@ test_mf_fs_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -6906,7 +6898,7 @@ error: /* *------------------------------------------------------------------------- - * Verify free-space are merged/shrunk away + * Verify free-space are merged/shrunk away *------------------------------------------------------------------------- */ static unsigned @@ -6920,9 +6912,9 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) H5FD_mem_t type; /* File allocation type */ H5FS_stat_t fs_stat; /* Information for free-space manager */ haddr_t addr1, addr2, addr3, addr4; /* File address for H5FD_MEM_SUPER */ - H5FD_mem_t fs_type; + haddr_t addrx; + H5FD_mem_t fs_type; hbool_t contig_addr_vfd; - hbool_t ran_H5MF_tidy_self_referential_fsm_hack = FALSE; if(new_format) TESTING("File's free-space is going away with new library format") @@ -6941,9 +6933,13 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR - if(new_format) + if(new_format) { if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) FAIL_STACK_ERROR + } else { + if(H5Pset_libver_bounds(fapl2, H5F_LIBVER_V18, H5F_LIBVER_LATEST) < 0) + FAIL_STACK_ERROR + } /* Set to aggregation and persisting free-space */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) @@ -6957,30 +6953,30 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 4 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - + /* Put block #1, #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR /* Retrieve block #1, #3 from H5FD_MEM_SUPER free-space manager */ - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -6991,17 +6987,17 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE4, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE4, (H5F_mem_page_t *)&fs_type); /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ if(H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR /* Put block #3 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) @@ -7012,47 +7008,36 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Verify that H5FD_MEM_SUPER free-space manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR - /* Since we are about to open a self referential free space - * manager prior to the first file space allocation / deallocation - * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid - * assertion failures on the first file space alloc / dealloc. - */ - if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) - FAIL_STACK_ERROR - ran_H5MF_tidy_self_referential_fsm_hack = TRUE; - } - /* Start up H5FD_MEM_SUPER free-space manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, (H5F_mem_page_t)fs_type) < 0) + if(H5MF__open_fstype(f, (H5F_mem_page_t)fs_type) < 0) FAIL_STACK_ERROR /* Get info for H5FD_MEM_SUPER free-space manager */ if(H5FS_stat_info(f, f->shared->fs_man[fs_type], &fs_stat) < 0) FAIL_STACK_ERROR - /* if we ran H5MF_tidy_self_referential_fsm_hack(), the - * H5FD_MEM_SUPER free space manager must be floating. - * Thus fs_stat.addr must be undefined. - */ - if((!ran_H5MF_tidy_self_referential_fsm_hack) && - (!H5F_addr_defined(fs_stat.addr))) + if(!H5F_addr_defined(fs_stat.addr)) TEST_ERROR if(fs_stat.tot_space < TBLOCK_SIZE3) TEST_ERROR - /* Put block #4 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) - FAIL_STACK_ERROR + /* Allocate/free space accordingly so that the free-space manager will go away */ + if(new_format) { + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + FAIL_STACK_ERROR + } else { + if(HADDR_UNDEF == (addrx = H5MF_alloc(f, type, (hsize_t)3))) + FAIL_STACK_ERROR + } /* The H5FD_MEM_SUPER free-space manager will go away at H5MF_close() */ if(H5Fclose(file) < 0) @@ -7063,9 +7048,8 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - /* Verify that the H5FD_MEM_SUPER free-space manager is not there */ if(H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR @@ -7078,18 +7062,18 @@ test_mf_fs_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format) if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support persistent free-space manager"); + HDputs(" Current VFD doesn't support persistent free-space manager"); } return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); H5Pclose(fcpl); H5Pclose(fapl2); } H5E_END_TRY; @@ -7144,7 +7128,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for for(fs_threshold = 0; fs_threshold <= TEST_THRESHOLD10; fs_threshold++) { /* Testing for H5F_FSPACE_STRATEGY_FSM_AGGR and H5F_FSPACE_STRATEGY_PAGE strategies only */ - for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; H5_INC_ENUM(H5F_fspace_strategy_t, fs_type)) { + for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; fs_type++) { if(!contig_addr_vfd && (fs_persist || fs_type == H5F_FSPACE_STRATEGY_PAGE)) continue; @@ -7152,40 +7136,40 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for /* Create file-creation template */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) FAIL_STACK_ERROR - + /* Set default file space information */ if(H5Pset_file_space_strategy(fcpl, fs_type, (hbool_t)fs_persist, fs_threshold) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl2)) < 0) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - + /* Put block #1, #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR @@ -7198,20 +7182,20 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR - H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR if(f->shared->fs_persist) { hssize_t nsects; /* # of free-space sections */ int i; /* local index variable */ H5F_sect_info_t *sect_info; /* array to hold the free-space information */ - + /* Get the # of free-space sections in the file */ if((nsects = H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)0, NULL)) < 0) FAIL_STACK_ERROR @@ -7226,7 +7210,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for sect_info = (H5F_sect_info_t *)HDcalloc((size_t)nsects, sizeof(H5F_sect_info_t)); H5Fget_free_sections(file, H5FD_MEM_DEFAULT, (size_t)nsects, sect_info); - + /* Verify the size of free-space sections */ for(i = 0; i < nsects; i++) if(sect_info[i].size < fs_threshold) @@ -7251,7 +7235,7 @@ test_mf_strat_thres_persist(const char *env_h5_drvr, hid_t fapl, hbool_t new_for if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); @@ -7259,7 +7243,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_persist() */ @@ -7302,7 +7286,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format HDmemset(&fs_state_zero, 0, sizeof(H5FS_stat_t)); /* Copy the file access property list */ - if((fapl2 = H5Pcopy(fapl)) < 0) + if((fapl2 = H5Pcopy(fapl)) < 0) FAIL_STACK_ERROR if(new_format) @@ -7312,7 +7296,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Test with TRUE or FALSE for persisting free-space */ for(fs_persist = FALSE; fs_persist <= TRUE; fs_persist++) { /* Testing for H5F_FSPACE_STRATEGY_FSM_AGGR and H5F_FSPACE_STRATEGY_PAGE strategies only */ - for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; H5_INC_ENUM(H5F_fspace_strategy_t, fs_type)) { + for(fs_type = H5F_FSPACE_STRATEGY_FSM_AGGR; fs_type < H5F_FSPACE_STRATEGY_AGGR; fs_type++) { /* Skip for multi/split driver: persisting free-space or paged aggregation strategy */ if(!contig_addr_vfd && (fs_persist || fs_type == H5F_FSPACE_STRATEGY_PAGE)) @@ -7334,36 +7318,35 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate 6 blocks */ type = H5FD_MEM_SUPER; - if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1))) + if(HADDR_UNDEF == (addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE1))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE2))) + if(HADDR_UNDEF == (addr2 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE2))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3))) + if(HADDR_UNDEF == (addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE3))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4))) + if(HADDR_UNDEF == (addr4 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE4))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5))) + if(HADDR_UNDEF == (addr5 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE5))) FAIL_STACK_ERROR - if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6))) + if(HADDR_UNDEF == (addr6 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE6))) FAIL_STACK_ERROR - H5MF_alloc_to_fs_type(f, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); + H5MF__alloc_to_fs_type(f->shared, type, TBLOCK_SIZE6, (H5F_mem_page_t *)&tt); /* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */ - if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { + if(fs_type == H5F_FSPACE_STRATEGY_PAGE) if(H5FS_stat_info(f, f->shared->fs_man[tt], &fs_state) < 0) FAIL_STACK_ERROR - } /* Put block #3, #5 to H5FD_MEM_SUPER free-space manager */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE3) < 0) + if(H5MF_xfree(f, type, addr3, (hsize_t)TBLOCK_SIZE3) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr5, (hsize_t)TBLOCK_SIZE5) < 0) + if(H5MF_xfree(f, type, addr5, (hsize_t)TBLOCK_SIZE5) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE3 + TBLOCK_SIZE5; @@ -7374,31 +7357,31 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format TEST_ERROR /* section #2 is less than threshold but is merged into section #3 */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE2) < 0) + if(H5MF_xfree(f, type, addr2, (hsize_t)TBLOCK_SIZE2) < 0) FAIL_STACK_ERROR fs_state.tot_space += TBLOCK_SIZE2; if(check_stats(f, f->shared->fs_man[tt], &fs_state)) TEST_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr4, (hsize_t)TBLOCK_SIZE4) < 0) + if(H5MF_xfree(f, type, addr4, (hsize_t)TBLOCK_SIZE4) < 0) FAIL_STACK_ERROR - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr6, (hsize_t)TBLOCK_SIZE6) < 0) + if(H5MF_xfree(f, type, addr6, (hsize_t)TBLOCK_SIZE6) < 0) FAIL_STACK_ERROR /* For paged aggregation, the sections in the page at EOF for small meta fs are merged but are not shrunk away */ if(fs_type == H5F_FSPACE_STRATEGY_PAGE) { fs_state.tot_sect_count = fs_state.serial_sect_count = 1; fs_state.tot_space += (TBLOCK_SIZE4 + TBLOCK_SIZE6); - } + } /* For old format: the sections at EOF are shrunk away */ if(check_stats(f, f->shared->fs_man[tt], (fs_type == H5F_FSPACE_STRATEGY_PAGE) ? &fs_state:&fs_state_zero)) TEST_ERROR /* section #1 is less than threshold but is shrunk away */ - if(H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE1) < 0) + if(H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE1) < 0) FAIL_STACK_ERROR /* For paged aggregation, the section in the page at EOF for small meta fs is not shrunk away */ @@ -7415,9 +7398,9 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format /* Re-open the file */ if((file = H5Fopen(filename, H5F_ACC_RDWR, fapl2)) < 0) FAIL_STACK_ERROR - + /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Free-space manager should be empty */ @@ -7437,7 +7420,7 @@ test_mf_strat_thres_gone(const char *env_h5_drvr, hid_t fapl, hbool_t new_format if(H5Pclose(fapl2) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); @@ -7445,7 +7428,7 @@ error: H5E_BEGIN_TRY { H5Pclose(fcpl); H5Pclose(fapl2); - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_mf_strat_thres_gone() */ @@ -7475,11 +7458,11 @@ error: static unsigned test_dichotomy(hid_t fapl) { - hid_t file = -1; /* File ID */ - char filename[FILENAME_LEN]; /* Filename to use */ - H5F_t *f = NULL; /* Internal file object pointer */ - H5FD_mem_t type, stype; - haddr_t addr1, addr3, saddr1, saddr2; + hid_t file = -1; /* File ID */ + char filename[FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5FD_mem_t type, stype; + haddr_t addr1, addr3, saddr1, saddr2; TESTING("Allocation from raw or metadata free-space manager"); @@ -7491,34 +7474,34 @@ test_dichotomy(hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(file))) + if(NULL == (f = (H5F_t *)H5VL_object(file))) FAIL_STACK_ERROR /* Allocate the first block of type H5FD_MEM_SUPER */ type = H5FD_MEM_SUPER; - addr1 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr1 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_SUPER */ - H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE50); /* Allocate the first block of type H5FD_MEM_DRAW */ stype = H5FD_MEM_DRAW; - saddr1 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Free the first block of type H5FD_MEM_SUPER */ - H5MF_xfree(f, type, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, type, addr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the second block of type H5FD_MEM_DRAW */ - saddr2 = H5MF_alloc(f, stype, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, stype, (hsize_t)TBLOCK_SIZE30); /* Verify that saddr1 is not addr1 */ if(saddr2 == addr1) TEST_ERROR /* Free the first block of type H5FD_MEM_DRAW */ - H5MF_xfree(f, stype, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, stype, saddr1, (hsize_t)TBLOCK_SIZE30); /* Allocate the third block of type H5FD_MEM_SUPER */ - addr3 = H5MF_alloc(f, type, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + addr3 = H5MF_alloc(f, type, (hsize_t)TBLOCK_SIZE30); /* Verify that addr3 is not saddr1 */ if(addr3 == saddr1) TEST_ERROR @@ -7526,13 +7509,13 @@ test_dichotomy(hid_t fapl) if(H5Fclose(file) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); return(0); error: H5E_BEGIN_TRY { - H5Fclose(file); + H5Fclose(file); } H5E_END_TRY; return(1); } /* test_dichotomy() */ @@ -7545,7 +7528,7 @@ error: *------------------------------------------------------------------------- */ static int -set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) +set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) { H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl_arr[H5FD_MEM_NTYPES]; @@ -7554,7 +7537,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) hbool_t relax; H5FD_mem_t mt; - HDassert(multi || split); + HDassert(is_multi_or_split); HDmemset(memb_name, 0, sizeof memb_name); @@ -7562,13 +7545,13 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) if(H5Pget_fapl_multi(fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0) TEST_ERROR - if(split) { + if(is_multi_or_split) { /* Set memb_addr aligned */ memb_addr[H5FD_MEM_SUPER] = ((memb_addr[H5FD_MEM_SUPER] + pagesize - 1) / pagesize) * pagesize; memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize; } else { /* Set memb_addr aligned */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) memb_addr[mt] = ((memb_addr[mt] + pagesize - 1) / pagesize) * pagesize; } /* end else */ @@ -7577,7 +7560,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) TEST_ERROR /* Free memb_name */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) free(memb_name[mt]); return 0; @@ -7607,7 +7590,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) hid_t fcpl = -1; /* File creation property list */ hid_t fapl_new = -1; /* File access property list ID */ H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr2, addr3; /* Addresses for small meta data blocks */ + haddr_t addr2, addr3; /* Addresses for small metadata blocks */ haddr_t saddr1; /* Addresses for small raw data blocks */ haddr_t gaddr1; /* Addresses for large data blocks */ hbool_t split = FALSE, multi = FALSE; @@ -7631,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if((fapl_new = H5Pcopy(fapl)) < 0) TEST_ERROR if(multi || split) - if(set_multi_split(fapl_new, 4096, multi, split) < 0) + if(set_multi_split(fapl_new, 4096, split) < 0) TEST_ERROR; /* Test with TRUE or FALSE for persisting free-space */ @@ -7651,56 +7634,54 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR - - /* Allocate 3 small meta data blocks: addr1, addr2, addr3 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + + /* Allocate 3 small metadata blocks: addr1, addr2, addr3 */ + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE1034); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE1034); if(!fs_persist) { + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); - H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, TBLOCK_SIZE1034, (H5F_mem_page_t *)&fs_type); - - /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) + /* Verify that the freed block with addr2 is found from the small metadata manager */ + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE1034, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != addr2) TEST_ERROR } /* end if */ /* Allocate 2 small raw data blocks: saddr1, saddr2 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE1034); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE1034); /* Free the block with saddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); if(!fs_persist) { /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR } /* end if */ /* Allocate 2 large data blocks: gaddr1, gaddr2 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Free the block with gaddr1 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(!fs_persist) { - - H5MF_alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR @@ -7718,38 +7699,28 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Re-open the file */ if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl_new)) < 0) TEST_ERROR - + /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR /* Verify that the large generic manager is there */ - H5MF_alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR - /* Verify that the small meta data manager is there */ - H5MF_alloc_to_fs_type(f, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type); + /* Verify that the small metadata manager is there */ + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_OHDR, f->shared->fs_page_size - 1, (H5F_mem_page_t *)&fs_type); if(!H5F_addr_defined(f->shared->fs_addr[fs_type])) TEST_ERROR - /* Since we are about to open a self referential free space - * manager prior to the first file space allocation / deallocation - * call H5MF_tidy_self_referential_fsm_hack() first so as to avoid - * assertion failures on the first file space alloc / dealloc. - */ - if(f->shared->first_alloc_dealloc){ - if(SUCCEED!=H5MF_tidy_self_referential_fsm_hack(f,H5AC_ind_read_dxpl_id)) - FAIL_STACK_ERROR - } - - /* Set up to use the small meta data manager */ + /* Set up to use the small metadata manager */ if(!(f->shared->fs_man[fs_type])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR - /* Verify that the freed block with addr2 is found from the small meta data manager */ - if(H5MF_find_sect(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) + /* Verify that the freed block with addr2 is found from the small metadata manager */ + if(H5MF__find_sect(f, H5FD_MEM_OHDR, (hsize_t)(f->shared->fs_page_size-(addr3+TBLOCK_SIZE50)), f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != (addr3+TBLOCK_SIZE50)) @@ -7758,31 +7729,31 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) /* Verify that the small raw data manager is there */ if(!H5F_addr_defined(f->shared->fs_addr[H5F_MEM_PAGE_DRAW])) TEST_ERROR - + /* Set up to use the small raw data manager */ if(!(f->shared->fs_man[H5F_MEM_PAGE_DRAW])) - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, H5F_MEM_PAGE_DRAW) < 0) + if(H5MF__open_fstype(f, H5F_MEM_PAGE_DRAW) < 0) TEST_ERROR /* Verify that the freed block with saddr1 is found from the small raw data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30, f->shared->fs_man[H5F_MEM_PAGE_DRAW], &found_addr) < 0) TEST_ERROR if(found_addr != saddr1) TEST_ERROR - H5MF_alloc_to_fs_type(f, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); + H5MF__alloc_to_fs_type(f->shared, H5FD_MEM_DRAW, TBLOCK_SIZE5000, (H5F_mem_page_t *)&fs_type); if(!(f->shared->fs_man[fs_type])) /* Set up to use the large data manager */ - if(H5MF_open_fstype(f, H5AC_ind_read_dxpl_id, fs_type) < 0) + if(H5MF__open_fstype(f, fs_type) < 0) TEST_ERROR /* Verify that the freed block with gaddr1 is found from the large data manager */ - if(H5MF_find_sect(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) + if(H5MF__find_sect(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8192, f->shared->fs_man[fs_type], &found_addr) < 0) TEST_ERROR if(found_addr != gaddr1) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) TEST_ERROR @@ -7792,11 +7763,11 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fapl_new) < 0) TEST_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -7831,7 +7802,7 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) hid_t fid = -1; /* File ID */ hid_t fcpl = -1; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr1; /* Address for small meta data block */ + haddr_t addr1; /* Address for small metadata block */ haddr_t saddr1; /* Address for small raw data block */ haddr_t gaddr1; /* Address for large data block */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ @@ -7862,44 +7833,44 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR - /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + /* Allocate a small metadata block with addr1 */ + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with addr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR - /* Couldn't shrink due to the section (remaining space in the page) is in the small meta data free-space manager */ + /* Couldn't shrink due to the section (remaining space in the page) is in the small metadata free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Try to shrink the block with saddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the small raw data free-space manager */ if(status == TRUE) TEST_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Try to shrink the block with gaddr1 */ - if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) + if((status = H5MF_try_shrink(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE5000)) < 0) FAIL_STACK_ERROR /* Couldn't shrink due to the section (remaining space in the page) is in the large-sized free-space manager */ if(status == TRUE) TEST_ERROR /* Free the block with saddr1--merge to become 1 page, then return to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE50); /* Merge all 3 sections and shrunk */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_OHDR, gaddr1, (hsize_t)TBLOCK_SIZE5000); if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -7916,11 +7887,11 @@ test_page_try_shrink(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -7954,7 +7925,7 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) hid_t fid = -1; /* File ID */ hid_t fcpl = -1; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr1, addr2, addr3; /* Addresses for small meta data blocks */ + haddr_t addr1, addr2, addr3; /* Addresses for small metadata blocks */ haddr_t saddr1; /* Address for small raw data block */ hbool_t contig_addr_vfd; /* Whether VFD used has a contigous address space */ htri_t was_extended; /* Whether the block can be extended or not */ @@ -7983,20 +7954,20 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR - /* Allocate a small meta data block with addr1 */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE98); + /* Allocate a small metadata block with addr1 */ + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE98); /* Try extending the block with addr1 at EOF not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE98, (hsize_t)3100); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR - /* Allocate 2 small meta data blocks with addr2 and addr3--will be on another meta data page */ - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE150); + /* Allocate 2 small metadata blocks with addr2 and addr3--will be on another metadata page */ + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE100); + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE150); /* The block with addr2 should be page aligned */ /* The block with addr3 resides right next to the block with addr2 */ @@ -8006,60 +7977,60 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the block with addr2 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr2, (hsize_t)TBLOCK_SIZE100); + H5MF_xfree(f, H5FD_MEM_OHDR, addr2, (hsize_t)TBLOCK_SIZE100); /* Try extending the block with addr1 that will cross to the next page where the freed block with addr2 resides */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE100); /* Shouldn't succeed--should not cross page boundary */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with addr1 into the free-space section that is big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3198, (hsize_t)TBLOCK_SIZE50); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR - + /* Free the block with addr1 */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr1, (hsize_t)TBLOCK_SIZE3248); + H5MF_xfree(f, H5FD_MEM_OHDR, addr1, (hsize_t)TBLOCK_SIZE3248); - /* Allocate a new meta data block with addr1 */ + /* Allocate a new metadata block with addr1 */ /* There is a page end threshold of size H5F_FILE_SPACE_PGEND_META_THRES at the end of the block */ - /* The block is right next to the threshold */ - addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3286); + /* The block is right next to the threshold */ + addr1 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3286); /* Try extending the block into the threshold with size > H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block into the threshold with size < H5F_FILE_SPACE_PGEND_META_THRES */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); + was_extended = H5MF_try_extend(f, H5FD_MEM_OHDR, (haddr_t)addr1, (hsize_t)TBLOCK_SIZE3286, (hsize_t)TBLOCK_SIZE2); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Free the block with addr3--will merge with the remaining sections to become a page and then free the page */ - H5MF_xfree(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, addr3, (hsize_t)TBLOCK_SIZE150); + H5MF_xfree(f, H5FD_MEM_OHDR, addr3, (hsize_t)TBLOCK_SIZE150); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4086); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE4086); /* Try extending the block crossing the page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE11); /* Shouldn't succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block not crossing page boundary */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4086, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* The extended block is now "large" in size */ /* Try extending the block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4096, (hsize_t)TBLOCK_SIZE10); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Try extending the large-sized block */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)saddr1, (hsize_t)TBLOCK_SIZE4106, (hsize_t)TBLOCK_SIZE5000); /* Should not succeed because the mis-aligned fragment in the page is in the large-sized free-space manager */ if(was_extended == TRUE) TEST_ERROR @@ -8071,11 +8042,11 @@ test_page_small_try_extend(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation"); + HDputs(" Current VFD doesn't support paged aggregation"); } return(0); @@ -8137,70 +8108,70 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* Allocate a large data block with gaddr1 */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Extending the block with gaddr1 at EOF to become 2 pages */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE6000, (hsize_t)TBLOCK_SIZE2192); /* Should succeed */ if(was_extended != TRUE) TEST_ERROR /* Allocate a large data block with gaddr2 */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr1 */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr1, (hsize_t)TBLOCK_SIZE8192, (hsize_t)TBLOCK_SIZE50); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr3 */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr3 % TBLOCK_SIZE4096) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8000, (hsize_t)TBLOCK_SIZE100); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2--there is no free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE100); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Try extending the block with gaddr2--there is a free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8100, (hsize_t)TBLOCK_SIZE90); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR /* Try extending the block with gaddr2 */ - /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + /* There is no free-space section big enough to fulfill the request (request is < H5F_FILE_SPACE_PGEND_META_THRES) */ + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should not succeed */ if(was_extended == TRUE) TEST_ERROR /* Allocate a large data block with gaddr4 */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) TEST_ERROR /* Free the block with gaddr3--will merge with remaining free space to become 2 pages + section (size 2) in previous page */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr3, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr3, (hsize_t)TBLOCK_SIZE8000); /* Try extending the block with gaddr2 crossing page boundary--there is free-space section big enough to fulfill the request */ - was_extended = H5MF_try_extend(f, H5AC_ind_read_dxpl_id, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); + was_extended = H5MF_try_extend(f, H5FD_MEM_DRAW, (haddr_t)gaddr2, (hsize_t)TBLOCK_SIZE8190, (hsize_t)TBLOCK_SIZE5); /* Should succeed */ if(was_extended == FALSE) TEST_ERROR @@ -8212,11 +8183,11 @@ test_page_large_try_extend(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8273,18 +8244,18 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Set the strategy to paged aggregation */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) FAIL_STACK_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* Allocate a large data block with gaddr1 */ /* 1 page + 1904 bytes; 2192 bytes in free-space manager */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE6000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE6000); /* Should be page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8292,20 +8263,20 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr2--should be on another page */ /* Allocate 1 page + 3904 bytes; 192 bytes in free-space manager */ - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be page aligned */ if(gaddr2 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a large data block with gaddr3--should be on another page */ /* Allocate 2 pages + 3808 bytes; 288 bytes in free-space manager */ - gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE12000); + gaddr3 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE12000); if(!H5F_addr_defined(gaddr3)) TEST_ERROR /* Free the block with gaddr2 */ /* Merged sections: 2192 + 8000 + 192 = 10384 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr2, (hsize_t)TBLOCK_SIZE8000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr2, (hsize_t)TBLOCK_SIZE8000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8319,7 +8290,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) /* Allocate a large data block with gaddr4--there is a free-space section able to fulfill the request */ /* Free-space sections: 2192 + 3192 + 288 = 5672 bytes */ - gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr4 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be page aligned */ if(gaddr4 % TBLOCK_SIZE4096) @@ -8337,8 +8308,8 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Free the two blocks with gaddr1 and gaddr4 */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr1, (hsize_t)TBLOCK_SIZE6000); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, gaddr4, (hsize_t)TBLOCK_SIZE5000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr1, (hsize_t)TBLOCK_SIZE6000); + H5MF_xfree(f, H5FD_MEM_DRAW, gaddr4, (hsize_t)TBLOCK_SIZE5000); /* Get free-space info */ if(H5FS_stat_info(f, f->shared->fs_man[H5F_MEM_PAGE_GENERIC], &fs_stat) < 0) @@ -8348,7 +8319,7 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) TEST_ERROR if(fs_stat.tot_space != (16384+288)) TEST_ERROR - + /* Close file */ if(H5Fclose(fid) < 0) FAIL_STACK_ERROR @@ -8365,11 +8336,11 @@ test_page_large(const char *env_h5_drvr, hid_t fapl) if(file_size % TBLOCK_SIZE4096) TEST_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8402,7 +8373,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) hid_t fcpl = -1; /* File creation property list */ H5F_t *f = NULL; /* Internal file object pointer */ haddr_t addr2, addr3, addr4, addr5; /* Addresses for blocks */ - haddr_t addr9, addr10, addr11; /* Address for small meta data blocks */ + haddr_t addr9, addr10, addr11; /* Address for small metadata blocks */ haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */ H5FS_stat_t fs_stat; /* Information for free-space manager */ char filename[FILENAME_LEN]; /* Filename to use */ @@ -8416,7 +8387,7 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) multi = TRUE; else if(!HDstrcmp(env_h5_drvr, "family")) family = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8435,21 +8406,21 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR - /* Allocate 2 small meta data blocks: addr1, addr2 */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + /* Allocate 2 small metadata blocks: addr1, addr2 */ + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); /* Allocate a small raw data block with saddr1 */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); /* Should be on the second page and page aligned */ if(saddr1 % TBLOCK_SIZE4096) TEST_ERROR /* Allocate a small raw data block with saddr2 */ - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should not be page aligned */ if(!(saddr2 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8457,14 +8428,14 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) if(saddr2 != (saddr1 + TBLOCK_SIZE30)) TEST_ERROR - /* Allocate a small meta data block with addr3--there is no free-space section big enough to fulfill the request */ - addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE4020); + /* Allocate a small metadata block with addr3--there is no free-space section big enough to fulfill the request */ + addr3 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE4020); /* Should be on the third page and page aligned */ if(addr3 % TBLOCK_SIZE4096) TEST_ERROR - /* Allocate a small meta data block with addr4--there is a free-space section big enough to fulfill the request */ - addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + /* Allocate a small metadata block with addr4--there is a free-space section big enough to fulfill the request */ + addr4 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Should not be page aligned */ if(!(addr4 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8472,8 +8443,8 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) if(addr4 != (addr2 + TBLOCK_SIZE50)) TEST_ERROR - /* Allocate a small meta data block with addr5--there is a free-space section big enough to fulfill the request */ - addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE40); + /* Allocate a small metadata block with addr5--there is a free-space section big enough to fulfill the request */ + addr5 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE40); /* Should not be page aligned */ if(!(addr5 % TBLOCK_SIZE4096)) TEST_ERROR @@ -8482,22 +8453,22 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) if(addr5 != (addr3 + TBLOCK_SIZE4020)) TEST_ERROR - /* Allocate a small meta data block with addr6--taking up the remaining space in the first page */ + /* Allocate a small metadata block with addr6--taking up the remaining space in the first page */ if(family) - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3080); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3080); else - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3088); + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3088); - /* Allocate a small meta data block with addr7--taking up the remaining space in the third page */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE36); + /* Allocate a small metadata block with addr7--taking up the remaining space in the third page */ + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE36); - /* Allocate 2 small meta data blocks: addr8, addr9--there is no free-space to fulfill the request */ - H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); - addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + /* Allocate 2 small metadata blocks: addr8, addr9--there is no free-space to fulfill the request */ + H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE50); + addr9 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* Free the block with saddr1 and saddr2--merge with remaining section to become a page which will be returned to the large manager */ - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr1, (hsize_t)TBLOCK_SIZE30); - H5MF_xfree(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, saddr2, (hsize_t)TBLOCK_SIZE50); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr1, (hsize_t)TBLOCK_SIZE30); + H5MF_xfree(f, H5FD_MEM_DRAW, saddr2, (hsize_t)TBLOCK_SIZE50); /* Verify that the large manager does contain a section with file space page size (default is 4096) */ if(!f->shared->fs_man[H5F_MEM_PAGE_GENERIC]) @@ -8507,15 +8478,15 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) if(fs_stat.tot_space != TBLOCK_SIZE4096) TEST_ERROR - /* Allocate a small meta data block with addr10--there is a free-space section big enough to fulfill the request */ - addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE3900); + /* Allocate a small metadata block with addr10--there is a free-space section big enough to fulfill the request */ + addr10 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE3900); /* The block should be next to the block with addr9 */ if(addr10 != (addr9 + TBLOCK_SIZE80)) TEST_ERROR - /* Allocate a small meta data block with addr11 */ + /* Allocate a small metadata block with addr11 */ /* The current free-space section is unable to fulfill the request; obtain a page from the large manager */ - addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); + addr11 = H5MF_alloc(f, H5FD_MEM_OHDR, (hsize_t)TBLOCK_SIZE80); /* The address of the block should be the same the freed block with saddr1 */ if(addr11 != saddr1) TEST_ERROR @@ -8528,11 +8499,11 @@ test_page_small(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fcpl) < 0) FAIL_STACK_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support paged aggregation strategy"); + HDputs(" Current VFD doesn't support paged aggregation strategy"); } return(0); @@ -8550,7 +8521,7 @@ error: * Function: test_page_alignment * * Purpose: To verify the proper alignment is used when H5Pset_alignment() - * is set and paged aggregation is enabled. + * is set and paged aggregation is enabled. * * Return: Success: 0 * Failure: number of errors @@ -8568,7 +8539,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) hid_t fcpl2 = -1; /* File creation property list ID */ hid_t fapl_new = -1; /* File access property list ID */ H5F_t *f = NULL; /* Internal file object pointer */ - haddr_t addr1, addr2; /* Addresses for small meta data blocks */ + haddr_t addr1, addr2; /* Addresses for small metadata blocks */ haddr_t saddr1, saddr2; /* Addresses for small raw data blocks */ haddr_t gaddr1, gaddr2; /* Addresses for blocks */ char filename[FILENAME_LEN]; /* Filename to use */ @@ -8581,7 +8552,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) split = TRUE; else if(!HDstrcmp(env_h5_drvr, "multi")) multi = TRUE; - + if(!multi && !split) { /* Set the filename to use for this test (dependent on fapl) */ @@ -8645,7 +8616,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Populate memb_fapl_arr */ /* Set memb_addr aligned */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) { + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl_arr[mt] = memb_fapl; memb_addr[mt] = ((memb_addr[mt] + TBLOCK_SIZE4096 - 1) / TBLOCK_SIZE4096) * TBLOCK_SIZE4096; } @@ -8657,7 +8628,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) } /* end else */ /* Free memb_name */ - for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, mt)) + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) free(memb_name[mt]); /* Close memb_fapl */ @@ -8673,18 +8644,18 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* The alignment to use will be the library's default file space page size */ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) TEST_ERROR - + /* Create the file to work on */ if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl_new)) < 0) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be on the second page and page aligned on 4096 (default file space page size) */ if(saddr1 % TBLOCK_SIZE4096) @@ -8695,8 +8666,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 large raw data blocks */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); - gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE8000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); + gaddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE8000); /* Should be on the 3rd page and page aligned */ if(gaddr1 % TBLOCK_SIZE4096) @@ -8714,7 +8685,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 2: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8722,7 +8693,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) /* Disable small data block mechanism */ if(H5Pset_small_data_block_size(fapl_new, (hsize_t)0) < 0) TEST_ERROR - /* Disable meta data block mechanism */ + /* Disable metadata block mechanism */ if(H5Pset_meta_block_size(fapl_new, (hsize_t)0) < 0) TEST_ERROR @@ -8731,12 +8702,12 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR - /* Allocate 2 small meta data blocks */ - addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + /* Allocate 2 small metadata blocks */ + addr1 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE30); + addr2 = H5MF_alloc(f, H5FD_MEM_SUPER, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(addr1 % TEST_ALIGN16 || addr2 % TEST_ALIGN16) @@ -8748,8 +8719,8 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE80); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE100); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE80); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE100); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16 || saddr2 % TEST_ALIGN16) @@ -8771,7 +8742,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Fclose(fid) < 0) TEST_ERROR - /* + /* * Case 3: Verify that the alignment in use is the alignment set * via H5Pset_alignment when paged aggregation not enabled. */ @@ -8792,12 +8763,12 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) TEST_ERROR - + /* Allocate 2 small raw data blocks */ - saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE30); - saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE50); + saddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE30); + saddr2 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE50); /* Should be aligned on 16 */ if(saddr1 % TEST_ALIGN16) @@ -8811,7 +8782,7 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) TEST_ERROR /* Allocate a large raw data block */ - gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, H5AC_ind_read_dxpl_id, (hsize_t)TBLOCK_SIZE5000); + gaddr1 = H5MF_alloc(f, H5FD_MEM_DRAW, (hsize_t)TBLOCK_SIZE5000); /* Should be aligned on 16 */ if(gaddr1 % TEST_ALIGN16) @@ -8834,11 +8805,11 @@ test_page_alignment(const char *env_h5_drvr, hid_t fapl) if(H5Pclose(fapl_new) < 0) TEST_ERROR - PASSED() + PASSED(); } else { SKIPPED(); - puts(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); + HDputs(" Current VFD doesn't support persisting free-space or paged aggregation strategy"); } return(0); @@ -8856,11 +8827,12 @@ error: int main(void) { - hid_t fapl = -1; /* File access property list for data files */ - hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ + hid_t fapl = -1; /* File access property list for data files */ + hid_t new_fapl = -1; /* File access property list for alignment & aggr setting */ unsigned nerrors = 0; /* Cumulative error count */ - test_type_t curr_test; /* Current test being worked on */ + test_type_t curr_test; /* Current test being worked on */ const char *env_h5_drvr; /* File Driver value from environment */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ /* Get the VFD to use */ env_h5_drvr = HDgetenv("HDF5_DRIVER"); @@ -8871,6 +8843,10 @@ main(void) fapl = h5_fileaccess(); + /* Push API context */ + if(H5CX_push() < 0) FAIL_STACK_ERROR + api_ctx_pushed = TRUE; + /* Make a copy of the FAPL before adjusting the alignment */ if((new_fapl = H5Pcopy(fapl)) < 0) TEST_ERROR /* For old library format--interaction with file allocation */ @@ -8899,7 +8875,7 @@ main(void) nerrors += test_mf_aggr_absorb(env_h5_drvr, fapl); /* For old library format--tests for alignment */ - for(curr_test = TEST_NORMAL; curr_test < TEST_NTESTS; H5_INC_ENUM(test_type_t, curr_test)) { + for(curr_test = TEST_NORMAL; curr_test < TEST_NTESTS; curr_test++) { switch(curr_test) { case TEST_NORMAL: /* set alignment = 1024 */ @@ -8956,7 +8932,7 @@ main(void) nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, FALSE); nerrors += test_mf_strat_thres_persist(env_h5_drvr, fapl, TRUE); - /* Temporary skipped for multi/split drivers: + /* Temporary skipped for multi/split drivers: fail file create when persisting free-space or using paged aggregation strategy */ #ifdef PB_OUT /* Tests specific for multi and split files--persisting free-space */ @@ -8964,7 +8940,7 @@ main(void) nerrors += test_mf_fs_persist_multi(); #endif - /* + /* * Tests specific for file space paging */ /* Temporary: The following 7 tests are modified to skip testing for multi/split driver: @@ -8984,18 +8960,25 @@ main(void) FAIL_STACK_ERROR h5_cleanup(FILENAME, fapl); + /* Pop API context */ + if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + api_ctx_pushed = FALSE; + if(nerrors) goto error; - puts("All free-space manager tests for file memory passed."); + HDputs("All free-space manager tests for file memory passed."); return(0); error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(new_fapl); } H5E_END_TRY; + + if(api_ctx_pushed) H5CX_pop(); + return(1); } /* main() */ |