diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-08-14 18:21:00 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-08-14 18:21:00 (GMT) |
commit | 45be06a387c1294fa3c95cc71106afcc023ddb91 (patch) | |
tree | 3043133c78a523d02f2671710318046afe29d8b7 /src/H5FDint.c | |
parent | ce1e8162959b14b97d79b53ebf4bea77e2e871b2 (diff) | |
download | hdf5-45be06a387c1294fa3c95cc71106afcc023ddb91.zip hdf5-45be06a387c1294fa3c95cc71106afcc023ddb91.tar.gz hdf5-45be06a387c1294fa3c95cc71106afcc023ddb91.tar.bz2 |
Preliminary checkins for implementation done so far:
1) Public routines: H5Pget/set_vfd_swmr_config
2) Public routine: H5Fvfd_swmr_end_tick
3) Initialization when opening a file with VFD SWMR writer
4) Tests in test/vfd_swmr.c for VFD SWMR
5) Fix a bug in src/H5Fint.c: when error is encountered after the root group is created
Note the following:
--This is WORK IN PROGRESS and will subject to change as implementation goes.
--There is test failure form enc_dec_plist.c: I will fix this when changes to the property list are settled.
--The branch is updated with the latest from develop as of 8/14/2018
Diffstat (limited to 'src/H5FDint.c')
-rw-r--r-- | src/H5FDint.c | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c index 023ff57..a26815e 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -418,3 +418,111 @@ H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_driver_query() */ + +/*------------------------------------------------------------------------- +* Function: H5FD_writer_end_of_tick +* +* Purpose: +* +* Return: SUCCEED/FAIL +* +* Programmer: +* +*------------------------------------------------------------------------- +*/ +herr_t +H5FD_writer_end_of_tick(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_writer_end_of_tick() */ + + +/*------------------------------------------------------------------------- +* Function: H5FD_reader_end_of_tick +* +* Purpose: +* +* Return: SUCCEED/FAIL +* +* Programmer: +* +*------------------------------------------------------------------------- +*/ +herr_t +H5FD_reader_end_of_tick(void) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT_NOERR + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_reader_end_of_tick() */ + +#ifdef OUT + +/*------------------------------------------------------------------------- + * Function: H5FD_vfd_swmr_md_read + * + * Purpose: ?? + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_vfd_swmr_md_read(int md_fd, haddr_t addr, size_t size, const void *buf) +{ + + HDlseek(fd, (HDoff_t)addr, SEEK_SET); + bytes_read = HDread(md_fd, buf, size); + + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD_vfd_swmr_read() */ + +herr_t +H5FD_vfd_swmr_hdr_deserialize(int md_fd, size_t len) +{ + uint8_t image[H5FD_MD_HEADER_SIZE]; /* Buffer for element data */ + uint8_t *p = NULL; + uint32_t fs_page_size; + uint64_t tick_num; + uint64_t index_offset; + uint64_t index_length; + uint32_t stored_chksum; /* Stored metadata checksum value */ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + p = &image[0]; + + HDlseek(md_fd, (HDoff_t)0, SEEK_SET); + HDread(md_fd, image, H5FD_MD_HEADER_SIZE); + + /* Magic number */ + if(HDmemcmp(p, H5FD_MD_HEADER_MAGIC, (size_t)H5_SIZEOF_MAGIC)) + HGOTO_ERROR(H5E_VFL, H5E_CANTLOAD, NULL, "wrong metadata file header signature") + p += H5_SIZEOF_MAGIC; + + UINT32DECODE(p, fs_page_size); + UINT64DECODE(p, tick_num); + UINT64DECODE(p, index_offset); + UINT64DECODE(p, index_length); + + /* NEED to verify checksum/retry ?? */ + /* Metadata checksum */ + UINT32DECODE(p, stored_chksum); + + /* Sanity check */ + HDassert((size_t)(p - (const uint8_t *)&image[0]) <= len); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5FD_vfd_swmr_hdr_deserialize() */ +#endif |