diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-13 21:45:35 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-11-13 21:45:35 (GMT) |
commit | f494ab7674dc39225deb4a06ba211f82f3e9df5e (patch) | |
tree | 55d6b6ace03aa2063c0569466d9ef474fcf66487 /src/H5Olayout.c | |
parent | 3f7dc01ccc7f9702c3a4080afe0c2ddebf34c032 (diff) | |
download | hdf5-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/H5Olayout.c')
-rw-r--r-- | src/H5Olayout.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c index a420301..3b4d7e5 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -38,7 +38,8 @@ static void *H5O_layout_copy(const void *_mesg, void *_dest, unsigned update_fla static size_t H5O_layout_size(const H5F_t *f, const void *_mesg); static herr_t H5O_layout_reset(void *_mesg); static herr_t H5O_layout_free(void *_mesg); -static herr_t H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t adj_link); +static herr_t H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, + hbool_t adj_link); static void *H5O_layout_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *mesg_src, H5F_t *file_dst, hid_t dxpl_id, H5O_copy_t *cpy_info, void *udata); static herr_t H5O_layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, @@ -567,16 +568,17 @@ H5O_layout_free (void *_mesg) *------------------------------------------------------------------------- */ static herr_t -H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t UNUSED adj_link) +H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, + hbool_t UNUSED adj_link) { - const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; - herr_t ret_value=SUCCEED; /* Return value */ + const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5O_layout_delete); + FUNC_ENTER_NOAPI_NOINIT(H5O_layout_delete) /* check args */ - assert(f); - assert(mesg); + HDassert(f); + HDassert(mesg); /* Perform different actions, depending on the type of storage */ switch(mesg->type) { @@ -586,13 +588,13 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t UNUSED adj case H5D_CONTIGUOUS: /* Contiguous block on disk */ /* Free the file space for the raw data */ - if (H5D_contig_delete(f, dxpl_id, mesg)<0) + if(H5D_contig_delete(f, dxpl_id, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_CHUNKED: /* Chunked blocks on disk */ /* Free the file space for the raw data */ - if (H5D_istore_delete(f, dxpl_id, mesg)<0) + if(H5D_istore_delete(f, dxpl_id, mesg) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; @@ -601,7 +603,7 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg, hbool_t UNUSED adj } /* end switch */ done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_layout_delete() */ |