From 924440b4f9437f57a0df1f6c0afd794978b31715 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Tue, 16 Sep 2014 16:42:26 -0500 Subject: [svn-r25594] - add mem_type in get_eof for multi vfd like drivers. - update v2 sb format to store an eof for every mem type (to handle multi like vfds). - still needs more testing. --- src/H5F.c | 3 +- src/H5FD.c | 9 +-- src/H5FDcore.c | 4 +- src/H5FDdirect.c | 4 +- src/H5FDfamily.c | 8 +-- src/H5FDint.c | 7 +- src/H5FDlog.c | 4 +- src/H5FDmpio.c | 4 +- src/H5FDmulti.c | 74 +++++++++++--------- src/H5FDprivate.h | 2 +- src/H5FDpublic.h | 11 ++- src/H5FDsec2.c | 4 +- src/H5FDstdio.c | 4 +- src/H5Fint.c | 40 +++++++++-- src/H5Fpkg.h | 3 +- src/H5Fsuper.c | 65 ------------------ src/H5Fsuper_cache.c | 182 ++++++++++++++++++++++++++++++++++++++++++++------ test/truncation.c | 6 +- testpar/t_file.c | 4 +- tools/misc/h5extend.c | 2 +- 20 files changed, 278 insertions(+), 162 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index b7d1109..6d2baae 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -975,7 +975,8 @@ H5Fget_filesize(hid_t file_id, hsize_t *size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") /* Go get the actual file size */ - if(HADDR_UNDEF == (eof = MAX(H5FD_get_eof(file->shared->lf), H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT)))) + if(HADDR_UNDEF == (eof = MAX(H5FD_get_eof(file->shared->lf, H5FD_MEM_DEFAULT), + H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT)))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "file get eof request failed") base_addr = H5FD_get_base_addr(file->shared->lf); diff --git a/src/H5FD.c b/src/H5FD.c index 55f20f1..ef0efbd 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -1521,7 +1521,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FDget_eof(H5FD_t *file) +H5FDget_eof(H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; @@ -1533,12 +1533,9 @@ H5FDget_eof(H5FD_t *file) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer") /* The real work */ - if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file))) + if(HADDR_UNDEF == (ret_value = H5FD_get_eof(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") - /* - if(HADDR_UNDEF == (ret_value = MAX(H5FD_get_eof(file), H5FD_get_eoa(file, H5FD_MEM_SUPER)))) - HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "file get eof request failed") - */ + /* (Note compensating for base address subtraction in internal routine) */ ret_value += file->base_addr; done: diff --git a/src/H5FDcore.c b/src/H5FDcore.c index f0d3d92..b510d56 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -138,7 +138,7 @@ static int H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_core_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_core_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_core_get_eof(const H5FD_t *_file); +static haddr_t H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_core_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -1127,7 +1127,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eof(const H5FD_t *_file) +H5FD_core_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_core_t *file = (const H5FD_core_t*)_file; diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index b3d5338..66d9a0b 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -137,7 +137,7 @@ static int H5FD_direct_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_direct_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_direct_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_direct_get_eof(const H5FD_t *_file); +static haddr_t H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_direct_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_direct_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -811,7 +811,7 @@ H5FD_direct_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_direct_get_eof(const H5FD_t *_file) +H5FD_direct_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_direct_t *file = (const H5FD_direct_t*)_file; diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 1ae0baf..72e02b9 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -99,7 +99,7 @@ static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_family_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_family_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_family_get_eof(const H5FD_t *_file); +static haddr_t H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *_buf/*out*/); @@ -758,7 +758,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, * smaller than the size specified through H5Pset_fapl_family(). Update the actual * member size. */ - if ((eof=H5FDget_eof(file->memb[0]))) file->memb_size = eof; + if ((eof=H5FDget_eof(file->memb[0], H5FD_MEM_DEFAULT))) file->memb_size = eof; ret_value=(H5FD_t *)file; @@ -1048,7 +1048,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_family_get_eof(const H5FD_t *_file) +H5FD_family_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_family_t *file = (const H5FD_family_t*)_file; haddr_t eof=0; @@ -1064,7 +1064,7 @@ H5FD_family_get_eof(const H5FD_t *_file) */ HDassert(file->nmembs > 0); for(i = (int)file->nmembs - 1; i >= 0; --i) { - if((eof = H5FD_get_eof(file->memb[i])) != 0) + if((eof = H5FD_get_eof(file->memb[i], type)) != 0) break; if(0 == i) break; diff --git a/src/H5FDint.c b/src/H5FDint.c index 9f02a25..d07a6d3 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -128,7 +128,8 @@ H5FD_locate_signature(H5FD_t *file, const H5P_genplist_t *dxpl, haddr_t *sig_add FUNC_ENTER_NOAPI_NOINIT /* Find the least N such that 2^N is larger than the file size */ - if(HADDR_UNDEF == (addr = H5FD_get_eof(file)) || HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER))) + if(HADDR_UNDEF == (addr = MAX(H5FD_get_eof(file, H5FD_MEM_SUPER),H5FD_get_eoa(file,H5FD_MEM_SUPER))) || + HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER))) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to obtain EOF/EOA value") for(maxpow = 0; addr; maxpow++) addr >>= 1; @@ -348,7 +349,7 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5FD_get_eof(const H5FD_t *file) +H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type) { haddr_t ret_value; @@ -358,7 +359,7 @@ H5FD_get_eof(const H5FD_t *file) /* Dispatch to driver */ if(file->cls->get_eof) { - if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file))) + if(HADDR_UNDEF == (ret_value = (file->cls->get_eof)(file, type))) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, HADDR_UNDEF, "driver get_eof request failed") } /* end if */ else diff --git a/src/H5FDlog.c b/src/H5FDlog.c index fde6dab..99c6739 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -177,7 +177,7 @@ static herr_t H5FD_log_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static haddr_t H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_log_get_eof(const H5FD_t *_file); +static haddr_t H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -1062,7 +1062,7 @@ H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_log_get_eof(const H5FD_t *_file) +H5FD_log_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_log_t *file = (const H5FD_log_t *)_file; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index abfc408..5a8799d 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -85,7 +85,7 @@ static herr_t H5FD_mpio_close(H5FD_t *_file); static herr_t H5FD_mpio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_mpio_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file); +static haddr_t H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_mpio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf); @@ -1336,7 +1336,7 @@ H5FD_mpio_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_mpio_get_eof(const H5FD_t *_file) +H5FD_mpio_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_mpio_t *file = (const H5FD_mpio_t*)_file; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 3924afc..5dbb632 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -135,7 +135,7 @@ static herr_t H5FD_multi_query(const H5FD_t *_f1, unsigned long *flags); static herr_t H5FD_multi_get_type_map(const H5FD_t *file, H5FD_mem_t *type_map); static haddr_t H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa); -static haddr_t H5FD_multi_get_eof(const H5FD_t *_file); +static haddr_t H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static haddr_t H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, @@ -1256,6 +1256,7 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */) *flags = 0; *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_MULTIPLE_MEM_TYPE_BACKENDS; /* need to query every MEM tyoe backend */ } /* end if */ return(0); @@ -1376,7 +1377,6 @@ H5FD_multi_get_eoa(const H5FD_t *_file, H5FD_mem_t type) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eoa", HADDR_UNDEF) } } - return eoa; } /* end H5FD_multi_get_eoa() */ @@ -1472,53 +1472,61 @@ H5FD_multi_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t eoa) *------------------------------------------------------------------------- */ static haddr_t -H5FD_multi_get_eof(const H5FD_t *_file) +H5FD_multi_get_eof(const H5FD_t *_file, H5FD_mem_t type) { const H5FD_multi_t *file = (const H5FD_multi_t*)_file; haddr_t eof=0, tmp_eof; - haddr_t eoa=0, tmp_eoa; static const char *func="H5FD_multi_get_eof"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - UNIQUE_MEMBERS(file->fa.memb_map, mt) { - if (file->memb[mt]) { - /* Retrieve EOF */ - H5E_BEGIN_TRY { - tmp_eof = H5FDget_eof(file->memb[mt]); - } H5E_END_TRY; - - if (HADDR_UNDEF==tmp_eof) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) - if (tmp_eof>0) tmp_eof += file->fa.memb_addr[mt]; + if(H5FD_MEM_DEFAULT == type) { + UNIQUE_MEMBERS(file->fa.memb_map, mt) { + if (file->memb[mt]) { + /* Retrieve EOF */ + H5E_BEGIN_TRY { + tmp_eof = H5FDget_eof(file->memb[mt], type); + } H5E_END_TRY; + + if (HADDR_UNDEF==tmp_eof) + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) + if (tmp_eof>0) tmp_eof += file->fa.memb_addr[mt]; + } else if (file->fa.relax) { + /* + * The member is not open yet (maybe it doesn't exist). Make the + * best guess about the end-of-file. + */ + tmp_eof = file->memb_next[mt]; + assert(HADDR_UNDEF!=tmp_eof); + } else { + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) + } + if (tmp_eof>eof) eof = tmp_eof; + } END_MEMBERS; + } else { + H5FD_mem_t mmt = file->fa.memb_map[type]; + if (H5FD_MEM_DEFAULT==mmt) mmt = type; - /* Retrieve EOA */ - H5E_BEGIN_TRY { - tmp_eoa = H5FDget_eoa(file->memb[mt], mt); - } H5E_END_TRY; + if (file->memb[mmt]) { + H5E_BEGIN_TRY { + eof = H5FDget_eof(file->memb[mmt], mmt); + } H5E_END_TRY; - if (HADDR_UNDEF==tmp_eoa) - H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eoa", HADDR_UNDEF) - if (tmp_eoa>0) tmp_eoa += file->fa.memb_addr[mt]; + if (HADDR_UNDEF==eof) + H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) + if (eof>0) eof += file->fa.memb_addr[mmt]; } else if (file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the * best guess about the end-of-file. */ - tmp_eof = file->memb_next[mt]; - assert(HADDR_UNDEF!=tmp_eof); - - tmp_eoa = file->memb_next[mt]; - assert(HADDR_UNDEF!=tmp_eoa); - } else { + eof = file->memb_next[mmt]; + assert(HADDR_UNDEF!=eof); + } else { H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) - } - - if (tmp_eof>eof) eof = tmp_eof; - if (tmp_eoa>eoa) eoa = tmp_eoa; - } END_MEMBERS; - + } + } return eof; } diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index d2e05ce..48fc779 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -130,7 +130,7 @@ H5_DLL htri_t H5FD_try_extend(H5FD_t *file, H5FD_mem_t type, struct H5F_t *f, haddr_t blk_end, hsize_t extra_requested); H5_DLL haddr_t H5FD_get_eoa(const H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FD_set_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t addr); -H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file); +H5_DLL haddr_t H5FD_get_eof(const H5FD_t *file, H5FD_mem_t type); H5_DLL haddr_t H5FD_get_maxaddr(const H5FD_t *file); H5_DLL herr_t H5FD_get_feature_flags(const H5FD_t *file, unsigned long *feature_flags); H5_DLL herr_t H5FD_get_fs_type_map(const H5FD_t *file, H5FD_mem_t *type_map); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index a4138b0..bc6ce0c 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -241,7 +241,12 @@ typedef enum H5FD_coord_t { * image to store in memory. */ #define H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS 0x00000800 - + /* + * Defining the H5FD_FEAT_MULTIPLE_MEM_TYPE_BACKENDS for a VFL driver + * means that the library will needs to query eof/eoa values for every + * MEM type. + */ +#define H5FD_FEAT_MULTIPLE_MEM_TYPE_BACKENDS 0x00001000 /* Forward declaration */ typedef struct H5FD_t H5FD_t; @@ -274,7 +279,7 @@ typedef struct H5FD_class_t { haddr_t addr, hsize_t size); haddr_t (*get_eoa)(const H5FD_t *file, H5FD_mem_t type); herr_t (*set_eoa)(H5FD_t *file, H5FD_mem_t type, haddr_t addr); - haddr_t (*get_eof)(const H5FD_t *file); + haddr_t (*get_eof)(const H5FD_t *file, H5FD_mem_t type); herr_t (*get_handle)(H5FD_t *file, hid_t fapl, void**file_handle); herr_t (*read)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl, haddr_t addr, size_t size, void *buffer); @@ -356,7 +361,7 @@ H5_DLL herr_t H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size); H5_DLL haddr_t H5FDget_eoa(H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FDset_eoa(H5FD_t *file, H5FD_mem_t type, haddr_t eoa); -H5_DLL haddr_t H5FDget_eof(H5FD_t *file); +H5_DLL haddr_t H5FDget_eof(H5FD_t *file, H5FD_mem_t type); H5_DLL herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void**file_handle); H5_DLL herr_t H5FDread(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 1c11236..dd91adf 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -135,7 +135,7 @@ static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_sec2_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file); +static haddr_t H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -622,7 +622,7 @@ H5FD_sec2_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_sec2_get_eof(const H5FD_t *_file) +H5FD_sec2_get_eof(const H5FD_t *_file, H5FD_mem_t UNUSED type) { const H5FD_sec2_t *file = (const H5FD_sec2_t *)_file; diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index eda2ac8..3d31c10 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -185,7 +185,7 @@ static herr_t H5FD_stdio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); static haddr_t H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr); -static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file); +static haddr_t H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t type); static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle); static herr_t H5FD_stdio_read(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf); @@ -720,7 +720,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eof(const H5FD_t *_file) +H5FD_stdio_get_eof(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) { const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; diff --git a/src/H5Fint.c b/src/H5Fint.c index 2e20a86..e079cd2 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -858,14 +858,13 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) if(H5I_dec_ref(f->shared->fcpl_id) < 0) /* Push error, but keep going*/ HDONE_ERROR(H5E_FILE, H5E_CANTDEC, FAIL, "can't close property list") - +#if 0 /* If not avoiding truncation, OR if only avoiding truncation during file extension and a truncation will result in a smaller file, then truncate the file */ if (((!H5F_AVOID_TRUNCATE(f))|| (((H5F_AVOID_TRUNCATE(f)==H5F_AVOID_TRUNCATE_EXTEND)&& - (H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER) < H5FD_get_eof(f->shared->lf))))) -#if 0 + (H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT) < H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))))) || /* Note: Due to some currently unknown (bug? feature?) in the multi driver, we *must* truncate if the EOA = EOF. I do not understand @@ -873,9 +872,10 @@ H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush) This should be resolved before merging to 1.10. In any case, when EOA=EOF, the truncate file driver call shouldn't actually truncate the file since it doesn't need to ... */ - (H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT) == H5FD_get_eof(f->shared->lf)) -#endif + (H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT) == H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT)) ) { +#endif + if(TRUE == H5F__should_truncate(f)) { /* Only truncate the file on an orderly close, with write-access */ if(f->closing && (H5F_ACC_RDWR & H5F_INTENT(f))) { /* Truncate the file to the current allocated size */ @@ -1086,7 +1086,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, * Read or write the file superblock, depending on whether the file is * empty or not. */ - if(0 == (MAX(H5FD_get_eof(lf),H5FD_get_eoa(lf,H5FD_MEM_SUPER))) && (flags & H5F_ACC_RDWR)) { + if(0 == (MAX(H5FD_get_eof(lf,H5FD_MEM_SUPER),H5FD_get_eoa(lf,H5FD_MEM_SUPER))) && (flags & H5F_ACC_RDWR)) { /* * We've just opened a fresh new file (or truncated one). We need * to create & write the superblock. @@ -2079,3 +2079,31 @@ H5F_get_file_image(H5F_t *file, void *buf_ptr, size_t buf_len) done: FUNC_LEAVE_NOAPI(ret_value) } /* H5F_get_file_image() */ + +htri_t +H5F__should_truncate(H5F_t *f) +{ + htri_t ret_value = FALSE; + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + if(H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_OFF) + HGOTO_DONE(TRUE) + else if(H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_EXTEND) { + if(f->shared->feature_flags & H5FD_FEAT_MULTIPLE_MEM_TYPE_BACKENDS) { + H5FD_mem_t mt; + + for(mt = H5FD_MEM_SUPER; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if(H5FD_get_eof(f->shared->lf, mt) > H5FD_get_eoa(f->shared->lf, mt)) + HGOTO_DONE(TRUE) + } + } + else { + if(H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT) > H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)) + HGOTO_DONE(TRUE) + } + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 7bbd4c8..fa286a6 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -110,7 +110,7 @@ + 1 /* consistency flags */ \ + H5F_SIZEOF_ADDR(f) /* base address */ \ + H5F_SIZEOF_ADDR(f) /* superblock extension address */ \ - + H5F_SIZEOF_ADDR(f) /* EOF address */ \ + + H5F_SIZEOF_ADDR(f)*7 /* EOF address */ \ + H5F_SIZEOF_ADDR(f) /* root group object header address */ \ + H5F_SIZEOF_CHKSUM) /* superblock checksum (keep this last) */ #define H5F_SUPERBLOCK_VARLEN_SIZE(v, f) ( \ @@ -299,6 +299,7 @@ herr_t H5F_dest(H5F_t *f, hid_t dxpl_id, hbool_t flush); H5_DLL herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, hbool_t closing); H5_DLL htri_t H5F_is_hdf5(const char *name); H5_DLL herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); +H5_DLL htri_t H5F__should_truncate(H5F_t *f); H5_DLL herr_t H5F_close(H5F_t *f); /* File mount related routines */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index 90dfa7b..45e0ff9 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -100,71 +100,6 @@ H5F_init_super_interface(void) /*------------------------------------------------------------------------- - * Function: H5F_locate_signature - * - * Purpose: Finds the HDF5 superblock signature in a file. The signature - * can appear at address 0, or any power of two beginning with - * 512. - * - * Return: Success: The absolute format address of the signature. - * - * Failure: HADDR_UNDEF - * - * Programmer: Robb Matzke - * Friday, November 7, 1997 - * - *------------------------------------------------------------------------- - */ -haddr_t -H5F_locate_signature(H5FD_t *file, hid_t dxpl_id) -{ - haddr_t addr, eoa; - uint8_t buf[H5F_SIGNATURE_LEN]; - unsigned n, maxpow; - haddr_t ret_value; /* Return value */ - - FUNC_ENTER_NOAPI_NOINIT - - /* Find the least N such that 2^N is larger than the file size */ - if(HADDR_UNDEF == (addr = MAX(H5FD_get_eof(file),H5FD_get_eoa(file,H5FD_MEM_SUPER))) || - HADDR_UNDEF == (eoa = H5FD_get_eoa(file, H5FD_MEM_SUPER))) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to obtain EOF/EOA value") - for(maxpow = 0; addr; maxpow++) - addr >>= 1; - maxpow = MAX(maxpow, 9); - - /* - * Search for the file signature at format address zero followed by - * powers of two larger than 9. - */ - for(n = 8; n < maxpow; n++) { - addr = (8 == n) ? 0 : (haddr_t)1 << n; - if(H5FD_set_eoa(file, H5FD_MEM_SUPER, addr + H5F_SIGNATURE_LEN) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to set EOA value for file signature") - if(H5FD_read(file, dxpl_id, H5FD_MEM_SUPER, addr, (size_t)H5F_SIGNATURE_LEN, buf) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to read file signature") - if(!HDmemcmp(buf, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) - break; - } /* end for */ - - /* - * If the signature was not found then reset the EOA value and return - * failure. - */ - if(n >= maxpow) { - (void)H5FD_set_eoa(file, H5FD_MEM_SUPER, eoa); /* Ignore return value */ - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, HADDR_UNDEF, "unable to find a valid file signature") - } /* end if */ - - /* Set return value */ - ret_value = addr; - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5F_locate_signature() */ - - -/*------------------------------------------------------------------------- * Function: H5F_super_ext_create * * Purpose: Create the superblock extension diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 67b93af..ce6ae66 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -41,7 +41,7 @@ /****************/ /* Maximum size of super-block buffers */ -#define H5F_MAX_SUPERBLOCK_SIZE 134 +#define H5F_MAX_SUPERBLOCK_SIZE 190//134 /******************/ @@ -121,6 +121,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) H5F_file_t *shared; /* shared part of `file' */ H5FD_t *lf; /* file driver part of `shared' */ haddr_t stored_eof; /* stored end-of-file address in file */ + haddr_t types_eof[H5FD_MEM_NTYPES]; /* stored end-of-file address in file for each mem type*/ haddr_t eof; /* end of file address */ uint8_t sizeof_addr; /* Size of offsets in the file (in bytes) */ uint8_t sizeof_size; /* Size of lengths in the file (in bytes) */ @@ -288,7 +289,37 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* Remainder of "variable-sized" portion of superblock */ H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); + +#if 0 + { + char name[50]; + FILE *fd; + H5FD_mem_t mt; + haddr_t temp; + + sprintf(name, "%s.eofs", f->open_name); + fprintf(stderr, "%s\n", name); + fd = fopen(name, "r"); + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + fread(&types_eof[mt], 1, sizeof(haddr_t), fd); + fprintf(stderr, "Decode %llu\n", types_eof[mt]); + } + fclose(fd); + } +#endif + + if(0) { + H5FD_mem_t mt; + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) + H5F_addr_decode(f, (const uint8_t **)&p, &types_eof[mt]/*out*/); + stored_eof = types_eof[H5FD_MEM_SUPER]; + } + else { + H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); + } + H5F_addr_decode(f, (const uint8_t **)&p, &sblock->driver_addr/*out*/); /* Allocate space for the root group symbol table entry */ @@ -420,7 +451,18 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* Base, superblock extension, end of file & root group object header addresses */ H5F_addr_decode(f, (const uint8_t **)&p, &sblock->base_addr/*out*/); H5F_addr_decode(f, (const uint8_t **)&p, &sblock->ext_addr/*out*/); - H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); + + if(1) { + H5FD_mem_t mt; + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) + H5F_addr_decode(f, (const uint8_t **)&p, &types_eof[mt]/*out*/); + stored_eof = types_eof[H5FD_MEM_SUPER]; + } + else { + H5F_addr_decode(f, (const uint8_t **)&p, &stored_eof/*out*/); + } + H5F_addr_decode(f, (const uint8_t **)&p, &sblock->root_addr/*out*/); /* Compute checksum for superblock */ @@ -475,8 +517,9 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) * possible is if the first file of a family of files was opened * individually. */ - if(HADDR_UNDEF == (eof = H5FD_get_eof(lf))) + if(HADDR_UNDEF == (eof = H5FD_get_eof(lf, H5FD_MEM_DEFAULT))) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to determine file size") + /* (Account for the stored EOF being absolute offset -QAK) */ if((eof + sblock->base_addr) < stored_eof) HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, @@ -752,16 +795,53 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, /* Encode the address of global free-space index */ H5F_addr_encode(f, &p, sblock->ext_addr); +#if 0 + { + char name[50]; + FILE *fd; + H5FD_mem_t mt; + haddr_t temp; + + sprintf(name, "%s.eofs", f->open_name); + fprintf(stderr, "%s\n", name); + fd = fopen(name, "w"); + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if ((rel_eof = H5FD_get_eoa(f->shared->lf, mt)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + + + fprintf(stderr, "Encoding %llu\n", temp); + fwrite(&temp, 1, sizeof(haddr_t), fd); + } + fclose(fd); + } +#endif + /* Encode the end-of-file address. Note that at this point in time, * the EOF value itself may not be reflective of the file's size, as * we will eventually truncate the file to match the EOA value. As * such, use the EOA value in its place, knowing that the current EOF * value will ultimately match it. */ - if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + if(0) { + H5FD_mem_t mt; + haddr_t temp; - /* Encode the driver informaton block address */ + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if ((temp = H5FD_get_eoa(f->shared->lf, mt)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + + if(H5FD_MEM_SUPER == mt) + rel_eof = temp + sblock->base_addr; + + H5F_addr_encode(f, &p, temp + sblock->base_addr); + } + } + else { + if ((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + } /* Encode the driver informaton block address */ H5F_addr_encode(f, &p, sblock->driver_addr); @@ -822,9 +902,12 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, /* Encode the end-of-file address if the file will not be truncated at file close */ + if(FALSE == H5F__should_truncate(f)) { + /* if(((H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_ALL)) || ((H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_EXTEND) && - (H5FD_get_eof(f->shared->lf) <= H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)))) { + (H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT) <= H5FD_get_eoa(f->shared->lf, H5FD_MEM_DEFAULT)))) { + */ H5F_io_info_t fio_info; /* I/O info for operation */ haddr_t rel_eoa; @@ -849,21 +932,57 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, if(H5FD_coordinate(f->shared->lf, dxpl_id, H5FD_COORD_EOF) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level coordinate failed") #endif - if(HADDR_UNDEF == (rel_eof = H5FD_get_eof(f->shared->lf))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to determine file size") - if(rel_eof == 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "flushing a superblock to an empty file?!?!") - - if(HADDR_UNDEF == (rel_eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER))) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to determine eoa") /* Check again if truncation will happen after updating the EOF when flushing. */ + /* if((H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_ALL) || (H5F_AVOID_TRUNCATE(f) == H5F_AVOID_TRUNCATE_EXTEND && rel_eof <= rel_eoa)) { - H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + */ + if(FALSE == H5F__should_truncate(f)) { + if(1) { + H5FD_mem_t mt; + haddr_t temp; + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if ((temp = H5FD_get_eof(f->shared->lf, mt)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + + if(H5FD_MEM_SUPER == mt) + rel_eof = temp + sblock->base_addr; + + H5F_addr_encode(f, &p, temp + sblock->base_addr); + } + } + else { + if(HADDR_UNDEF == (rel_eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to determine file size") + if(rel_eof == 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "flushing a superblock to an empty file?!?!") + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + } } else { - H5F_addr_encode(f, &p, (rel_eoa + sblock->base_addr)); + if(1) { + H5FD_mem_t mt; + haddr_t temp; + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if ((temp = H5FD_get_eoa(f->shared->lf, mt)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + + if(H5FD_MEM_SUPER == mt) + rel_eof = temp + sblock->base_addr; + + H5F_addr_encode(f, &p, temp + sblock->base_addr); + } + } + else { + if(HADDR_UNDEF == (rel_eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_SUPER))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to determine file size") + if(rel_eof == 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "flushing a superblock to an empty file?!?!") + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + } } } /* end if */ else { @@ -872,9 +991,25 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, * truncate it to match the EOA value. As such, use the EOA value * in its place, knowing that the current EOF value will * ultimately match it. */ - if((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") - H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + if(1) { + H5FD_mem_t mt; + haddr_t temp; + + for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + if ((temp = H5FD_get_eoa(f->shared->lf, mt)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + + if(H5FD_MEM_SUPER == mt) + rel_eof = temp + sblock->base_addr; + + H5F_addr_encode(f, &p, temp + sblock->base_addr); + } + } + else { + if((rel_eof = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed") + H5F_addr_encode(f, &p, (rel_eof + sblock->base_addr)); + } } /* end else */ /* Retrieve information for root group */ @@ -891,7 +1026,10 @@ H5F_sblock_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t UNUSED addr, UINT32ENCODE(p, chksum); /* Sanity check */ - HDassert((size_t)(p - buf) == (size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f)); + if(1) + HDassert((size_t)(p - buf) == (size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f)); + else + HDassert((size_t)(p - buf)+48 == (size_t)H5F_SUPERBLOCK_SIZE(sblock->super_vers, f)); } /* end else */ /* Retrieve the total size of the superblock info */ diff --git a/test/truncation.c b/test/truncation.c index 1415f49..4e15cf7 100644 --- a/test/truncation.c +++ b/test/truncation.c @@ -470,7 +470,8 @@ hid_t create_test_file_eof_gt_eoa(char * filename, hid_t fcpl, hid_t fapl, haddr /* Determine EOA and EOF values */ if ((*eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) TEST_ERROR; - if ((*eof = H5FD_get_eof(f->shared->lf)) == HADDR_UNDEF) TEST_ERROR; + if ((*eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + TEST_ERROR; /* We want to be creating the case when EOA < EOF at file close */ if (*eoa >= *eof) TEST_ERROR; @@ -525,7 +526,8 @@ hid_t create_test_file_eof_lt_eoa(char * filename, hid_t fcpl, hid_t fapl, haddr /* Determine EOA and EOF values */ if ((*eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) TEST_ERROR; - if ((*eof = H5FD_get_eof(f->shared->lf)) == HADDR_UNDEF) TEST_ERROR; + if ((*eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) + TEST_ERROR; /* We want to be creating the case when EOA > EOF at file close */ if (*eoa <= *eof) TEST_ERROR; diff --git a/testpar/t_file.c b/testpar/t_file.c index d2b0601..6164bd4 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -183,7 +183,7 @@ test_avoid_truncation(void) eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER); VRFY((eoa != HADDR_UNDEF), ""); - eof = H5FD_get_eof(f->shared->lf); + eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_SUPER); VRFY((eof != HADDR_UNDEF), ""); /* Make sure EOA/EOF are not the same */ @@ -219,7 +219,7 @@ test_avoid_truncation(void) eoa = H5FD_get_eoa(f->shared->lf, H5FD_MEM_SUPER); VRFY((eoa != HADDR_UNDEF), ""); - eof = H5FD_get_eof(f->shared->lf); + eof = H5FD_get_eof(f->shared->lf, H5FD_MEM_SUPER); VRFY((eof != HADDR_UNDEF), ""); /* Make sure values are not equal */ diff --git a/tools/misc/h5extend.c b/tools/misc/h5extend.c index b5ab43f..005412b 100644 --- a/tools/misc/h5extend.c +++ b/tools/misc/h5extend.c @@ -217,7 +217,7 @@ main (int argc, char *argv[]) } /* end if */ /* Get 'EOF' value */ - if ((eof = H5FDget_eof(f->shared->lf)) == HADDR_UNDEF) { + if ((eof = H5FDget_eof(f->shared->lf, H5FD_MEM_SUPER)) == HADDR_UNDEF) { error_msg("Unable to retrieve 'EOF' value from file driver.\n"); leave(EXIT_FAILURE); } /* end if */ -- cgit v0.12