diff options
author | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-12 01:13:39 (GMT) |
---|---|---|
committer | Jordan Henderson <jhenderson@hdfgroup.org> | 2019-02-12 01:13:39 (GMT) |
commit | 34508f0620363d90ef3f76b314d52e4b01c20a81 (patch) | |
tree | af8054ab51fc5f4cc495882df9ed4343960586b9 /src | |
parent | 65a820ae8981a84fe7fbac87c48482e9f82b35f4 (diff) | |
parent | fa83ab9f7c7dd7966f475932325b5e3740810cfd (diff) | |
download | hdf5-34508f0620363d90ef3f76b314d52e4b01c20a81.zip hdf5-34508f0620363d90ef3f76b314d52e4b01c20a81.tar.gz hdf5-34508f0620363d90ef3f76b314d52e4b01c20a81.tar.bz2 |
Merge in latest from develop
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/H5AC.c | 16 | ||||
-rw-r--r-- | src/H5C.c | 4 | ||||
-rw-r--r-- | src/H5Clog.c | 5 | ||||
-rw-r--r-- | src/H5Clog.h | 4 | ||||
-rw-r--r-- | src/H5Clog_json.c | 9 | ||||
-rw-r--r-- | src/H5Clog_trace.c | 7 | ||||
-rw-r--r-- | src/H5Cpkg.h | 8 | ||||
-rw-r--r-- | src/H5Cprivate.h | 1 | ||||
-rw-r--r-- | src/H5Ctag.c | 26 | ||||
-rw-r--r-- | src/H5Dio.c | 9 | ||||
-rw-r--r-- | src/H5FDcore.c | 28 | ||||
-rw-r--r-- | src/H5FDlog.c | 30 | ||||
-rw-r--r-- | src/H5FDsec2.c | 32 | ||||
-rw-r--r-- | src/H5Torder.c | 4 | ||||
-rw-r--r-- | src/H5VLcallback.c | 11 | ||||
-rw-r--r-- | src/H5VLint.c | 10 | ||||
-rw-r--r-- | src/H5VLpassthru.c | 7 | ||||
-rw-r--r-- | src/H5VLprivate.h | 2 | ||||
-rw-r--r-- | src/H5VLpublic.h | 6 | ||||
-rw-r--r-- | src/H5private.h | 6 |
21 files changed, 171 insertions, 60 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff7402b..6b105a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -944,6 +944,12 @@ if (BUILD_SHARED_LIBS) endif () if (LOCAL_BATCH_TEST) + if ("${LOCAL_BATCH_SCRIPT_COMMAND}" STREQUAL "raybsub") + configure_file ( + ${HDF5_SOURCE_DIR}/bin/batch/${LOCAL_BATCH_SCRIPT_COMMAND} + ${HDF5_BINARY_DIR}/${LOCAL_BATCH_SCRIPT_COMMAND} ESCAPE_QUOTES @ONLY + ) + endif () if (LOCAL_BATCH_SCRIPT_NAME) configure_file ( ${HDF5_SOURCE_DIR}/bin/batch/${LOCAL_BATCH_SCRIPT_NAME}.in.cmake @@ -1612,7 +1612,7 @@ H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, void *thing, done: /* If currently logging, generate a message */ if(f->shared->cache->log_info->logging) - if(H5C_log_write_unprotect_entry_msg(f->shared->cache, (H5AC_info_t *)thing, type->id, flags, ret_value) < 0) + if(H5C_log_write_unprotect_entry_msg(f->shared->cache, addr, type->id, flags, ret_value) < 0) HDONE_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") FUNC_LEAVE_NOAPI(ret_value) @@ -2403,8 +2403,18 @@ H5AC_cork(H5F_t *f, haddr_t obj_addr, unsigned action, hbool_t *corked) HDassert(H5F_addr_defined(obj_addr)); HDassert(action == H5AC__SET_CORK || action == H5AC__UNCORK || action == H5AC__GET_CORKED); - if(action == H5AC__GET_CORKED) - HDassert(corked); + /* Skip the search on "tag_list" when there are no "corked" objects. + * This is done to mitigate the slow down when closing objects. + * Re-visit this optimization when we optimize tag info management + * in the future. + */ + if(action == H5AC__GET_CORKED) { + HDassert(corked); + if(H5C_get_num_objs_corked(f->shared->cache) == 0) { + *corked = FALSE; + HGOTO_DONE(SUCCEED) + } + } if(H5C_cork(f->shared->cache, obj_addr, action, corked) < 0) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Cannot perform the cork action") @@ -327,6 +327,7 @@ H5C_create(size_t max_cache_size, /* Tagging Field Initializations */ cache_ptr->ignore_tags = FALSE; + cache_ptr->num_objs_corked = 0; cache_ptr->slist_changed = FALSE; cache_ptr->slist_len = 0; @@ -7700,6 +7701,8 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Set the corked status for the entire object */ tag_info->corked = TRUE; + cache_ptr->num_objs_corked++; + } /* end if */ else { /* Sanity check */ @@ -7711,6 +7714,7 @@ H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked) /* Set the corked status for the entire object */ tag_info->corked = FALSE; + cache_ptr->num_objs_corked--; /* Remove the tag info from the tag list, if there's no more entries with this tag */ if(0 == tag_info->entry_cnt) { diff --git a/src/H5Clog.c b/src/H5Clog.c index 0ae7f13..cf9b7e8 100644 --- a/src/H5Clog.c +++ b/src/H5Clog.c @@ -887,7 +887,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_log_write_unprotect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, +H5C_log_write_unprotect_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value) { herr_t ret_value = SUCCEED; @@ -898,9 +898,8 @@ H5C_log_write_unprotect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, HDassert(cache); /* Write a log message */ - HDassert(entry); if(cache->log_info->cls->write_unprotect_entry_log_msg) - if(cache->log_info->cls->write_unprotect_entry_log_msg(cache->log_info->udata, entry, type_id, flags, fxn_ret_value) < 0) + if(cache->log_info->cls->write_unprotect_entry_log_msg(cache->log_info->udata, address, type_id, flags, fxn_ret_value) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "log-specific unprotect entry call failed") done: diff --git a/src/H5Clog.h b/src/H5Clog.h index 9ba6786..0235c4a 100644 --- a/src/H5Clog.h +++ b/src/H5Clog.h @@ -59,7 +59,7 @@ typedef struct H5C_log_class_t { herr_t (*write_resize_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value); herr_t (*write_unpin_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); herr_t (*write_destroy_fd_log_msg)(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); - herr_t (*write_unprotect_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value); + herr_t (*write_unprotect_entry_log_msg)(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value); herr_t (*write_set_cache_config_log_msg)(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value); herr_t (*write_remove_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); @@ -102,7 +102,7 @@ H5_DLL herr_t H5C_log_write_protect_entry_msg(H5C_t *cache, const H5C_cache_entr H5_DLL herr_t H5C_log_write_resize_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value); H5_DLL herr_t H5C_log_write_unpin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); H5_DLL herr_t H5C_log_write_destroy_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); -H5_DLL herr_t H5C_log_write_unprotect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value); +H5_DLL herr_t H5C_log_write_unprotect_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value); H5_DLL herr_t H5C_log_write_set_cache_config_msg(H5C_t *cache, const H5AC_cache_config_t *config, herr_t fxn_ret_value); H5_DLL herr_t H5C_log_write_remove_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index ccfa222..dd9e9b2 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -41,7 +41,7 @@ /****************/ /* Max log message size */ -#define H5C_MAX_JSON_LOG_MSG_SIZE 128 +#define H5C_MAX_JSON_LOG_MSG_SIZE 1024 /******************/ @@ -87,7 +87,7 @@ static herr_t H5C__json_write_protect_entry_log_msg(void *udata, const H5C_cache static herr_t H5C__json_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value); static herr_t H5C__json_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); static herr_t H5C__json_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); -static herr_t H5C__json_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value); +static herr_t H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value); static herr_t H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value); static herr_t H5C__json_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); @@ -1232,7 +1232,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__json_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, +H5C__json_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value) { H5C_log_json_udata_t *json_udata = (H5C_log_json_udata_t *)(udata); @@ -1243,7 +1243,6 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *en /* Sanity checks */ HDassert(json_udata); HDassert(json_udata->message); - HDassert(entry); /* Create the log message string */ HDsnprintf(json_udata->message, H5C_MAX_JSON_LOG_MSG_SIZE, @@ -1257,7 +1256,7 @@ H5C__json_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *en \"returned\":%d\ },\n\ " - , (long long)HDtime(NULL), (unsigned long)entry->addr, + , (long long)HDtime(NULL), (unsigned long)address, type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index f7d6889..7c1305c 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -82,7 +82,7 @@ static herr_t H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cach static herr_t H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value); static herr_t H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); static herr_t H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); -static herr_t H5C__trace_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value); +static herr_t H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value); static herr_t H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value); static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); @@ -872,7 +872,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, +H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); @@ -883,11 +883,10 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, const H5C_cache_entry_t *e /* Sanity checks */ HDassert(trace_udata); HDassert(trace_udata->message); - HDassert(entry); /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", - (unsigned long)(entry->addr), type_id, flags, (int)fxn_ret_value); + (unsigned long)(address), type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ if(H5C__trace_write_log_message(trace_udata) < 0) diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 9201afb..9156c0d 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -3823,6 +3823,13 @@ typedef struct H5C_tag_info_t { * * ignore_tags: Boolean flag to disable tag validation during entry insertion. * + * num_objs_corked: Unsigned integer field containing the number of objects + * that are "corked". The "corked" status of an object is + * found by searching the "tag_list". This field is added + * for optimization so that the skip list search on "tag_list" + * can be skipped if this field is zero, i.e. no "corked" + * objects. + * * When a cache entry is protected, it must be removed from the LRU * list(s) as it cannot be either flushed or evicted until it is unprotected. * The following fields are used to implement the protected list (pl). @@ -4693,6 +4700,7 @@ struct H5C_t { /* Fields for maintaining list of tagged entries */ H5SL_t * tag_list; hbool_t ignore_tags; + uint32_t num_objs_corked; /* Fields for tracking protected entries */ uint32_t pl_len; diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index c39c1df..d4ed6fc 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2301,6 +2301,7 @@ H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr, unsigned int tests); H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr); H5_DLL hbool_t H5C_get_ignore_tags(const H5C_t *cache_ptr); +H5_DLL uint32_t H5C_get_num_objs_corked(const H5C_t *cache_ptr); H5_DLL herr_t H5C_retag_entries(H5C_t * cache_ptr, haddr_t src_tag, haddr_t dest_tag); H5_DLL herr_t H5C_cork(H5C_t *cache_ptr, haddr_t obj_addr, unsigned action, hbool_t *corked); H5_DLL herr_t H5C_get_entry_ring(const H5F_t *f, haddr_t addr, H5C_ring_t *ring); diff --git a/src/H5Ctag.c b/src/H5Ctag.c index 0f08ede..807e68d 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -175,6 +175,32 @@ H5C_get_ignore_tags(const H5C_t *cache_ptr) /*------------------------------------------------------------------------- * + * Function: H5C_get_num_objs_corked + * + * Purpose: Retrieve the 'num_objs_corked' field for the cache + * + * Return: 'num_objs_corked' value (can't fail) + * + * Programmer: Vailin Choi; Feb 2019 + * + *------------------------------------------------------------------------- + */ +uint32_t +H5C_get_num_objs_corked(const H5C_t *cache_ptr) +{ + FUNC_ENTER_NOAPI_NOERR + + /* Sanity checks */ + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + + /* Return value for num_objs_corked */ + FUNC_LEAVE_NOAPI(cache_ptr->num_objs_corked) +} /* H5C_get_num_objs_corked */ + + +/*------------------------------------------------------------------------- + * * Function: H5C__tag_entry * * Purpose: Tags an entry with the provided tag (contained in the API context). diff --git a/src/H5Dio.c b/src/H5Dio.c index 607bfcf..2f87e38 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1031,16 +1031,13 @@ H5D__typeinfo_init(const H5D_t *dset, hid_t mem_type_id, hbool_t do_write, if(type_info->request_nelmts == 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") - /* - * Get a temporary buffer for type conversion unless the app has already + /* Get a temporary buffer for type conversion unless the app has already * supplied one through the xfer properties. Instead of allocating a - * buffer which is the exact size, we allocate the target size. The - * malloc() is usually less resource-intensive if we allocate/free the - * same size over and over. + * buffer which is the exact size, we allocate the target size. */ if(NULL == (type_info->tconv_buf = (uint8_t *)tconv_buf)) { /* Allocate temporary buffer */ - if(NULL == (type_info->tconv_buf = H5FL_BLK_MALLOC(type_conv, target_size))) + if(NULL == (type_info->tconv_buf = H5FL_BLK_CALLOC(type_conv, target_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion") type_info->tconv_buf_allocated = TRUE; } /* end if */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index ed05e95..d1a17cd 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -348,14 +348,17 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) HDassert(file); - /* Write to backing store */ - if((off_t)addr != HDlseek(file->fd, (off_t)addr, SEEK_SET)) +#ifndef H5_HAVE_PREADWRITE + /* Seek to the correct location (if we don't have pwrite) */ + if((HDoff_t)addr != HDlseek(file->fd, (off_t)addr, SEEK_SET)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "error seeking in backing store") +#endif /* H5_HAVE_PREADWRITE */ while (size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + HDoff_t offset = (HDoff_t)addr; /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -366,15 +369,21 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size) bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_wrote = HDpwrite(file->fd, ptr, bytes_in, offset); + offset += bytes_wrote; +#else bytes_wrote = HDwrite(file->fd, ptr, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)myoffset); + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ HDassert(bytes_wrote > 0); @@ -852,6 +861,7 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + HDoff_t offset = (HDoff_t)0; /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. @@ -862,15 +872,21 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_read = HDpread(file->fd, mem, bytes_in, offset); + offset += bytes_read; +#else bytes_read = HDread(file->fd, mem, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); - HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)myoffset); + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ HDassert(bytes_read >= 0); diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 97d1b41..655d7d3 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1191,7 +1191,8 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd } /* end if */ } /* end if */ - /* Seek to the correct location */ +#ifndef H5_HAVE_PREADWRITE + /* Seek to the correct location (if we don't have pread) */ if(addr != file->pos || OP_READ != file->op) { #ifdef H5_HAVE_GETTIMEOFDAY if(file->fa.flags & H5FD_LOG_TIME_SEEK) @@ -1234,6 +1235,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd #endif /* H5_HAVE_GETTIMEOFDAY */ } /* end if */ } /* end if */ +#endif /* H5_HAVE_PREADWRITE */ /* * Read data, being careful of interrupted system calls, partial results, @@ -1247,6 +1249,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd h5_posix_io_t bytes_in = 0; /* # of bytes to read */ h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + HDoff_t offset = (HDoff_t)addr; /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. @@ -1257,18 +1260,24 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, hadd bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_read = HDpread(file->fd, buf, bytes_in, offset); + offset += bytes_read; +#else bytes_read = HDread(file->fd, buf, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); if(file->fa.flags & H5FD_LOG_LOC_READ) HDfprintf(file->logfp, "Error! Reading: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)myoffset); + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ if(0 == bytes_read) { @@ -1398,7 +1407,8 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had file->nwrite[tmp_addr++]++; } /* end if */ - /* Seek to the correct location */ +#ifndef H5_HAVE_PREADWRITE + /* Seek to the correct location (if we don't have pwrite) */ if(addr != file->pos || OP_WRITE != file->op) { #ifdef H5_HAVE_GETTIMEOFDAY if(file->fa.flags & H5FD_LOG_TIME_SEEK) @@ -1441,6 +1451,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had #endif /* H5_HAVE_GETTIMEOFDAY */ } /* end if */ } /* end if */ +#endif /* H5_HAVE_PREADWRITE */ /* * Write the data, being careful of interrupted system calls and partial @@ -1454,6 +1465,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + HDoff_t offset = (HDoff_t)addr; /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -1464,18 +1476,24 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, had bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_wrote = HDpwrite(file->fd, buf, bytes_in, offset); + offset += bytes_wrote; +#else bytes_wrote = HDwrite(file->fd, buf, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); if(file->fa.flags & H5FD_LOG_LOC_WRITE) HDfprintf(file->logfp, "Error! Writing: %10a-%10a (%10Zu bytes)\n", orig_addr, (orig_addr + orig_size) - 1, orig_size); - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)myoffset); + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ HDassert(bytes_wrote > 0); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index c507387..0054a86 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -682,11 +682,13 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS if(REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu", (unsigned long long)addr) - /* Seek to the correct location */ +#ifndef H5_HAVE_PREADWRITE + /* Seek to the correct location (if we don't have pread) */ if(addr != file->pos || OP_READ != file->op) { if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ +#endif /* H5_HAVE_PREADWRITE */ /* Read data, being careful of interrupted system calls, partial results, * and the end of the file. @@ -694,7 +696,8 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS while(size > 0) { h5_posix_io_t bytes_in = 0; /* # of bytes to read */ - h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + h5_posix_io_ret_t bytes_read = -1; /* # of bytes actually read */ + HDoff_t offset = (HDoff_t)addr; /* Trying to read more bytes than the return type can handle is * undefined behavior in POSIX. @@ -705,15 +708,21 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_read = HDpread(file->fd, buf, bytes_in, offset); + offset += bytes_read; +#else bytes_read = HDread(file->fd, buf, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_read && EINTR == errno); if(-1 == bytes_read) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); - HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)myoffset); + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total read size = %llu, bytes this sub-read = %llu, bytes actually read = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_read, (unsigned long long)offset); } /* end if */ if(0 == bytes_read) { @@ -777,11 +786,13 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU if(REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow, addr = %llu, size = %llu", (unsigned long long)addr, (unsigned long long)size) - /* Seek to the correct location */ +#ifndef H5_HAVE_PREADWRITE + /* Seek to the correct location (if we don't have pwrite) */ if(addr != file->pos || OP_WRITE != file->op) { if(HDlseek(file->fd, (HDoff_t)addr, SEEK_SET) < 0) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") } /* end if */ +#endif /* H5_HAVE_PREADWRITE */ /* Write the data, being careful of interrupted system calls and partial * results @@ -790,6 +801,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU h5_posix_io_t bytes_in = 0; /* # of bytes to write */ h5_posix_io_ret_t bytes_wrote = -1; /* # of bytes written */ + HDoff_t offset = (HDoff_t)addr; /* Trying to write more bytes than the return type can handle is * undefined behavior in POSIX. @@ -800,15 +812,21 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU bytes_in = (h5_posix_io_t)size; do { +#ifdef H5_HAVE_PREADWRITE + bytes_wrote = HDpwrite(file->fd, buf, bytes_in, offset); + offset += bytes_wrote; +#else bytes_wrote = HDwrite(file->fd, buf, bytes_in); +#endif /* H5_HAVE_PREADWRITE */ } while(-1 == bytes_wrote && EINTR == errno); if(-1 == bytes_wrote) { /* error */ int myerrno = errno; time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)myoffset); + offset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', buf = %p, total write size = %llu, bytes this sub-write = %llu, bytes actually written = %llu, offset = %llu", HDctime(&mytime), file->filename, file->fd, myerrno, HDstrerror(myerrno), buf, (unsigned long long)size, (unsigned long long)bytes_in, (unsigned long long)bytes_wrote, (unsigned long long)offset); } /* end if */ HDassert(bytes_wrote > 0); diff --git a/src/H5Torder.c b/src/H5Torder.c index d687d03..62662d6 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -100,11 +100,11 @@ H5Tget_order(hid_t type_id) /* Check args */ if(NULL == (dt = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5T_ORDER_ERROR, "not a datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_BADTYPE, H5T_ORDER_ERROR, "not a datatype") /* Get order */ if(H5T_ORDER_ERROR == (ret_value = H5T_get_order(dt))) - HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "cant't get order for specified datatype") + HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "can't get order for specified datatype") done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c index 811162d..2d6ac33 100644 --- a/src/H5VLcallback.c +++ b/src/H5VLcallback.c @@ -829,7 +829,8 @@ done: *------------------------------------------------------------------------- */ void * -H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx, void *obj) +H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx, void *obj, + H5I_type_t obj_type) { void *ret_value = SUCCEED; /* Return value */ @@ -842,7 +843,7 @@ H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx, void *obj) /* Only wrap object if there's a wrap context */ if(wrap_ctx) { /* Ask the connector to wrap the object */ - if(NULL == (ret_value = (connector->wrap_object)(obj, wrap_ctx))) + if(NULL == (ret_value = (connector->wrap_object)(obj, obj_type, wrap_ctx))) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object") } /* end if */ else @@ -864,13 +865,13 @@ done: *--------------------------------------------------------------------------- */ void * -H5VLwrap_object(void *obj, hid_t connector_id, void *wrap_ctx) +H5VLwrap_object(void *obj, H5I_type_t obj_type, hid_t connector_id, void *wrap_ctx) { H5VL_class_t *cls; /* VOL connector's class struct */ void *ret_value = NULL; /* Return value */ FUNC_ENTER_API_NOINIT - H5TRACE3("*x", "*xi*x", obj, connector_id, wrap_ctx); + H5TRACE4("*x", "*xIti*x", obj, obj_type, connector_id, wrap_ctx); /* Check args and get class pointer */ if(NULL == obj) @@ -879,7 +880,7 @@ H5VLwrap_object(void *obj, hid_t connector_id, void *wrap_ctx) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a VOL connector ID") /* Wrap the object */ - if(NULL == (ret_value = H5VL_wrap_object(cls, wrap_ctx, obj))) + if(NULL == (ret_value = H5VL_wrap_object(cls, wrap_ctx, obj, obj_type))) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "unable to wrap object") done: diff --git a/src/H5VLint.c b/src/H5VLint.c index bdb2908..f22fdb6 100644 --- a/src/H5VLint.c +++ b/src/H5VLint.c @@ -65,7 +65,7 @@ typedef struct H5VL_wrap_ctx_t { /* Local Prototypes */ /********************/ static herr_t H5VL__free_cls(H5VL_class_t *cls); -static void *H5VL__wrap_obj(void *obj); +static void *H5VL__wrap_obj(void *obj, H5I_type_t obj_type); static H5VL_object_t *H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t wrap_obj); static void *H5VL__object(hid_t id, H5I_type_t obj_type); @@ -248,7 +248,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5VL__wrap_obj(void *obj) +H5VL__wrap_obj(void *obj, H5I_type_t obj_type) { H5VL_wrap_ctx_t *vol_wrap_ctx = NULL; /* Object wrapping context */ void *ret_value = NULL; /* Return value */ @@ -265,7 +265,7 @@ H5VL__wrap_obj(void *obj) /* If there is a VOL object wrapping context, wrap the object */ if(vol_wrap_ctx) { /* Wrap object, using the VOL callback */ - if(NULL == (ret_value = H5VL_wrap_object(vol_wrap_ctx->connector->cls, vol_wrap_ctx->obj_wrap_ctx, obj))) + if(NULL == (ret_value = H5VL_wrap_object(vol_wrap_ctx->connector->cls, vol_wrap_ctx->obj_wrap_ctx, obj, obj_type))) HGOTO_ERROR(H5E_VOL, H5E_CANTGET, NULL, "can't wrap object") } /* end if */ else @@ -310,7 +310,7 @@ H5VL__new_vol_obj(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t HGOTO_ERROR(H5E_VOL, H5E_CANTALLOC, NULL, "can't allocate memory for VOL object") new_vol_obj->connector = vol_connector; if(wrap_obj) { - if(NULL == (new_vol_obj->data = H5VL__wrap_obj(object))) + if(NULL == (new_vol_obj->data = H5VL__wrap_obj(object, type))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, NULL, "can't wrap library object") } /* end if */ else @@ -1099,7 +1099,7 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref) HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype") /* Wrap the object with VOL connector info */ - if(NULL == (new_obj = H5VL__wrap_obj(obj))) + if(NULL == (new_obj = H5VL__wrap_obj(obj, type))) HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object") /* Retrieve the VOL object wrapping context */ diff --git a/src/H5VLpassthru.c b/src/H5VLpassthru.c index 13d8d8e..f7f9058 100644 --- a/src/H5VLpassthru.c +++ b/src/H5VLpassthru.c @@ -90,7 +90,8 @@ static herr_t H5VL_pass_through_str_to_info(const char *str, void **info); static void *H5VL_pass_through_get_object(const void *obj); static herr_t H5VL_pass_through_get_wrap_ctx(const void *obj, void **wrap_ctx); static herr_t H5VL_pass_through_free_wrap_ctx(void *obj); -static void *H5VL_pass_through_wrap_object(void *obj, void *wrap_ctx); +static void *H5VL_pass_through_wrap_object(void *obj, H5I_type_t obj_type, + void *wrap_ctx); /* Attribute callbacks */ static void *H5VL_pass_through_attr_create(void *obj, const H5VL_loc_params_t *loc_params, const char *name, hid_t acpl_id, hid_t aapl_id, hid_t dxpl_id, void **req); @@ -660,7 +661,7 @@ H5VL_pass_through_get_wrap_ctx(const void *obj, void **wrap_ctx) *--------------------------------------------------------------------------- */ static void * -H5VL_pass_through_wrap_object(void *obj, void *_wrap_ctx) +H5VL_pass_through_wrap_object(void *obj, H5I_type_t obj_type, void *_wrap_ctx) { H5VL_pass_through_wrap_ctx_t *wrap_ctx = (H5VL_pass_through_wrap_ctx_t *)_wrap_ctx; H5VL_pass_through_t *new_obj; @@ -671,7 +672,7 @@ H5VL_pass_through_wrap_object(void *obj, void *_wrap_ctx) #endif /* Wrap the object with the underlying VOL */ - under = H5VLwrap_object(obj, wrap_ctx->under_vol_id, wrap_ctx->under_wrap_ctx); + under = H5VLwrap_object(obj, obj_type, wrap_ctx->under_vol_id, wrap_ctx->under_wrap_ctx); if(under) new_obj = H5VL_pass_through_new_obj(under, wrap_ctx->under_vol_id); else diff --git a/src/H5VLprivate.h b/src/H5VLprivate.h index ef5a81e..283c77a 100644 --- a/src/H5VLprivate.h +++ b/src/H5VLprivate.h @@ -95,7 +95,7 @@ H5_DLL herr_t H5VL_free_wrap_ctx(const H5VL_class_t *connector, void *wrap_ctx); H5_DLL herr_t H5VL_set_vol_wrapper(void *obj, const H5VL_t *vol_connector); H5_DLL herr_t H5VL_reset_vol_wrapper(void); H5_DLL void * H5VL_wrap_object(const H5VL_class_t *connector, void *wrap_ctx, - void *obj); + void *obj, H5I_type_t obj_type); /* ID registration functions */ H5_DLL hid_t H5VL_register(H5I_type_t type, void *object, H5VL_t *vol_connector, hbool_t app_ref); diff --git a/src/H5VLpublic.h b/src/H5VLpublic.h index dd1ed54..6ea9fc1 100644 --- a/src/H5VLpublic.h +++ b/src/H5VLpublic.h @@ -22,6 +22,7 @@ #include "H5Apublic.h" /* Attributes */ #include "H5ESpublic.h" /* Event Stack */ #include "H5Fpublic.h" /* Files */ +#include "H5Ipublic.h" /* IDs */ #include "H5Lpublic.h" /* Links */ #include "H5Opublic.h" /* Objects */ #include "H5Rpublic.h" /* References */ @@ -383,7 +384,7 @@ typedef struct H5VL_class_t { herr_t (*str_to_info)(const char *str, void **info); /* Callback to deserialize a string into connector's info */ void * (*get_object)(const void *obj); /* Callback to retrieve underlying object */ herr_t (*get_wrap_ctx)(const void *obj, void **wrap_ctx); /* Callback to retrieve the object wrapping context for the connector */ - void* (*wrap_object)(void *obj, void *wrap_ctx); /* Callback to wrap a library object */ + void* (*wrap_object)(void *obj, H5I_type_t obj_type, void *wrap_ctx); /* Callback to wrap a library object */ herr_t (*free_wrap_ctx)(void *wrap_ctx); /* Callback to release the object wrapping context for the connector */ /* Data Model */ @@ -450,7 +451,8 @@ H5_DLL herr_t H5VLconnector_info_to_str(const void *info, hid_t connector_id, ch H5_DLL herr_t H5VLconnector_str_to_info(const char *str, hid_t connector_id, void **info); H5_DLL void *H5VLget_object(void *obj, hid_t connector_id); H5_DLL herr_t H5VLget_wrap_ctx(void *obj, hid_t connector_id, void **wrap_ctx); -H5_DLL void *H5VLwrap_object(void *obj, hid_t connector_id, void *wrap_ctx); +H5_DLL void *H5VLwrap_object(void *obj, H5I_type_t obj_type, hid_t connector_id, + void *wrap_ctx); H5_DLL herr_t H5VLfree_wrap_ctx(void *wrap_ctx, hid_t connector_id); /* Public wrappers for attribute callbacks */ diff --git a/src/H5private.h b/src/H5private.h index f58faec..8b6253d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1156,6 +1156,9 @@ typedef off_t h5_stat_size_t; #ifndef HDpowf #define HDpowf(X,Y) powf(X,Y) #endif /* HDpowf */ +#ifndef HDpread + #define HDpread(F,B,C,O) pread(F,B,C,O) +#endif /* HDpread */ #ifndef HDprintf #define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) #endif /* HDprintf */ @@ -1168,6 +1171,9 @@ typedef off_t h5_stat_size_t; #ifndef HDputs #define HDputs(S) puts(S) #endif /* HDputs */ +#ifndef HDpwrite + #define HDpwrite(F,B,C,O) pwrite(F,B,C,O) +#endif /* HDpwrite */ #ifndef HDqsort #define HDqsort(M,N,Z,F) qsort(M,N,Z,F) #endif /* HDqsort*/ |