Normalization with VOL integration branch.

This commit is contained in:
Dana Robinson
2017-12-05 10:41:54 -08:00
parent 853ae26333
commit ec1e00a55f
9 changed files with 109 additions and 132 deletions

View File

@@ -1574,7 +1574,7 @@ H5F__flush_phase2(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closi
* *
* Purpose: Flushes cached data. * Purpose: Flushes cached data.
* *
* Return: Non-negative on success/Negative on failure * Return: SUCCEED/FAIL
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
herr_t herr_t

View File

@@ -25,9 +25,6 @@
#include "H5MMprivate.h" /* Memory management */ #include "H5MMprivate.h" /* Memory management */
/* PRIVATE PROTOTYPES */ /* PRIVATE PROTOTYPES */
static herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child,
hid_t plist_id, hid_t dxpl_id);
static herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id);
static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); static void H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs);
@@ -99,7 +96,7 @@ done:
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
static herr_t herr_t
H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child,
hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id) hid_t H5_ATTR_UNUSED plist_id, hid_t dxpl_id)
{ {
@@ -265,7 +262,7 @@ done:
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
static herr_t herr_t
H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id) H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id)
{ {
H5G_t *child_group = NULL; /* Child's group in parent mtab */ H5G_t *child_group = NULL; /* Child's group in parent mtab */

View File

@@ -399,11 +399,12 @@ H5_DLL herr_t H5F__dest(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t
H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing); H5_DLL herr_t H5F__flush(H5F_t *f, hid_t meta_dxpl_id, hid_t raw_dxpl_id, hbool_t closing);
H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id); H5_DLL htri_t H5F__is_hdf5(const char *name, hid_t meta_dxpl_id, hid_t raw_dxpl_id);
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 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 ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, H5_DLL ssize_t H5F_get_file_image(H5F_t *f, void *buf_ptr, size_t buf_len, hid_t meta_dxpl_id, hid_t raw_dxpl_id);
hid_t meta_dxpl_id, hid_t raw_dxpl_id);
H5_DLL herr_t H5F_close(H5F_t *f); H5_DLL herr_t H5F_close(H5F_t *f);
/* File mount related routines */ /* File mount related routines */
H5_DLL herr_t H5F_mount(H5G_loc_t *loc, const char *name, H5F_t *child, hid_t plist_id, hid_t dxpl_id);
H5_DLL herr_t H5F_unmount(H5G_loc_t *loc, const char *name, hid_t dxpl_id);
H5_DLL herr_t H5F_close_mounts(H5F_t *f); H5_DLL herr_t H5F_close_mounts(H5F_t *f);
H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key); H5_DLL int H5F_term_unmount_cb(void *obj_ptr, hid_t obj_id, void *key);
H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs); H5_DLL herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs);

View File

