mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
[svn-r18505] Description:
Move code to free superblock data structure into separate routine, in preparation for upcoming metadata journaling -> trunk merging. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.6.3 (amazon) in debug mode
This commit is contained in:
parent
0611a91263
commit
c2550f3454
@ -302,6 +302,7 @@ H5_DLL herr_t H5F_flush_mounts(H5F_t *f, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5F_super_init(H5F_t *f, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5F_super_read(H5F_t *f, hid_t dxpl_id);
|
||||
H5_DLL herr_t H5F_super_size(H5F_t *f, hid_t dxpl_id, hsize_t *super_size, hsize_t *super_ext_size);
|
||||
H5_DLL herr_t H5F_super_free(H5F_super_t *sblock);
|
||||
|
||||
/* Superblock extension related routines */
|
||||
H5_DLL herr_t H5F_super_ext_open(H5F_t *f, haddr_t ext_addr, H5O_loc_t *ext_ptr);
|
||||
|
@ -618,7 +618,8 @@ done:
|
||||
} /* end if */
|
||||
else
|
||||
/* Free superblock */
|
||||
sblock = (H5F_super_t *)H5FL_FREE(H5F_super_t, sblock);
|
||||
if(H5F_super_free(sblock) < 0)
|
||||
HDONE_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock")
|
||||
|
||||
/* Reset variables in file structure */
|
||||
f->shared->sblock = NULL;
|
||||
@ -662,6 +663,37 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5F_super_dirty() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_super_free
|
||||
*
|
||||
* Purpose: Destroyer the file's superblock
|
||||
*
|
||||
* Return: Success: non-negative on success
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* April 1, 2010
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5F_super_free(H5F_super_t *sblock)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_super_free)
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(sblock);
|
||||
|
||||
/* Free root group symbol table entry, if any */
|
||||
sblock->root_ent = (H5G_entry_t *)H5MM_xfree(sblock->root_ent);
|
||||
|
||||
/* Free superblock */
|
||||
sblock = (H5F_super_t *)H5FL_FREE(H5F_super_t, sblock);
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
} /* H5F_super_free() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5F_super_size
|
||||
|
@ -613,7 +613,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, const void UNUSED
|
||||
done:
|
||||
/* Release the [possibly partially initialized] superblock on errors */
|
||||
if(!ret_value && sblock)
|
||||
if(H5F_sblock_dest(f, sblock) < 0)
|
||||
if(H5F_super_free(sblock) < 0)
|
||||
HDONE_ERROR(H5E_FILE, H5E_CANTFREE, NULL, "unable to destroy superblock data")
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -840,18 +840,19 @@ done:
|
||||
static herr_t
|
||||
H5F_sblock_dest(H5F_t UNUSED *f, H5F_super_t* sblock)
|
||||
{
|
||||
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sblock_dest)
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI_NOINIT(H5F_sblock_dest)
|
||||
|
||||
/* Sanity check */
|
||||
HDassert(sblock);
|
||||
|
||||
/* Free root group symbol table entry, if any */
|
||||
sblock->root_ent = (H5G_entry_t *)H5MM_xfree(sblock->root_ent);
|
||||
|
||||
/* Free superblock */
|
||||
sblock = (H5F_super_t *)H5FL_FREE(H5F_super_t, sblock);
|
||||
if(H5F_super_free(sblock) < 0)
|
||||
HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "unable to destroy superblock")
|
||||
|
||||
FUNC_LEAVE_NOAPI(SUCCEED)
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5F_sblock_dest() */
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user