diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-13 04:17:14 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2006-08-13 04:17:14 (GMT) |
commit | 23d1007926379cc0ff896bedf325215e0d101e1c (patch) | |
tree | 998b56a6ba84e5261f6b244d1da0d98fa67d6763 /src/H5HF.c | |
parent | 2ffaed7e7f54ad789b9a6000d1bbac4121076620 (diff) | |
download | hdf5-23d1007926379cc0ff896bedf325215e0d101e1c.zip hdf5-23d1007926379cc0ff896bedf325215e0d101e1c.tar.gz hdf5-23d1007926379cc0ff896bedf325215e0d101e1c.tar.bz2 |
[svn-r12572] Description:
Refactor new heap's header creation code to be all in the H5HFhdr.c
module.
Tested on:
FreeBSD 4.11 (sleipnir)
Linux/64 2.4 (mir)
Solaris/64 2.9 (shanti)
Diffstat (limited to 'src/H5HF.c')
-rw-r--r-- | src/H5HF.c | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -100,7 +100,7 @@ H5HF_t * H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) { H5HF_t *fh = NULL; /* Pointer to new fractal heap */ - H5HF_hdr_t *hdr = NULL; /* The new fractal heap header information */ + H5HF_hdr_t *hdr = NULL; /* The fractal heap header information */ haddr_t hdr_addr; /* Heap header address */ H5HF_t *ret_value; /* Return value */ @@ -112,26 +112,10 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) HDassert(f); HDassert(cparam); - /* Allocate & basic initialization for the shared header */ - if(NULL == (hdr = H5HF_hdr_alloc(f))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate space for shared heap info") - - /* Allocate space for the header on disk */ - if(HADDR_UNDEF == (hdr_addr = H5MF_alloc(f, H5FD_MEM_FHEAP_HDR, dxpl_id, (hsize_t)H5HF_HEADER_SIZE(hdr)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for fractal heap header") - /* Initialize shared fractal heap header */ /* (This routine is only called for newly created heaps) */ - if(H5HF_hdr_init(hdr, hdr_addr, cparam) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't initialize shared fractal heap header") - -#ifdef QAK -HDfprintf(stderr, "%s: hdr->id_len = %Zu\n", FUNC, hdr->id_len); -#endif /* QAK */ - - /* Cache the new fractal heap header */ - if(H5AC_set(f, dxpl_id, H5AC_FHEAP_HDR, hdr_addr, hdr, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't add fractal heap header to cache") + if(HADDR_UNDEF == (hdr_addr = H5HF_hdr_create(f, dxpl_id, cparam))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINIT, NULL, "can't create fractal heap header") /* Create fractal heap wrapper */ if(NULL == (fh = H5FL_MALLOC(H5HF_t))) @@ -165,8 +149,6 @@ done: if(!ret_value) { if(fh) (void)H5HF_close(fh, dxpl_id); - else if(hdr) - (void)H5HF_cache_hdr_dest(f, hdr); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) |