diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-08-22 03:08:43 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-08-22 03:08:43 (GMT) |
commit | de324a50f8e5cc2e07595232dc33908e6560d490 (patch) | |
tree | 398e4df5c250cccba28d06ddfb0443a1d6c71b42 /src/H5HFhuge.c | |
parent | ab7d724ffd5749c1e3666fd1be0b92f41613af1e (diff) | |
download | hdf5-de324a50f8e5cc2e07595232dc33908e6560d490.zip hdf5-de324a50f8e5cc2e07595232dc33908e6560d490.tar.gz hdf5-de324a50f8e5cc2e07595232dc33908e6560d490.tar.bz2 |
[svn-r27549] Description:
Update the file format debugging routines to match the recent changes to
the metadata cache, along with a few other cleanups and miscellaneous
enhancements.
Tested on:
MacOSX/64 10.10.5 (amazon)
(h5committest forthcoming)
Diffstat (limited to 'src/H5HFhuge.c')
-rw-r--r-- | src/H5HFhuge.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 7f0da02..04cd425 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -585,6 +585,93 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF__huge_get_obj_off + * + * Purpose: Get the offset of a 'huge' object in a fractal heap + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Aug 8 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF__huge_get_obj_off(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id, + hsize_t *obj_off_p) +{ + haddr_t obj_addr; /* Object's address in the file */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + HDassert(id); + HDassert(obj_off_p); + + /* Skip over the flag byte */ + id++; + + /* Check if 'huge' object ID encodes address & length directly */ + if(hdr->huge_ids_direct) { + /* Retrieve the object's address (common) */ + H5F_addr_decode(hdr->f, &id, &obj_addr); + } /* end if */ + else { + /* Sanity check */ + HDassert(H5F_addr_defined(hdr->huge_bt2_addr)); + + /* Check if v2 B-tree is open yet */ + if(NULL == hdr->huge_bt2) { + /* Open existing v2 B-tree */ + if(NULL == (hdr->huge_bt2 = H5B2_open(hdr->f, dxpl_id, hdr->huge_bt2_addr, hdr->f))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTOPENOBJ, FAIL, "unable to open v2 B-tree for tracking 'huge' heap objects") + } /* end if */ + + if(hdr->filter_len > 0) { + H5HF_huge_bt2_filt_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_filt_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_filt_indir_found, &found_rec) != TRUE) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") + + /* Retrieve the object's address & length */ + obj_addr = found_rec.addr; + } /* end if */ + else { + H5HF_huge_bt2_indir_rec_t found_rec; /* Record found from tracking object */ + H5HF_huge_bt2_indir_rec_t search_rec; /* Record for searching for object */ + + /* Get ID for looking up 'huge' object in v2 B-tree */ + UINT64DECODE_VAR(id, search_rec.id, hdr->huge_id_size) + + /* Look up object in v2 B-tree */ + if(H5B2_find(hdr->huge_bt2, dxpl_id, &search_rec, H5HF_huge_bt2_indir_found, &found_rec) != TRUE) + HGOTO_ERROR(H5E_HEAP, H5E_NOTFOUND, FAIL, "can't find object in B-tree") + + /* Retrieve the object's address & length */ + obj_addr = found_rec.addr; + } /* end else */ + } /* end else */ + + /* Set the value to return */ + *obj_off_p = (hsize_t)obj_addr; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF__huge_get_obj_off() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_huge_op_real * * Purpose: Internal routine to perform an operation on a 'huge' object |