/* Initialize creation information for free space manager */
fspace->client = fs_create->client;
fspace->shrink_percent = fs_create->shrink_percent;
fspace->expand_percent = fs_create->expand_percent;
fspace->max_sect_addr = fs_create->max_sect_addr;
fspace->max_sect_size = fs_create->max_sect_size;
fspace->alignment = alignment;
fspace->threshold = threshold;
/* Check if the free space tracker is supposed to be persistant */
/* Check if the free space tracker is supposed to be persistent */
/* Allocate space for the free space header */
if(HADDR_UNDEF == (fspace->addr = H5MF_alloc(f, H5FD_MEM_FSPACE_HDR, dxpl_id, (hsize_t)fspace->hdr_size)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "file allocation failed for free space header")
/* Cache the new free space header (pinned) */
if(H5AC_insert_entry(f, dxpl_id, H5AC_FSPACE_HDR, fspace->addr, fspace, H5AC__PIN_ENTRY_FLAG) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, NULL, "can't add free space header to cache")
/* Return free space header address to caller, if desired */
/* Check if section info is valid */
/* (i.e. the header "owns" the section info and it's not in the cache) */
HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu, fspace->serial_sect_count = %Hu, fspace->sect_addr = %a, fspace->rc = %u\n", FUNC, fspace->tot_sect_count, fspace->serial_sect_count, fspace->sect_addr, fspace->rc);
HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu, fspace->sect_size = %Hu\n", FUNC, fspace->alloc_sect_size, fspace->sect_size);
/* If there are sections to serialize, update them */
/* (if the free space manager is persistant) */
/* (if the free space manager is persistent) */
if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) {
HDfprintf(stderr, "%s: Real sections to store in file\n", FUNC);
if(fspace->sinfo->dirty) {
/* Check if the section info is "floating" */
if(!H5F_addr_defined(fspace->sect_addr)) {
HDassert(fspace->sect_size > 0);
herr_t ret_value = SUCCEED; /* Return value */
HDfprintf(stderr, "%s: Marking free space header as dirty\n", FUNC);
/* Check if the free space manager is persistant */
/* Check if the free space manager is persistent */
if(H5F_addr_defined(fspace->addr))
/* Mark header as dirty in cache */
if(H5AC_mark_entry_dirty(fspace) < 0)
HGOTO_ERROR(H5E_FSPACE, H5E_CANTMARKDIRTY, FAIL, "unable to mark free space header as dirty")
FUNC_LEAVE_NOAPI(ret_value)