diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-06-11 22:00:40 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2012-06-11 22:00:40 (GMT) |
commit | f31fac3a23da12287384db7f6aa2937e9461d3fe (patch) | |
tree | a24a0a6e33f7289e5c525504e95fdce29599b2d7 /src/H5O.c | |
parent | 217c553b95358bfb0c41bf54df4f7596055cc9af (diff) | |
download | hdf5-f31fac3a23da12287384db7f6aa2937e9461d3fe.zip hdf5-f31fac3a23da12287384db7f6aa2937e9461d3fe.tar.gz hdf5-f31fac3a23da12287384db7f6aa2937e9461d3fe.tar.bz2 |
[svn-r22452] - remove nrefs param
- create a struct to hold parameters for object locations instead of calling into VOL to lookup and free object:
* update the implementation for H5Oopen(_by_name/idx/ref)
* H5Rderefence
* H5Aopen(_by_name), H5Arename(_by_name)
* other routines coming later
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 48 |
1 files changed, 15 insertions, 33 deletions
@@ -227,9 +227,8 @@ H5O_init_interface(void) hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) { + H5VL_loc_params_t loc_params; hid_t ret_value = FAIL; - void *location = NULL; /* a pointer to VOL specific token that indicates - the location of the object */ FUNC_ENTER_API(FAIL) H5TRACE3("i", "i*si", loc_id, name, lapl_id); @@ -237,21 +236,14 @@ H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id) if(!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, &location, H5_REQUEST_NULL, name, lapl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_NAME; + loc_params.loc_data.loc_by_name.name = name; /* Open the object through the VOL */ - if((ret_value = H5VL_object_open_by_loc(loc_id, location, lapl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_object_open(loc_id, loc_params, lapl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object") done: - if (NULL != location) { - /* free the location token through the VOL */ - if(H5VL_object_free_loc (loc_id, location, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token") - } - FUNC_LEAVE_API(ret_value) } /* end H5Oopen() */ @@ -283,7 +275,7 @@ hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id) { - void *location = NULL; + H5VL_loc_params_t loc_params; hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) @@ -302,21 +294,17 @@ H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, if(TRUE != H5P_isa_class(lapl_id, H5P_LINK_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not link access property list ID") - /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_IDX, &location, H5_REQUEST_NULL, group_name, - idx_type, order, n, lapl_id) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_IDX; + loc_params.loc_data.loc_by_idx.name = group_name; + loc_params.loc_data.loc_by_idx.idx_type = idx_type; + loc_params.loc_data.loc_by_idx.order = order; + loc_params.loc_data.loc_by_idx.n = n; /* Open the object through the VOL */ - if((ret_value = H5VL_object_open_by_loc(loc_id, location, lapl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_object_open(loc_id, loc_params, lapl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object") done: - if (NULL != location) { - /* free the location token through the VOL */ - if(H5VL_object_free_loc (loc_id, location, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token") - } FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_idx() */ @@ -360,26 +348,20 @@ hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr) { hid_t lapl_id = H5P_LINK_ACCESS_DEFAULT; /* lapl to use to open this object */ - void *location = NULL; + H5VL_loc_params_t loc_params; hid_t ret_value = FAIL; FUNC_ENTER_API(FAIL) H5TRACE2("i", "ia", loc_id, addr); - /* Get the token for the Object location through the VOL */ - if(H5VL_object_lookup (loc_id, H5VL_OBJECT_LOOKUP_BY_ADDR, &location, H5_REQUEST_NULL, addr) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object") + loc_params.type = H5VL_OBJECT_LOOKUP_BY_ADDR; + loc_params.loc_data.loc_by_addr.addr = addr; /* Open the object through the VOL */ - if((ret_value = H5VL_object_open_by_loc(loc_id, location, lapl_id, H5_REQUEST_NULL)) < 0) + if((ret_value = H5VL_object_open(loc_id, loc_params, lapl_id, H5_REQUEST_NULL)) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to open object") done: - if (NULL != location) { - /* free the location token through the VOL */ - if(H5VL_object_free_loc (loc_id, location, H5_REQUEST_NULL) < 0) - HGOTO_ERROR(H5E_SYM, H5E_CANTRELEASE, FAIL, "unable to free location token") - } FUNC_LEAVE_API(ret_value) } /* end H5Oopen_by_addr() */ |