summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 21:43:25 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2012-05-18 21:43:25 (GMT)
commit748b630b2b0451f7305918d25244e5a5fddc1f11 (patch)
tree13ec0181f9807b042b385c708dd0fbb78f3aa5d9 /src/H5A.c
parentdc1343a0d3300ae537adbdc4c0b8f342f37e09e4 (diff)
downloadhdf5-748b630b2b0451f7305918d25244e5a5fddc1f11.zip
hdf5-748b630b2b0451f7305918d25244e5a5fddc1f11.tar.gz
hdf5-748b630b2b0451f7305918d25244e5a5fddc1f11.tar.bz2
[svn-r22381] add a VL free location callback and use it as appropriate
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 3017e7f..2c361dc 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -338,8 +338,9 @@ H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
done:
if (NULL != location) {
- free (location);
- location = NULL;
+ /* 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)
} /* H5Acreate_by_name() */
@@ -611,8 +612,9 @@ H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
done:
if (NULL != location) {
- free (location);
- location = NULL;
+ /* 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)
} /* H5Aopen_by_name() */
@@ -1694,8 +1696,9 @@ done:
HDONE_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't close attribute")
if(NULL != location) {
- free (location);
- location = NULL;
+ /* 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 H5Aget_info_by_name() */
@@ -1868,7 +1871,6 @@ herr_t
H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name,
const char *new_attr_name, hid_t lapl_id)
{
- void *location = NULL;
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_API(FAIL)
@@ -1892,6 +1894,8 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name,
/* Avoid thrashing things if the names are the same */
if(HDstrcmp(old_attr_name, new_attr_name)) {
+ void *location = NULL;
+
/* Get the token for the Object location through the VOL */
if(H5VL_object_lookup(loc_id, H5VL_OBJECT_LOOKUP_BY_NAME, H5_REQUEST_NULL, &location, obj_name, lapl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to locate object")
@@ -1899,13 +1903,15 @@ H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name,
/* get the attribute info through the VOL */
if(H5VL_object_generic(loc_id, H5VL_ATTR_RENAME, H5_REQUEST_NULL, location, old_attr_name, new_attr_name) < 0)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTGET, FAIL, "unable to get attribute info")
+
+ 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")
+ }
} /* end if */
done:
- if(NULL != location) {
- free (location);
- location = NULL;
- }
FUNC_LEAVE_API(ret_value)
} /* H5Arename_by_name() */
@@ -2091,6 +2097,11 @@ done:
HDONE_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "unable to close temporary object")
} /* end if */
+ 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)
} /* H5Aiterate_by_name() */
@@ -2181,8 +2192,9 @@ H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
done:
if(NULL != location) {
- free (location);
- location = NULL;
+ /* 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)
} /* H5Adelete_by_name() */
@@ -2247,8 +2259,9 @@ H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type,
done:
if(NULL != location) {
- free (location);
- location = NULL;
+ /* 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)
} /* H5Adelete_by_idx() */
@@ -2634,8 +2647,9 @@ H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name,
done:
if(NULL != location) {
- free (location);
- location = NULL;
+ /* 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)
} /* H5Aexists_by_name() */