diff options
Diffstat (limited to 'src/H5FSsection.c')
-rw-r--r-- | src/H5FSsection.c | 422 |
1 files changed, 123 insertions, 299 deletions
diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 59be78c..43213f0 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -12,10 +12,10 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Quincey Koziol <koziol@hdfgroup.org> + * Programmer: Quincey Koziol * Monday, July 31, 2006 * - * Purpose: Free space tracking functions. + * Purpose: Free space tracking functions. * */ @@ -96,14 +96,14 @@ H5FL_DEFINE(H5FS_sinfo_t); /*******************/ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_new + * Function: H5FS_sinfo_new * - * Purpose: Create new section info structure + * Purpose: Create new section info structure * - * Return: Success: non-NULL, pointer to new section info struct - * Failure: NULL + * Return: Success: non-NULL, pointer to new section info struct + * Failure: NULL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 31, 2006 * *------------------------------------------------------------------------- @@ -172,19 +172,18 @@ done: } /* H5FS_sinfo_new() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_lock + * Function: H5FS_sinfo_lock * - * Purpose: Make certain the section info for the free space manager is + * Purpose: Make certain the section info for the free space manager is * in memory. * * Either uses existing section info owned by the free space * header, loads section info from disk, or creates new section * info * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 7, 2008 * *------------------------------------------------------------------------- @@ -290,15 +289,14 @@ done: } /* H5FS_sinfo_lock() */ /*------------------------------------------------------------------------- - * Function: H5FS_sinfo_unlock + * Function: H5FS_sinfo_unlock * - * Purpose: Release the section info, either giving ownership back to + * Purpose: Release the section info, either giving ownership back to * the cache or letting the free space header keep it. * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Thursday, February 7, 2008 * *------------------------------------------------------------------------- @@ -368,6 +366,7 @@ H5FS_sinfo_unlock(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hbool_t modified) /* Check if the section info size in the file has changed */ if (fspace->sect_size != fspace->alloc_sect_size) cache_flags |= H5AC__DELETED_FLAG | H5AC__TAKE_OWNERSHIP_FLAG; + } /* end if */ /* Sanity check */ @@ -461,14 +460,13 @@ done: } /* H5FS_sinfo_unlock() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_serialize_size + * Function: H5FS_sect_serialize_size * - * Purpose: Determine serialized size of all sections in free space manager + * Purpose: Determine serialized size of all sections in free space manager * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 8, 2006 * *------------------------------------------------------------------------- @@ -480,16 +478,6 @@ H5FS_sect_serialize_size(H5FS_t *fspace) /* Check arguments. */ HDassert(fspace); -#ifdef QAK - HDfprintf(stderr, "%s: Check 1.0 - fspace->sect_size = %Hu\n", "H5FS_sect_serialize_size", - fspace->sect_size); - HDfprintf(stderr, "%s: fspace->serial_sect_count = %Zu\n", "H5FS_sect_serialize_size", - fspace->serial_sect_count); - HDfprintf(stderr, "%s: fspace->alloc_sect_size = %Hu\n", "H5FS_sect_serialize_size", - fspace->alloc_sect_size); - HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", - fspace->sinfo->serial_size_count); -#endif /* QAK */ /* Compute the size of the buffer required to serialize all the sections */ if (fspace->serial_sect_count > 0) { @@ -499,12 +487,6 @@ H5FS_sect_serialize_size(H5FS_t *fspace) sect_buf_size = fspace->sinfo->sect_prefix_size; /* Count for each differently sized serializable section */ -#ifdef QAK - HDfprintf(stderr, "%s: fspace->sinfo->serial_size_count = %Zu\n", "H5FS_sect_serialize_size", - fspace->sinfo->serial_size_count); - HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", "H5FS_sect_serialize_size", - fspace->serial_sect_count); -#endif /* QAK */ sect_buf_size += fspace->sinfo->serial_size_count * H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); @@ -531,15 +513,14 @@ H5FS_sect_serialize_size(H5FS_t *fspace) } /* H5FS_sect_serialize_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_increase + * Function: H5FS_sect_increase * - * Purpose: Increase the size of the serialized free space section info + * Purpose: Increase the size of the serialized free space section info * on disk * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 8, 2006 * *------------------------------------------------------------------------- @@ -572,10 +553,6 @@ H5FS_sect_increase(H5FS_t *fspace, const H5FS_section_class_t *cls, unsigned fla fspace->serial_sect_count++; /* Increment amount of space required to serialize all sections */ -#ifdef QAK - HDfprintf(stderr, "%s: sinfo->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); - HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size += cls->serial_size; /* Update the free space sections' serialized size */ @@ -591,16 +568,14 @@ done: } /* H5FS_sect_increase() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_decrease + * Function: H5FS_sect_decrease * - * Purpose: Decrease the size of the serialized free space section info + * Purpose: Decrease the size of the serialized free space section info * on disk * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, May 8, 2006 * *------------------------------------------------------------------------- @@ -633,10 +608,6 @@ H5FS_sect_decrease(H5FS_t *fspace, const H5FS_section_class_t *cls) fspace->serial_sect_count--; /* Decrement amount of space required to serialize all sections */ -#ifdef QAK - HDfprintf(stderr, "%s: fspace->serial_size = %Zu\n", FUNC, fspace->sinfo->serial_size); - HDfprintf(stderr, "%s: cls->serial_size = %Zu\n", FUNC, cls->serial_size); -#endif /* QAK */ fspace->sinfo->serial_size -= cls->serial_size; /* Update the free space sections' serialized size */ @@ -649,14 +620,13 @@ done: } /* H5FS_sect_decrease() */ /*------------------------------------------------------------------------- - * Function: H5FS_size_node_decr + * Function: H5FS_size_node_decr * - * Purpose: Decrement the number of sections of a particular size + * Purpose: Decrement the number of sections of a particular size * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -679,9 +649,6 @@ H5FS_size_node_decr(H5FS_sinfo_t *sinfo, unsigned bin, H5FS_node_t *fspace_node, * the bin's skiplist is also a skiplist...) */ sinfo->bins[bin].tot_sect_count--; -#ifdef QAK - HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ /* Check for 'ghost' or 'serializable' section */ if (cls->flags & H5FS_CLS_GHOST_OBJ) { @@ -737,15 +704,14 @@ done: } /* H5FS_size_node_decr() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_unlink_size + * Function: H5FS_sect_unlink_size * - * Purpose: Remove a section node from size tracking data structures for + * Purpose: Remove a section node from size tracking data structures for * a free space manager * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -790,17 +756,15 @@ done: } /* H5FS_sect_unlink_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_unlink_rest + * Function: H5FS_sect_unlink_rest * - * Purpose: Finish unlinking a section from the rest of the free space + * Purpose: Finish unlinking a section from the rest of the free space * manager's data structures, after the section has been removed * from the size tracking data structures * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -822,10 +786,6 @@ H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sect if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK - HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, - (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if (tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -835,10 +795,7 @@ H5FS_sect_unlink_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sect if (H5FS_sect_decrease(fspace, cls) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't increase free space section size on disk") - /* Decrement amount of free space managed */ -#ifdef QAK - HDfprintf(stderr, "%s: fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ + /* Decrement amount of free space managed */ fspace->tot_space -= sect->size; done: @@ -846,14 +803,13 @@ done: } /* H5FS_sect_unlink_rest() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_remove_real + * Function: H5FS_sect_remove_real * - * Purpose: Remove a section from the free space manager + * Purpose: Remove a section from the free space manager * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -888,14 +844,13 @@ done: } /* H5FS_sect_remove_real() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_remove + * Function: H5FS_sect_remove * - * Purpose: Remove a section from the free space manager + * Purpose: Remove a section from the free space manager * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -931,14 +886,13 @@ done: } /* H5FS_sect_remove() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_link_size + * Function: H5FS_sect_link_size * - * Purpose: Add a section of free space to the free list bins + * Purpose: Add a section of free space to the free list bins * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * *------------------------------------------------------------------------- @@ -952,9 +906,6 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT -#ifdef QAK - HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a\n", FUNC, sect->size, sect->addr); -#endif /* QAK */ /* Check arguments. */ HDassert(sinfo); @@ -969,10 +920,9 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s if (NULL == (sinfo->bins[bin].bin_list = H5SL_create(H5SL_TYPE_HSIZE, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't create skip list for free space nodes") } /* end if */ - else { + else /* Check for node list of the correct size already */ fspace_node = (H5FS_node_t *)H5SL_search(sinfo->bins[bin].bin_list, §->size); - } /* end else */ /* Check if we need to create a new skip list for nodes of this size */ if (fspace_node == NULL) { @@ -1000,9 +950,6 @@ H5FS_sect_link_size(H5FS_sinfo_t *sinfo, const H5FS_section_class_t *cls, H5FS_s /* (Different from the # of items in the bin's skiplist, since each node on * the bin's skiplist is also a skiplist...) */ -#ifdef QAK - HDfprintf(stderr, "%s: sinfo->bins[%u].sect_count = %Zu\n", FUNC, bin, sinfo->bins[bin].sect_count); -#endif /* QAK */ sinfo->bins[bin].tot_sect_count++; if (cls->flags & H5FS_CLS_GHOST_OBJ) { sinfo->bins[bin].ghost_sect_count++; @@ -1038,16 +985,14 @@ done: } /* H5FS_sect_link_size() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_link_rest + * Function: H5FS_sect_link_rest * - * Purpose: Link a section into the rest of the non-size tracking + * Purpose: Link a section into the rest of the non-size tracking * free space manager data structures * - * Return: Success: non-negative + * Return: SUCCEED/FAIL * - * Failure: negative - * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -1067,10 +1012,6 @@ H5FS_sect_link_rest(H5FS_t *fspace, const H5FS_section_class_t *cls, H5FS_sectio /* Add section to the address-ordered list of sections, if allowed */ if (!(cls->flags & H5FS_CLS_SEPAR_OBJ)) { -#ifdef QAK - HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, - (unsigned)sect->type); -#endif /* QAK */ if (fspace->sinfo->merge_list == NULL) if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, @@ -1092,15 +1033,13 @@ done: } /* H5FS_sect_link_rest() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_link - * - * Purpose: Link a section into the internal data structures + * Function: H5FS_sect_link * - * Return: Success: non-negative + * Purpose: Link a section into the internal data structures * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * *------------------------------------------------------------------------- @@ -1122,46 +1061,29 @@ H5FS_sect_link(H5FS_t *fspace, H5FS_section_info_t *sect, unsigned flags) cls = &fspace->sect_cls[sect->type]; /* Add section to size tracked data structures */ -#ifdef QAK - HDfprintf(stderr, "%s: Check 1.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ if (H5FS_sect_link_size(fspace->sinfo, cls, sect) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to size tracking data structures") -#ifdef QAK - HDfprintf(stderr, "%s: Check 2.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ /* Update rest of free space manager data structures for section addition */ if (H5FS_sect_link_rest(fspace, cls, sect, flags) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to non-size tracking data structures") -#ifdef QAK - HDfprintf(stderr, "%s: Check 3.0 - fspace->tot_space = %Hu\n", FUNC, fspace->tot_space); -#endif /* QAK */ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FS_sect_link() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_merge + * Function: H5FS_sect_merge * - * Purpose: Attempt to merge a returned free space section with existing + * Purpose: Attempt to merge a returned free space section with existing * free space. * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Wednesday, May 17, 2006 * - * Modifications: Vailin Choi; Sept 25th 2008 - * Changes to the "shrinking" part-- - * 1. Get last section node in merge-list instead of "less-than" - * node for further iteration - * 2. Remove "can-be-shrunk" section from free-space instead of - * "less-than" section - * *------------------------------------------------------------------------- */ static herr_t @@ -1284,10 +1206,6 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) } while (modified); } /* end if */ HDassert(*sect); -#ifdef QAK - HDfprintf(stderr, "%s: Done merging, (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, - (*sect)->type, ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); -#endif /* QAK */ /* Loop until no more shrinking */ do { @@ -1300,10 +1218,6 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) if ((status = (*sect_cls->can_shrink)(*sect, op_data)) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking container") if (status > 0) { -#ifdef QAK - HDfprintf(stderr, "%s: Can shrink!\n", FUNC); -#endif /* QAK */ - /* Remove SECT from free-space manager */ /* (only possible to happen on second+ pass through loop) */ if (remove_sect) { @@ -1347,33 +1261,18 @@ H5FS_sect_merge(H5FS_t *fspace, H5FS_section_info_t **sect, void *op_data) if (remove_sect && (*sect != NULL)) *sect = NULL; -#ifdef QAK - HDfprintf(stderr, "%s: Done shrinking\n", FUNC); - if (*sect) - HDfprintf(stderr, "%s: (*sect) = {%a, %Hu, %u, %s}\n", FUNC, (*sect)->addr, (*sect)->size, - (*sect)->type, - ((*sect)->state == H5FS_SECT_LIVE ? "H5FS_SECT_LIVE" : "H5FS_SECT_SERIALIZED")); - else - HDfprintf(stderr, "%s: *sect = %p\n", FUNC, *sect); -#endif /* QAK */ - done: -#ifdef QAK - HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); -#endif /* QAK */ FUNC_LEAVE_NOAPI(ret_value) } /* H5FS_sect_merge() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_add - * - * Purpose: Add a section of free space to the free list + * Function: H5FS_sect_add * - * Return: Success: non-negative + * Purpose: Add a section of free space to the free list * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * *------------------------------------------------------------------------- @@ -1407,10 +1306,9 @@ H5FS_sect_add(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_info_t *sect /* Call "add" section class callback, if there is one */ cls = &fspace->sect_cls[sect->type]; - if (cls->add) { + if (cls->add) if ((*cls->add)(sect, &flags, op_data) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "'add' section class callback failed") - } /* end if */ /* Check for merging returned space with existing section node */ if (flags & H5FS_ADD_RETURNED_SPACE) { @@ -1455,14 +1353,13 @@ done: } /* H5FS_sect_add() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_try_extend + * Function: H5FS_sect_try_extend * - * Purpose: Try to extend a block using space from a section on the free list + * Purpose: Try to extend a block using space from a section on the free list * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, January 8, 2008 * *------------------------------------------------------------------------- @@ -1587,23 +1484,16 @@ done: } /* H5FS_sect_try_extend() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_find_node + * Function: H5FS_sect_find_node * - * Purpose: Locate a section of free space (in existing free space list + * Purpose: Locate a section of free space (in existing free space list * bins) that is large enough to fulfill request. * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, March 20, 2006 * - * Modifications: - * Vailin Choi, July 29th, 2008 - * Modified to handle alignment by going through each bin to find - * a section that is big enough to fulfill "request+fragment for alignment" - * *------------------------------------------------------------------------- */ static htri_t @@ -1629,10 +1519,6 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) /* Determine correct bin which holds items of at least the section's size */ bin = H5VM_log2_gen(request); HDassert(bin < fspace->sinfo->nbins); -#ifdef QAK - HDfprintf(stderr, "%s: fspace->sinfo->nbins = %u\n", FUNC, fspace->sinfo->nbins); - HDfprintf(stderr, "%s: bin = %u\n", FUNC, bin); -#endif /* QAK */ alignment = fspace->alignment; if (!((alignment > 1) && (request >= fspace->threshold))) alignment = 0; /* no alignment */ @@ -1728,10 +1614,10 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) /* sanity check */ HDassert(split_sect->addr < (*node)->addr); HDassert(request <= (*node)->size); - } + } /* end if */ /* Indicate that we found a node for the request */ HGOTO_DONE(TRUE) - } + } /* end if */ /* Get the next section node in the list */ curr_sect_node = H5SL_next(curr_sect_node); @@ -1742,7 +1628,7 @@ H5FS_sect_find_node(H5FS_t *fspace, hsize_t request, H5FS_section_info_t **node) } /* end while of curr_size_node */ } /* else of alignment */ } /* if bin_list */ - /* Advance to next larger bin */ + /* Advance to next larger bin */ bin++; } while (bin < fspace->sinfo->nbins); @@ -1751,22 +1637,16 @@ done: } /* H5FS_sect_find_node() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_find + * Function: H5FS_sect_find * - * Purpose: Locate a section of free space (in existing free space list) that + * Purpose: Locate a section of free space (in existing free space list) that * is large enough to fulfill request. * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, March 7, 2006 * - * Modifications: - * Vailin Choi, July 29th 2008 - * Move H5FS_sect_unlink_rest() to H5FS_sect_find_node() - * *------------------------------------------------------------------------- */ htri_t @@ -1778,10 +1658,6 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK - HDfprintf(stderr, "%s: request = %Hu\n", FUNC, request); -#endif /* QAK */ - /* Check arguments. */ HDassert(fspace); HDassert(fspace->nclasses); @@ -1789,11 +1665,6 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se HDassert(node); /* Check for any sections on free space list */ -#ifdef QAK - HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); - HDfprintf(stderr, "%s: fspace->serial_sect_count = %Hu\n", FUNC, fspace->serial_sect_count); - HDfprintf(stderr, "%s: fspace->ghost_sect_count = %Hu\n", FUNC, fspace->ghost_sect_count); -#endif /* QAK */ if (fspace->tot_sect_count > 0) { /* Get a pointer to the section info */ if (H5FS_sinfo_lock(f, dxpl_id, fspace, H5AC_WRITE) < 0) @@ -1808,12 +1679,8 @@ H5FS_sect_find(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, hsize_t request, H5FS_se if (ret_value > 0) { /* Note that we've modified the section info */ sinfo_modified = TRUE; -#ifdef QAK - HDfprintf(stderr, "%s: (*node)->size = %Hu, (*node)->addr = %a, (*node)->type = %u\n", FUNC, - (*node)->size, (*node)->addr, (*node)->type); -#endif /* QAK */ - } - } /* end if */ + } /* end if */ + } /* end if */ done: /* Release the section info */ @@ -1827,16 +1694,14 @@ done: } /* H5FS_sect_find() */ /*------------------------------------------------------------------------- - * Function: H5FS_iterate_sect_cb + * Function: H5FS_iterate_sect_cb * - * Purpose: Skip list iterator callback to iterate over free space sections + * Purpose: Skip list iterator callback to iterate over free space sections * of a particular size * - * Return: Success: non-negative + * Return: SUCCEED/FAIL * - * Failure: negative - * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, May 13, 2006 * *------------------------------------------------------------------------- @@ -1864,16 +1729,14 @@ done: } /* H5FS_iterate_sect_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_iterate_node_cb + * Function: H5FS_iterate_node_cb * - * Purpose: Skip list iterator callback to iterate over free space sections + * Purpose: Skip list iterator callback to iterate over free space sections * in a bin * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, May 13, 2006 * *------------------------------------------------------------------------- @@ -1902,15 +1765,13 @@ done: } /* H5FS_iterate_node_cb() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_iterate + * Function: H5FS_sect_iterate * - * Purpose: Iterate over all the sections managed + * Purpose: Iterate over all the sections managed * - * Return: Success: non-negative + * Return: SUCCEED/FAIL * - * Failure: negative - * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Saturday, May 13, 2006 * *------------------------------------------------------------------------- @@ -1928,10 +1789,6 @@ H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, v HDassert(fspace); HDassert(op); -#ifdef QAK - HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", FUNC, fspace->tot_sect_count); -#endif /* QAK */ - /* Set up user data for iterator */ udata.fspace = fspace; udata.op = op; @@ -1947,9 +1804,6 @@ H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_operator_t op, v sinfo_valid = TRUE; /* Iterate over all the bins */ -#ifdef QAK - HDfprintf(stderr, "%s: Iterate over section bins\n", FUNC); -#endif /* QAK */ for (bin = 0; bin < fspace->sinfo->nbins; bin++) { /* Check if there are any sections in this bin */ if (fspace->sinfo->bins[bin].bin_list) { @@ -1969,14 +1823,13 @@ done: } /* H5FS_sect_iterate() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_stats + * Function: H5FS_sect_stats * - * Purpose: Retrieve info about the sections managed + * Purpose: Retrieve info about the sections managed * - * Return: Success: non-negative - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Tuesday, May 30, 2006 * *------------------------------------------------------------------------- @@ -1999,16 +1852,14 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) } /* H5FS_sect_stats() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_change_class + * Function: H5FS_sect_change_class * - * Purpose: Make appropriate adjustments to internal data structures when + * Purpose: Make appropriate adjustments to internal data structures when * a section changes class * - * Return: Success: non-negative - * - * Failure: negative + * Return: SUCCEED/FAIL * - * Programmer: Quincey Koziol + * Programmer: Quincey Koziol * Monday, July 10, 2006 * *------------------------------------------------------------------------- @@ -2039,10 +1890,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf old_class = sect->type; old_cls = &fspace->sect_cls[sect->type]; new_cls = &fspace->sect_cls[new_class]; -#ifdef QAK - HDfprintf(stderr, "%s: old_cls->flags = %x\n", FUNC, old_cls->flags); - HDfprintf(stderr, "%s: new_cls->flags = %x\n", FUNC, new_cls->flags); -#endif /* QAK */ /* Check if the section's class change will affect the # of serializable or ghost sections */ if ((old_cls->flags & H5FS_CLS_GHOST_OBJ) != (new_cls->flags & H5FS_CLS_GHOST_OBJ)) { @@ -2055,9 +1902,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf to_ghost = FALSE; else to_ghost = TRUE; -#ifdef QAK - HDfprintf(stderr, "%s: to_ghost = %u\n", FUNC, to_ghost); -#endif /* QAK */ /* Sanity check */ HDassert(fspace->sinfo->bins); @@ -2121,16 +1965,9 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf to_mergable = TRUE; else to_mergable = FALSE; -#ifdef QAK - HDfprintf(stderr, "%s: to_mergable = %u\n", FUNC, to_mergable); -#endif /* QAK */ /* Add or remove section from merge list, as appropriate */ if (to_mergable) { -#ifdef QAK - HDfprintf(stderr, "%s: inserting object into merge list, sect->type = %u\n", FUNC, - (unsigned)sect->type); -#endif /* QAK */ if (fspace->sinfo->merge_list == NULL) if (NULL == (fspace->sinfo->merge_list = H5SL_create(H5SL_TYPE_HADDR, NULL))) HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, @@ -2142,10 +1979,6 @@ H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_section_inf else { H5FS_section_info_t *tmp_sect_node; /* Temporary section node */ -#ifdef QAK - HDfprintf(stderr, "%s: removing object from merge list, sect->type = %u\n", FUNC, - (unsigned)sect->type); -#endif /* QAK */ tmp_sect_node = (H5FS_section_info_t *)H5SL_remove(fspace->sinfo->merge_list, §->addr); if (tmp_sect_node == NULL || tmp_sect_node != sect) HGOTO_ERROR(H5E_FSPACE, H5E_NOTFOUND, FAIL, "can't find section node on size list") @@ -2174,15 +2007,14 @@ done: #ifdef H5FS_DEBUG_ASSERT /*------------------------------------------------------------------------- - * Function: H5FS_sect_assert + * Function: H5FS_sect_assert * - * Purpose: Verify that the sections managed are mostly sane + * Purpose: Verify that the sections managed are mostly sane * - * Return: Non-negative on success, negative on failure + * Return: void * - * Programmer: Quincey Koziol - * koziol@hdfgroup.org - * Jul 17 2006 + * Programmer: Quincey Koziol + * Jul 17 2006 * *------------------------------------------------------------------------- */ @@ -2192,9 +2024,6 @@ H5FS_sect_assert(const H5FS_t *fspace) hsize_t separate_obj; /* The number of separate objects managed */ FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifdef QAK - HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count); -#endif /* QAK */ /* Initialize state */ separate_obj = 0; @@ -2251,10 +2080,6 @@ H5FS_sect_assert(const H5FS_t *fspace) /* Get section node & it's class */ sect = H5SL_item(curr_sect_node); cls = &fspace->sect_cls[sect->type]; -#ifdef QAK - HDfprintf(stderr, "%s: sect->size = %Hu, sect->addr = %a, sect->type = %u\n", - "H5FS_assert", sect->size, sect->addr, sect->type); -#endif /* QAK */ /* Sanity check section */ HDassert(H5F_addr_defined(sect->addr)); @@ -2325,15 +2150,14 @@ H5FS_sect_assert(const H5FS_t *fspace) #endif /* H5FS_DEBUG_ASSERT */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_try_shrink_eoa + * Function: H5FS_sect_try_shrink_eoa * - * Purpose: To shrink the last section on the merge list if the section - * is at EOF. + * Purpose: To shrink the last section on the merge list if the section + * is at EOF. * - * Return: Success: non-negative (TRUE/FALSE) - * Failure: negative + * Return: TRUE/FALSE/FAIL * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * *------------------------------------------------------------------------- */ @@ -2395,14 +2219,14 @@ done: } /* H5FS_sect_try_shrink_eoa() */ /*------------------------------------------------------------------------- - * Function: H5FS_sect_query_last_sect + * Function: H5FS_sect_query_last_sect * - * Purpose: Retrieve info about the last section on the merge list + * Purpose: Retrieve info about the last section on the merge list * - * Return: Success: non-negative - * Failure: negative + * Return: Success: non-negative + * Failure: negative * - * Programmer: Vailin Choi + * Programmer: Vailin Choi * *------------------------------------------------------------------------- */ |