Remove ability to loc by ref from H5VL layer

This commit is contained in:
Jerome Soumagne 2019-01-10 19:58:17 -06:00
parent 616567f8a1
commit 0f4e080309
3 changed files with 2 additions and 113 deletions

View File

@ -159,9 +159,6 @@ typedef enum H5VL_link_specific_t {
/* types for object GET callback */
typedef enum H5VL_object_get_t {
H5VL_REF_GET_NAME, /* object name, for reference */
H5VL_REF_GET_REGION, /* dataspace of region */
H5VL_REF_GET_TYPE, /* type of object */
H5VL_OBJECT_GET_NAME, /* object name */
H5VL_OBJECT_GET_TYPE /* object type */
} H5VL_object_get_t;
@ -172,7 +169,6 @@ typedef enum H5VL_object_specific_t {
H5VL_OBJECT_EXISTS, /* H5Oexists_by_name */
H5VL_OBJECT_LOOKUP, /* Lookup object */
H5VL_OBJECT_VISIT, /* H5Ovisit(_by_name) */
H5VL_REF_CREATE, /* H5Rcreate */
H5VL_OBJECT_FLUSH, /* H5{D|G|O|T}flush */
H5VL_OBJECT_REFRESH /* H5{D|G|O|T}refresh */
} H5VL_object_specific_t;
@ -197,7 +193,6 @@ typedef enum H5VL_loc_type_t {
H5VL_OBJECT_BY_SELF,
H5VL_OBJECT_BY_NAME,
H5VL_OBJECT_BY_IDX,
H5VL_OBJECT_BY_REF,
H5VL_OBJECT_BY_TOKEN
} H5VL_loc_type_t;
@ -214,18 +209,12 @@ typedef struct H5VL_loc_by_idx {
hid_t lapl_id;
} H5VL_loc_by_idx_t;
typedef struct H5VL_loc_by_ref {
H5R_type_t ref_type;
const void *_ref;
hid_t lapl_id;
} H5VL_loc_by_ref_t;
typedef struct H5VL_loc_by_token {
void *token;
} H5VL_loc_by_token_t;
/* Structure to hold parameters for object locations.
* Either: BY_SELF, BY_NAME, BY_IDX, BY_REF, BY_TOKEN
* Either: BY_SELF, BY_NAME, BY_IDX, BY_TOKEN
*
* Note: Leave loc_by_token as the first union member so we
* can perform the simplest initialization of the struct
@ -236,11 +225,10 @@ typedef struct H5VL_loc_by_token {
typedef struct H5VL_loc_params_t {
H5I_type_t obj_type;
H5VL_loc_type_t type;
union{
union {
H5VL_loc_by_token_t loc_by_token;
H5VL_loc_by_name_t loc_by_name;
H5VL_loc_by_idx_t loc_by_idx;
H5VL_loc_by_ref_t loc_by_ref;
} loc_data;
} H5VL_loc_params_t;

View File

@ -16,7 +16,6 @@
*/
#define H5O_FRIEND /* Suppress error about including H5Opkg */
#define H5R_FRIEND /* Suppress error about including H5Rpkg */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
@ -25,7 +24,6 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Opkg.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Rpkg.h" /* References */
#include "H5VLprivate.h" /* Virtual Object Layer */
#include "H5VLnative_private.h" /* Native VOL connector */
@ -79,26 +77,6 @@ H5VL__native_object_open(void *obj, const H5VL_loc_params_t *loc_params, H5I_typ
break;
}
case H5VL_OBJECT_BY_REF:
{
hid_t temp_id = H5I_INVALID_HID;
H5F_t *file = NULL;
/* Get the file pointer from the entry */
file = loc.oloc->file;
/* Create reference */
if((temp_id = H5R__dereference(file, loc_params->loc_data.loc_by_ref.lapl_id,
loc_params->loc_data.loc_by_ref.ref_type,
loc_params->loc_data.loc_by_ref._ref)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTOPENOBJ, NULL, "unable to dereference object")
*opened_type = H5I_get_type(temp_id);
if(NULL == (ret_value = H5I_remove(temp_id)))
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to open object")
break;
}
case H5VL_OBJECT_BY_SELF:
default:
HGOTO_ERROR(H5E_VOL, H5E_UNSUPPORTED, NULL, "unknown open parameters")
@ -166,53 +144,6 @@ H5VL__native_object_get(void *obj, const H5VL_loc_params_t *loc_params, H5VL_obj
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file or file object")
switch(get_type) {
/* H5Rget_region */
case H5VL_REF_GET_REGION:
{
hid_t *ret = HDva_arg(arguments, hid_t *);
H5R_type_t H5_ATTR_UNUSED ref_type = (H5R_type_t)HDva_arg(arguments, int); /* enum work-around */
void *ref = HDva_arg(arguments, void *);
H5S_t *space = NULL; /* Dataspace object */
/* Get the dataspace with the correct region selected */
if((space = H5R__get_region(loc.oloc->file, ref)) == NULL)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to retrieve region")
/* Atomize */
if((*ret = H5I_register(H5I_DATASPACE, space, TRUE)) < 0)
HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace atom")
break;
}
/* H5Rget_obj_type1/2 */
case H5VL_REF_GET_TYPE:
{
H5O_type_t *obj_type = HDva_arg(arguments, H5O_type_t *);
H5R_type_t ref_type = (H5R_type_t)HDva_arg(arguments, int); /* enum work-around */
void *ref = HDva_arg(arguments, void *);
/* Get the object information */
if(H5R__get_obj_type(loc.oloc->file, ref_type, ref, obj_type) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object type")
break;
}
/* H5Rget_name */
case H5VL_REF_GET_NAME:
{
ssize_t *ret = HDva_arg(arguments, ssize_t *);
char *name = HDva_arg(arguments, char *);
size_t size = HDva_arg(arguments, size_t);
H5R_type_t ref_type = (H5R_type_t)HDva_arg(arguments, int); /* enum work-around */
void *ref = HDva_arg(arguments, void *);
/* Get name */
if((*ret = H5R__get_name(loc.oloc->file, ref_type, ref, name, size)) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTGET, FAIL, "unable to determine object path")
break;
}
/* Object name */
case H5VL_OBJECT_GET_NAME:
{
@ -401,24 +332,6 @@ H5VL__native_object_specific(void *obj, const H5VL_loc_params_t *loc_params, H5V
break;
}
case H5VL_REF_CREATE:
{
void *ref = HDva_arg(arguments, void *);
const char *name = HDva_arg(arguments, char *);
H5R_type_t ref_type = (H5R_type_t)HDva_arg(arguments, int); /* enum work-around */
hid_t space_id = HDva_arg(arguments, hid_t);
H5S_t *space = NULL; /* Pointer to dataspace containing region */
if(space_id != (-1) && (NULL == (space = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Create reference */
if(H5R__create(ref, &loc, name, ref_type, space) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCREATE, FAIL, "unable to create reference")
break;
}
default:
HGOTO_ERROR(H5E_VOL, H5E_CANTGET, FAIL, "can't recognize this operation type")
} /* end switch */

View File

@ -2958,15 +2958,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
H5VL_object_get_t get = (H5VL_object_get_t)HDva_arg(ap, int);
switch(get) {
case H5VL_REF_GET_REGION:
HDfprintf(out, "H5VL_REF_GET_REGION");
break;
case H5VL_REF_GET_TYPE:
HDfprintf(out, "H5VL_REF_GET_TYPE");
break;
case H5VL_REF_GET_NAME:
HDfprintf(out, "H5VL_REF_GET_NAME");
break;
case H5VL_OBJECT_GET_NAME:
HDfprintf(out, "H5VL_OBJECT_GET_NAME");
break;
@ -3002,9 +2993,6 @@ H5_trace(const double *returning, const char *func, const char *type, ...)
case H5VL_OBJECT_VISIT:
HDfprintf(out, "H5VL_OBJECT_VISIT");
break;
case H5VL_REF_CREATE:
HDfprintf(out, "H5VL_REF_CREATE");
break;
case H5VL_OBJECT_FLUSH:
HDfprintf(out, "H5VL_OBJECT_FLUSH");
break;