summaryrefslogtreecommitdiffstats
path: root/src/H5Gstab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Gstab.c')
-rw-r--r--src/H5Gstab.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index ab40fad..7dfb5ae 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -33,7 +33,6 @@
/* User data for finding link information from B-tree */
typedef struct {
/* downward */
- H5F_t *file; /* Pointer to file for query */
const char *name; /* Name to search for */
H5HL_t *heap; /* Local heap for group */
@@ -56,6 +55,7 @@ typedef struct H5G_bt_it_gnbi_t {
typedef struct H5G_bt_it_gtbi_t {
/* downward */
H5G_bt_it_idx_common_t common; /* Common information for "by index" lookup */
+ H5F_t *f; /* Pointer to file that symbol table is in */
hid_t dxpl_id; /* DXPL for operation */
/* upward */
@@ -136,7 +136,7 @@ H5G_stab_create_components(H5F_t *f, H5O_stab_t *stab, size_t size_hint, hid_t d
done:
/* Release resources */
- if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0)
+ if(heap && H5HL_unprotect(f, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -250,7 +250,7 @@ H5G_stab_insert_real(H5F_t *f, H5O_stab_t *stab, const char *name,
done:
/* Release resources */
- if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0)
+ if(heap && H5HL_unprotect(f, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -343,7 +343,7 @@ H5G_stab_remove(H5O_loc_t *loc, hid_t dxpl_id, H5RS_str_t *grp_full_path_r,
done:
/* Release resources */
- if(heap && H5HL_unprotect(loc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(loc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -401,7 +401,7 @@ H5G_stab_remove_by_idx(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5RS_str_t *grp_full_
done:
/* Release resources */
- if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
/* Reset the link information, if we have a copy */
@@ -453,7 +453,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab)
HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to delete symbol table B-tree")
/* Release resources */
- if(H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0)
+ if(H5HL_unprotect(f, heap) < 0)
HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
heap = NULL;
@@ -463,7 +463,7 @@ H5G_stab_delete(H5F_t *f, hid_t dxpl_id, const H5O_stab_t *stab)
done:
/* Release resources */
- if(heap && H5HL_unprotect(f, dxpl_id, heap, stab->heap_addr) < 0)
+ if(heap && H5HL_unprotect(f, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -553,7 +553,7 @@ H5G_stab_iterate(const H5O_loc_t *oloc, hid_t dxpl_id, H5_iter_order_t order,
done:
/* Release resources */
- if(heap && H5HL_unprotect(oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
if(ltable.lnks && H5G_link_release_table(&ltable) < 0)
HDONE_ERROR(H5E_SYM, H5E_CANTFREE, FAIL, "unable to release link table")
@@ -677,7 +677,7 @@ H5G_stab_get_name_by_idx_cb(const H5G_entry_t *ent, void *_udata)
/* Get name offset in heap */
name_off = ent->name_off;
- name = (const char *)H5HL_offset_into(udata->common.f, udata->heap, name_off);
+ name = (const char *)H5HL_offset_into(udata->heap, name_off);
HDassert(name);
udata->name = H5MM_strdup(name);
HDassert(udata->name);
@@ -734,7 +734,6 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n,
} /* end if */
/* Set iteration information */
- udata.common.f = oloc->file;
udata.common.idx = n;
udata.common.num_objs = 0;
udata.common.op = H5G_stab_get_name_by_idx_cb;
@@ -761,7 +760,7 @@ H5G_stab_get_name_by_idx(H5O_loc_t *oloc, H5_iter_order_t order, hsize_t n,
done:
/* Release resources */
- if(heap && H5HL_unprotect(oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
/* Free the duplicated name */
@@ -797,7 +796,7 @@ H5G_stab_lookup_cb(const H5G_entry_t *ent, void *_udata)
/* Check for setting link info */
if(udata->lnk)
/* Convert the entry to a link */
- if(H5G_ent_to_link(udata->file, udata->lnk, udata->heap, ent, udata->name) < 0)
+ if(H5G_ent_to_link(udata->lnk, udata->heap, ent, udata->name) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link")
done:
@@ -844,7 +843,6 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk,
HGOTO_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to protect symbol table heap")
/* Set up user data to pass to 'find' operation callback */
- udata.file = grp_oloc->file;
udata.name = name;
udata.lnk = lnk;
udata.heap = heap;
@@ -861,7 +859,7 @@ H5G_stab_lookup(H5O_loc_t *grp_oloc, const char *name, H5O_link_t *lnk,
done:
/* Release resources */
- if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -896,11 +894,11 @@ H5G_stab_lookup_by_idx_cb(const H5G_entry_t *ent, void *_udata)
HDassert(udata && udata->heap);
/* Get a pointer to the link name */
- name = (const char *)H5HL_offset_into(udata->common.f, udata->heap, ent->name_off);
+ name = (const char *)H5HL_offset_into(udata->heap, ent->name_off);
HDassert(name);
/* Convert the entry to a link */
- if(H5G_ent_to_link(udata->common.f, udata->lnk, udata->heap, ent, name) < 0)
+ if(H5G_ent_to_link(udata->lnk, udata->heap, ent, name) < 0)
HGOTO_ERROR(H5E_SYM, H5E_CANTCONVERT, FAIL, "unable to convert symbol table entry to link")
udata->found = TRUE;
@@ -958,7 +956,6 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n,
} /* end if */
/* Set iteration information */
- udata.common.f = grp_oloc->file;
udata.common.idx = n;
udata.common.num_objs = 0;
udata.common.op = H5G_stab_lookup_by_idx_cb;
@@ -976,7 +973,7 @@ H5G_stab_lookup_by_idx(H5O_loc_t *grp_oloc, H5_iter_order_t order, hsize_t n,
done:
/* Release resources */
- if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1051,7 +1048,7 @@ H5G_stab_valid(H5O_loc_t *grp_oloc, hid_t dxpl_id, H5O_stab_t *alt_stab)
done:
/* Release resources */
- if(heap && H5HL_unprotect(grp_oloc->file, dxpl_id, heap, stab.heap_addr) < 0)
+ if(heap && H5HL_unprotect(grp_oloc->file, heap) < 0)
HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to unprotect symbol table heap")
FUNC_LEAVE_NOAPI(ret_value)
@@ -1098,7 +1095,7 @@ H5G_stab_get_type_by_idx_cb(const H5G_entry_t *ent, void *_udata)
H5O_type_t obj_type; /* Type of object at location */
/* Build temporary object location */
- tmp_oloc.file = udata->common.f;
+ tmp_oloc.file = udata->f;
HDassert(H5F_addr_defined(ent->header));
tmp_oloc.addr = ent->header;
@@ -1147,10 +1144,10 @@ H5G_stab_get_type_by_idx(H5O_loc_t *oloc, hsize_t idx, hid_t dxpl_id)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5G_UNKNOWN, "unable to determine local heap address")
/* Set iteration information */
- udata.common.f = oloc->file;
udata.common.idx = idx;
udata.common.num_objs = 0;
udata.common.op = H5G_stab_get_type_by_idx_cb;
+ udata.f = oloc->file;
udata.dxpl_id = dxpl_id;
udata.type = H5G_UNKNOWN;