summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-01-09 20:07:04 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-01-09 20:07:04 (GMT)
commit26d2abe9e87a051cd897f77a4a472a432675db8c (patch)
tree383c964fd171906b9a447a183a386a0f75c80fd1 /src
parent03fc4bb6f3fe785a34d71de5da392c2a9d8a278e (diff)
downloadhdf5-26d2abe9e87a051cd897f77a4a472a432675db8c.zip
hdf5-26d2abe9e87a051cd897f77a4a472a432675db8c.tar.gz
hdf5-26d2abe9e87a051cd897f77a4a472a432675db8c.tar.bz2
[svn-r13128] Description:
More progress on address bugs in combinations of shared/committed/unshared components of shared/unshared attributes in compact/dense storage. (Yes, there are a lot of combinations. :-) Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src')
-rw-r--r--src/H5A.c10
-rw-r--r--src/H5Adense.c2
-rw-r--r--src/H5L.c3
-rw-r--r--src/H5O.c2
-rw-r--r--src/H5Oattr.c6
-rw-r--r--src/H5Oattribute.c10
-rw-r--r--src/H5Omessage.c2
-rwxr-xr-xsrc/H5SM.c2
8 files changed, 18 insertions, 19 deletions
diff --git a/src/H5A.c b/src/H5A.c
index 0b846d8..e4300d5 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -383,6 +383,16 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
attr->dt_size = H5O_msg_raw_size(attr->oloc.file, H5O_DTYPE_ID, attr->dt);
} /* end if */
else if(tri_ret > 0) {
+ /* Check whether datatype is committed & increment ref count */
+ /* (to maintain ref. count incr/decr similarity with "shared message"
+ * type of datatype sharing)
+ */
+ if(H5T_committed(attr->dt)) {
+ /* Increment the reference count on the shared datatype */
+ if(H5T_link(attr->dt, 1, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared datatype link count")
+ } /* end if */
+
/* Message is shared. Use size of shared message */
if(NULL == H5O_msg_get_share(H5O_DTYPE_ID, attr->dt, &sh_mesg))
HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "couldn't get size of shared message")
diff --git a/src/H5Adense.c b/src/H5Adense.c
index e4cf59e..972d80e 100644
--- a/src/H5Adense.c
+++ b/src/H5Adense.c
@@ -1302,7 +1302,7 @@ H5A_dense_delete_bt2_cb(const void *_record, void *_bt2_udata)
} /* end if */
else {
/* Perform the deletion action on the attribute */
- /* (takes care of shared & committed datatype/dataspace components) */
+ /* (takes care of shared/committed datatype & dataspace components) */
if(H5O_attr_delete(bt2_udata->f, bt2_udata->dxpl_id, fh_udata.attr, TRUE) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
} /* end else */
diff --git a/src/H5L.c b/src/H5L.c
index 045bba8..9a0a6ba 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -2096,9 +2096,8 @@ H5L_delete(H5G_loc_t *loc, const char *name, hid_t lapl_id, hid_t dxpl_id)
/* Set up user data for unlink operation */
udata.dxpl_id = dxpl_id;
-
if(H5G_traverse(loc, norm_name, H5G_TARGET_SLINK|H5G_TARGET_UDLINK|H5G_TARGET_MOUNT, H5L_delete_cb, &udata, lapl_id, dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_EXISTS, FAIL, "name doesn't exist")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTREMOVE, FAIL, "can't unlink object")
done:
/* Free the normalized path name */
diff --git a/src/H5O.c b/src/H5O.c
index 103352e..9470a7f 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -1400,7 +1400,7 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh)
/* Check for dense attribute storage & delete it if necessary */
if(oh->version > H5O_VERSION_1 && H5F_addr_defined(oh->attr_fheap_addr)) {
if(H5A_dense_delete(f, dxpl_id, oh) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete file space for object header message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "unable to delete dense attribute storage")
} /* end if */
/* Free main (first) object header "chunk" */
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index d8f4a1b..aae4858 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -54,7 +54,7 @@ const H5O_msg_class_t H5O_MSG_ATTR[1] = {{
H5O_attr_reset, /* reset method */
H5O_attr_free, /* free method */
H5O_attr_delete, /* file delete method */
- H5O_attr_link, /* link method */
+ NULL /* H5O_attr_link */, /* link method */
H5O_attr_get_share, /* get share method */
H5O_attr_set_share, /* set share method */
H5O_attr_is_shared, /*is shared method */
@@ -668,7 +668,7 @@ H5O_attr_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
if(NULL == H5O_msg_get_share(H5O_DTYPE_ID, attr->dt, &sh_mesg))
HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't get shared message from datatype")
if(H5SM_try_delete(f, dxpl_id, H5O_DTYPE_ID, &sh_mesg) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "can't remove datatype from SOHM heap")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTREMOVE, FAIL, "can't remove datatype from heap")
} /* end if */
if((tri_ret = H5O_msg_is_shared(H5O_SDSPACE_ID, attr->ds)) < 0)
@@ -678,7 +678,7 @@ H5O_attr_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
if(NULL == H5O_msg_get_share(H5O_SDSPACE_ID, attr->ds, &sh_mesg))
HGOTO_ERROR(H5E_ATTR, H5E_BADMESG, FAIL, "can't get shared message from dataspace")
if(H5SM_try_delete(f, dxpl_id, H5O_SDSPACE_ID, &sh_mesg) < 0)
- HGOTO_ERROR(H5E_ATTR, H5E_SOHM, FAIL, "can't remove dataspace from SOHM heap")
+ HGOTO_ERROR(H5E_ATTR, H5E_SOHM, FAIL, "can't remove dataspace from shared storage")
} /* end if */
/* Check whether datatype is shared */
diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c
index ea77e26..57cc4ae 100644
--- a/src/H5Oattribute.c
+++ b/src/H5Oattribute.c
@@ -241,16 +241,6 @@ HDfprintf(stderr, "%s: adding attribute, attr->name = '%s'\n", FUNC, attr->name)
/* Mark the message as shared */
mesg_flags |= H5O_MSG_FLAG_SHARED;
- /* Check whether datatype is committed */
- /* (to maintain ref. count incr/decr similarity with "shared message"
- * type of datatype sharing)
- */
- if(H5T_committed(attr->dt)) {
- /* Increment the reference count on the shared datatype */
- if(H5T_link(attr->dt, 1, dxpl_id) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared datatype link count")
- } /* end if */
-
/* Retrieve ref count for shared attribute */
if(H5SM_get_refcount(loc->file, dxpl_id, H5O_ATTR_ID, &attr->sh_loc, &attr_rc) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't retrieve shared message ref count")
diff --git a/src/H5Omessage.c b/src/H5Omessage.c
index 79631fe..bcb3e6e 100644
--- a/src/H5Omessage.c
+++ b/src/H5Omessage.c
@@ -1143,7 +1143,7 @@ H5O_msg_remove_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence,
else {
/* Convert message into a null message */
if(H5O_release_mesg(udata->f, udata->dxpl_id, oh, mesg, TRUE, udata->adj_link) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to convert into null message")
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, H5_ITER_ERROR, "unable to release message")
/* Indicate that the object header was modified */
*oh_flags_ptr |= H5AC__DIRTIED_FLAG;
diff --git a/src/H5SM.c b/src/H5SM.c
index 22ffc6d..4a6e106 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -1367,7 +1367,7 @@ done:
/* Free the serialized message buffer on error */
if(ret_value < 0 && *encoded_mesg)
- H5MM_xfree(*encoded_mesg);
+ *encoded_mesg = H5MM_xfree(*encoded_mesg);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_delete_from_index() */