summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-04-06 19:05:46 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-04-06 19:05:46 (GMT)
commita148f6e443cf2419eb37897eec48c175cf824611 (patch)
treecaea6e010263fd2bbcef479200b08a04279e2215
parentea4271a3944e905ac2f4f5130e1e54df03e52ad6 (diff)
downloadhdf5-a148f6e443cf2419eb37897eec48c175cf824611.zip
hdf5-a148f6e443cf2419eb37897eec48c175cf824611.tar.gz
hdf5-a148f6e443cf2419eb37897eec48c175cf824611.tar.bz2
[svn-r18518] Description:
Bring metadata journaling branch into closer correspondence with trunk: extract data structure freeing routines from metadata cache client 'destroy' callbacks. Tested on: Mac OS X/32 10.6.3 (amazon) w/debug (h5committest not required on this branch)
-rw-r--r--src/H5HL.c2
-rwxr-xr-xsrc/H5SM.c16
-rw-r--r--src/H5SMcache.c24
-rwxr-xr-xsrc/H5SMpkg.h6
4 files changed, 27 insertions, 21 deletions
diff --git a/src/H5HL.c b/src/H5HL.c
index 5090c4d..13b3b0e 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -1242,7 +1242,7 @@ H5HL_heapsize(H5F_t *f, hid_t dxpl_id, haddr_t addr, hsize_t *heap_size)
/* Get the pointer to the heap */
heap = prfx->heap;
- /* Compute the size of the local heap */
+ /* Accumulate the size of the local heap */
*heap_size += (hsize_t)(heap->prfx_size + heap->dblk_size);
done:
diff --git a/src/H5SM.c b/src/H5SM.c
index 7dd8050..287236a 100755
--- a/src/H5SM.c
+++ b/src/H5SM.c
@@ -2340,7 +2340,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5SM_table_dest
+ * Function: H5SM_table_free
*
* Purpose: Frees memory used by the SOHM table.
*
@@ -2352,9 +2352,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5SM_table_dest(H5SM_master_table_t *table)
+H5SM_table_free(H5SM_master_table_t *table)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_dest)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_free)
/* Sanity check */
HDassert(table);
@@ -2365,11 +2365,11 @@ H5SM_table_dest(H5SM_master_table_t *table)
H5FL_FREE(H5SM_master_table_t, table);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5SM_table_dest() */
+} /* end H5SM_table_free() */
/*-------------------------------------------------------------------------
- * Function: H5SM_list_dest
+ * Function: H5SM_list_free
*
* Purpose: Frees all memory used by the list.
*
@@ -2381,9 +2381,9 @@ H5SM_table_dest(H5SM_master_table_t *table)
*-------------------------------------------------------------------------
*/
herr_t
-H5SM_list_dest(H5SM_list_t *list)
+H5SM_list_free(H5SM_list_t *list)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_dest)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_free)
HDassert(list);
HDassert(list->messages);
@@ -2393,7 +2393,7 @@ H5SM_list_dest(H5SM_list_t *list)
H5FL_FREE(H5SM_list_t, list);
FUNC_LEAVE_NOAPI(SUCCEED)
-} /* end H5SM_list_dest() */
+} /* end H5SM_list_free() */
/*-------------------------------------------------------------------------
diff --git a/src/H5SMcache.c b/src/H5SMcache.c
index e245b9b..5feddc5 100644
--- a/src/H5SMcache.c
+++ b/src/H5SMcache.c
@@ -221,7 +221,7 @@ H5SM_table_deserialize(haddr_t UNUSED addr, size_t UNUSED len,
done:
/* Release resources */
if(!ret_value && table)
- (void)H5SM_table_dest(table);
+ (void)H5SM_table_free(table);
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_table_deserialize() */
@@ -332,16 +332,19 @@ H5SM_table_serialize(const H5F_t * f, hid_t UNUSED dxlp_id, haddr_t UNUSED addr,
static herr_t
H5SM_table_free_icr(haddr_t UNUSED addr, size_t UNUSED len, void *thing)
{
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_table_free_icr)
+ FUNC_ENTER_NOAPI_NOINIT(H5SM_table_free_icr)
/* Check arguments */
HDassert(thing);
- /* Destroy Shared Object Header Message */
- H5SM_table_dest(thing);
+ /* Destroy Shared Object Header Message table */
+ if(H5SM_table_free(thing) < 0)
+ HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message table")
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_table_free_icr() */
@@ -528,14 +531,17 @@ done:
static herr_t
H5SM_list_free_icr(haddr_t UNUSED addr, size_t UNUSED len, void *thing)
{
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SM_list_free_icr)
+ FUNC_ENTER_NOAPI_NOINIT(H5SM_list_free_icr)
/* Check arguments */
HDassert(thing);
- /* Destroy Shared Object Header Message */
- H5SM_list_dest(thing);
+ /* Destroy Shared Object Header Message list */
+ if(H5SM_list_free(thing) < 0)
+ HGOTO_ERROR(H5E_SOHM, H5E_CANTRELEASE, FAIL, "unable to free shared message list")
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5SM_list_free_icr() */
diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h
index 242257e..fadf416 100755
--- a/src/H5SMpkg.h
+++ b/src/H5SMpkg.h
@@ -268,9 +268,9 @@ H5_DLL herr_t H5SM_btree_convert_to_list_op(const void * record, void *op_data);
/* Fractal heap 'op' callback to compute hash value for message "in place" */
H5_DLL herr_t H5SM_get_hash_fh_cb(const void *obj, size_t obj_len, void *_udata);
-herr_t H5SM_table_dest(H5SM_master_table_t * table);
-
-herr_t H5SM_list_dest(H5SM_list_t * list);
+/* Routines to release data structures */
+herr_t H5SM_table_free(H5SM_master_table_t *table);
+herr_t H5SM_list_free(H5SM_list_t *list);
/* Testing functions */
#ifdef H5SM_TESTING