summaryrefslogtreecommitdiffstats
path: root/src/H5Oshared.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-11-13 21:45:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-11-13 21:45:35 (GMT)
commitf494ab7674dc39225deb4a06ba211f82f3e9df5e (patch)
tree55d6b6ace03aa2063c0569466d9ef474fcf66487 /src/H5Oshared.c
parent3f7dc01ccc7f9702c3a4080afe0c2ddebf34c032 (diff)
downloadhdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.zip
hdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.tar.gz
hdf5-f494ab7674dc39225deb4a06ba211f82f3e9df5e.tar.bz2
[svn-r12906] Description:
Straighten out some convoluted code when links were being deleted, which could cause the "delete" callback for user-defined links to not get called when the group they were in was deleted. Had to compromise on the "delete" callback though - only calls the callback with the ID for the file the link is in, instead of the group, since the group is being held open upstream in the calling sequence during a group deletion and this prevents a group and its ID from being created. (This could possibly be worked around, but would cause a fair bit of havoc in the code and I'm not entirely certain it's worth it...) Tested on: Linux/32 2.6 (chicago)
Diffstat (limited to 'src/H5Oshared.c')
-rw-r--r--src/H5Oshared.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 7c69ab9..e90031d 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -42,7 +42,8 @@ static void *H5O_shared_decode (H5F_t*, hid_t dxpl_id, const uint8_t*);
static herr_t H5O_shared_encode (H5F_t*, uint8_t*, const void*);
static void *H5O_shared_copy(const void *_mesg, void *_dest, unsigned update_flags);
static size_t H5O_shared_size (const H5F_t*, const void *_mesg);
-static herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link);
+static herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg,
+ hbool_t adj_link);
static herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, const void *_mesg);
static herr_t H5O_shared_pre_copy_file(H5F_t *file_src, const H5O_msg_class_t *type,
void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *_udata);
@@ -512,16 +513,17 @@ H5O_shared_size (const H5F_t *f, const void *_mesg)
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
+H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg,
+ hbool_t adj_link)
{
const H5O_shared_t *shared = (const H5O_shared_t *) _mesg;
- herr_t ret_value=SUCCEED; /* Return value */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5O_shared_delete);
+ FUNC_ENTER_NOAPI_NOINIT(H5O_shared_delete)
/* check args */
- assert(f);
- assert(shared);
+ HDassert(f);
+ HDassert(shared);
/*
* Committed datatypes increment the OH of the original message when they
@@ -534,7 +536,7 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
/* Decrement the reference count on the shared object, if requested */
if(adj_link)
- if(H5O_shared_link_adj(f, dxpl_id, shared, -1)<0)
+ if(H5O_shared_link_adj(f, dxpl_id, shared, -1) < 0)
HGOTO_ERROR (H5E_OHDR, H5E_LINKCOUNT, FAIL, "unable to adjust shared object link count")
/* JAMES */
@@ -542,7 +544,7 @@ H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link)
H5O_loc_free(&(shared->oloc));
*/
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_shared_delete() */