summaryrefslogtreecommitdiffstats
path: root/src/H5Abtree2.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-12-12 20:28:48 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-12-12 20:28:48 (GMT)
commite9522de4e1ec02209673fb45378d1525cd723949 (patch)
tree181a6d2310d48598eda000bd18853c83e922f258 /src/H5Abtree2.c
parent6bf1f234f273937911e61e54d5218c0664048f05 (diff)
downloadhdf5-e9522de4e1ec02209673fb45378d1525cd723949.zip
hdf5-e9522de4e1ec02209673fb45378d1525cd723949.tar.gz
hdf5-e9522de4e1ec02209673fb45378d1525cd723949.tar.bz2
[svn-r13056] Description:
Add H5SM_type_shared() internal routine to determine if a particular type of header message is sharable in a file. Correct off-by-one error in computing B-tree record size for densely stored attributes' name index. Further progress toward supporting shared attributes in dense storage. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5Abtree2.c')
-rw-r--r--src/H5Abtree2.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/H5Abtree2.c b/src/H5Abtree2.c
index 47cbaae..dc2478e 100644
--- a/src/H5Abtree2.c
+++ b/src/H5Abtree2.c
@@ -148,10 +148,9 @@ H5A_dense_fh_name_cmp(const void *obj, size_t UNUSED obj_len, void *_udata)
udata->cmp = HDstrcmp(udata->name, attr->name);
/* Check for correct attribute & callback to make */
- if(udata->cmp == 0 && udata->found_op) {
+ if(udata->cmp == 0 && udata->found_op)
if((udata->found_op)(attr, udata->found_op_data) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTOPERATE, FAIL, "attribute found callback failed")
- } /* end if */
done:
/* Release the space allocated for the attrbute */
@@ -250,6 +249,7 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
HGOTO_DONE(1)
else {
H5A_fh_ud_cmp_t fh_udata; /* User data for fractal heap 'op' callback */
+ H5HF_t *fheap; /* Fractal heap handle to use for finding object */
herr_t status; /* Status from fractal heap 'op' routine */
/* Sanity check */
@@ -267,14 +267,14 @@ H5A_dense_btree2_name_compare(const void *_bt2_udata, const void *_bt2_rec)
fh_udata.cmp = 0;
/* Check for attribute in shared storage */
- if(bt2_rec->flags) {
-HDfprintf(stderr, "%s: Shared dense storage for attributes not supported yet!\n", "H5A_dense_btree2_name_compare");
-HDassert(0 && "Shared dense storage for attributes not supported yet!");
- } /* end if */
+ if(bt2_rec->flags)
+ fheap = bt2_udata->shared_fheap;
+ else
+ fheap = bt2_udata->fheap;
+ HDassert(fheap);
/* Check if the user's link and the B-tree's link have the same name */
- status = H5HF_op(bt2_udata->fheap, bt2_udata->dxpl_id, bt2_rec->id,
- H5A_dense_fh_name_cmp, &fh_udata);
+ status = H5HF_op(fheap, bt2_udata->dxpl_id, bt2_rec->id, H5A_dense_fh_name_cmp, &fh_udata);
HDassert(status >= 0);
/* Callback will set comparison value */
@@ -308,8 +308,8 @@ H5A_dense_btree2_name_encode(const H5F_t UNUSED *f, uint8_t *raw, const void *_n
/* Encode the record's fields */
UINT32ENCODE(raw, nrecord->hash)
- HDmemcpy(raw, nrecord->id, (size_t)H5A_DENSE_FHEAP_ID_LEN);
*raw++ = nrecord->flags;
+ HDmemcpy(raw, nrecord->id, (size_t)H5A_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_encode() */
@@ -337,8 +337,8 @@ H5A_dense_btree2_name_decode(const H5F_t UNUSED *f, const uint8_t *raw, void *_n
/* Decode the record's fields */
UINT32DECODE(raw, nrecord->hash)
- HDmemcpy(nrecord->id, raw, (size_t)H5A_DENSE_FHEAP_ID_LEN);
nrecord->flags = *raw++;
+ HDmemcpy(nrecord->id, raw, (size_t)H5A_DENSE_FHEAP_ID_LEN);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5A_dense_btree2_name_decode() */