@@ -17,6 +17,9 @@
#ifndef _H5Pprivate_H #ifndef _H5Pprivate_H
#define _H5Pprivate_H #define _H5Pprivate_H
/* Early typedefs to avoid circular dependencies */
typedef struct H5P_genplist_t H5P_genplist_t;
/* Include package's public header */ /* Include package's public header */
#include "H5Ppublic.h" #include "H5Ppublic.h"
@@ -52,12 +55,7 @@ typedef enum H5P_coll_md_read_flag_t {
H5P_USER_TRUE = 1 H5P_USER_TRUE = 1
} H5P_coll_md_read_flag_t; } H5P_coll_md_read_flag_t;
/* Forward declarations (for prototypes & type definitions) */
struct H5O_fill_t;
struct H5T_t;
/* Forward declarations for anonymous H5P objects */ /* Forward declarations for anonymous H5P objects */
typedef struct H5P_genplist_t H5P_genplist_t;
typedef struct H5P_genclass_t H5P_genclass_t; typedef struct H5P_genclass_t H5P_genclass_t;
typedef enum H5P_plist_type_t { typedef enum H5P_plist_type_t {
@@ -145,6 +143,10 @@ H5_DLLVAR const struct H5P_libclass_t H5P_CLS_FACC[1]; /* File access */
/* Library Private Prototypes */ /* Library Private Prototypes */
/******************************/ /******************************/
/* Forward declaration of structs used below */
struct H5O_fill_t;
struct H5T_t;
/* Package initialization routine */ /* Package initialization routine */
H5_DLL herr_t H5P_init(void); H5_DLL herr_t H5P_init(void);

View File

@@ -48,7 +48,7 @@
#include "H5FDsec2.h" /* POSIX unbuffered file I/O */ #include "H5FDsec2.h" /* POSIX unbuffered file I/O */
#include "H5FDstdio.h" /* Standard C buffered I/O */ #include "H5FDstdio.h" /* Standard C buffered I/O */
#ifdef H5_HAVE_WINDOWS #ifdef H5_HAVE_WINDOWS
#include "H5FDwindows.h" /* Windows buffered I/O */ #include "H5FDwindows.h" /* Win32 I/O */
#endif #endif
#endif #endif

View File

@@ -104,68 +104,6 @@ static herr_t h5_errors(hid_t estack, void *client_data);
static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix, static char * h5_fixname_real(const char *base_name, hid_t fapl, const char *suffix,
char *fullname, size_t size, hbool_t nest_printf); char *fullname, size_t size, hbool_t nest_printf);
/* A non-usable VFD class and its functions.
*
* Usable for testing things like ID handling where we shouldn't mess with the real VFDs.
*/
static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
static herr_t dummy_vfd_close(H5FD_t *_file);
static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
static H5FD_class_t dummy_vfd_class_g = {
"fake", /* name */
1, /* maxaddr */
H5F_CLOSE_WEAK, /* fc_degree */
NULL, /* terminate */
NULL, /* sb_size */
NULL, /* sb_encode */
NULL, /* sb_decode */
0, /* fapl_size */
NULL, /* fapl_get */
NULL, /* fapl_copy */
NULL, /* fapl_free */
0, /* dxpl_size */
NULL, /* dxpl_copy */
NULL, /* dxpl_free */
dummy_vfd_open, /* open */
dummy_vfd_close, /* close */
NULL, /* cmp */
NULL, /* query */
NULL, /* get_type_map */
NULL, /* alloc */
NULL, /* free */
dummy_vfd_get_eoa, /* get_eoa */
dummy_vfd_set_eoa, /* set_eoa */
dummy_vfd_get_eof, /* get_eof */
NULL, /* get_handle */
dummy_vfd_read, /* read */
dummy_vfd_write, /* write */
NULL, /* flush */
NULL, /* truncate */
NULL, /* lock */
NULL, /* unlock */
H5FD_FLMAP_DEFAULT /* fl_map */
};
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Function: h5_errors * Function: h5_errors
@@ -1890,6 +1828,33 @@ error:
return FAIL; return FAIL;
} /* h5_wait_message() */ } /* h5_wait_message() */
/* Functions for the dummy VFD class (see below).
*
* Useful for testing things like ID handling where we shouldn't mess with the
* real VFDs.
*/
static H5FD_t *dummy_vfd_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr);
static H5FD_t *dummy_vfd_open(const char H5_ATTR_UNUSED *name, unsigned H5_ATTR_UNUSED flags, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED maxaddr) { return NULL; }
static herr_t dummy_vfd_close(H5FD_t *_file);
static herr_t dummy_vfd_close(H5FD_t H5_ATTR_UNUSED *_file) { return FAIL; }
static haddr_t dummy_vfd_get_eoa(const H5FD_t *file, H5FD_mem_t type);
static haddr_t dummy_vfd_get_eoa(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
static herr_t dummy_vfd_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr);
static herr_t dummy_vfd_set_eoa(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t H5_ATTR_UNUSED addr) { return FAIL; }
static haddr_t dummy_vfd_get_eof(const H5FD_t *file, H5FD_mem_t type);
static haddr_t dummy_vfd_get_eof(const H5FD_t H5_ATTR_UNUSED *file, H5FD_mem_t H5_ATTR_UNUSED type) { return HADDR_UNDEF; }
static herr_t dummy_vfd_read(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, void *buf);
static herr_t dummy_vfd_read(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, void H5_ATTR_UNUSED *buf) { return FAIL; }
static herr_t dummy_vfd_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, size_t size, const void *buf);
static herr_t dummy_vfd_write(H5FD_t H5_ATTR_UNUSED *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUSED fapl_id, haddr_t H5_ATTR_UNUSED addr, size_t H5_ATTR_UNUSED size, const void H5_ATTR_UNUSED *buf) { return FAIL; }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* Function: h5_get_dummy_vfd_class() * Function: h5_get_dummy_vfd_class()
* *
@@ -1913,12 +1878,24 @@ error:
H5FD_class_t * H5FD_class_t *
h5_get_dummy_vfd_class(void) h5_get_dummy_vfd_class(void)
{ {
H5FD_class_t *vfd_class = NULL; H5FD_class_t *vfd_class = NULL; /* Dummy VFD that will be returned */
if(NULL == (vfd_class = (H5FD_class_t *)HDmalloc(sizeof(H5FD_class_t)))) /* Create the class and initialize everything to zero/NULL */
if(NULL == (vfd_class = (H5FD_class_t *)HDcalloc((size_t)1, sizeof(H5FD_class_t))))
TEST_ERROR; TEST_ERROR;
HDmemcpy(vfd_class, &dummy_vfd_class_g, sizeof(H5FD_class_t)); /* Fill in the minimum parameters to make a VFD that
* can be registered.
*/
vfd_class->name = "dummy";
vfd_class->maxaddr = 1;
vfd_class->open = dummy_vfd_open;
vfd_class->close = dummy_vfd_close;
vfd_class->get_eoa = dummy_vfd_get_eoa;
vfd_class->set_eoa = dummy_vfd_set_eoa;
vfd_class->get_eof = dummy_vfd_get_eof;
vfd_class->read = dummy_vfd_read;
vfd_class->write = dummy_vfd_write;
return vfd_class; return vfd_class;