diff options
Diffstat (limited to 'src/H5FScache.c')
-rw-r--r-- | src/H5FScache.c | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/src/H5FScache.c b/src/H5FScache.c index aa061bc..470f42e 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -84,7 +84,7 @@ static void *H5FS__cache_hdr_deserialize(const void *image, size_t len, static herr_t H5FS__cache_hdr_image_len(const void *thing, size_t *image_len); static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags); -static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, +static herr_t H5FS__cache_hdr_serialize(const H5F_t *f, void *image, size_t len, void *thing); static herr_t H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *thing); static herr_t H5FS__cache_hdr_free_icr(void *thing); @@ -240,7 +240,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, +H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -302,8 +302,8 @@ H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, /* Expand percent */ UINT16DECODE(image, fspace->expand_percent); - /* Size of address space free space sections are within - * (log2 of actual value) + /* Size of address space free space sections are within + * (log2 of actual value) */ UINT16DECODE(image, fspace->max_sect_addr); @@ -377,20 +377,20 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_hdr_pre_serialize * - * Purpose: The free space manager header contains the address, size, and + * Purpose: The free space manager header contains the address, size, and * allocation size of the free space manager section info. However, * since it is possible for the section info to either not be allocated * at all, or be allocated in temporary (AKA imaginary) files space, * it is possible for the above mentioned fields to contain giberish * when the free space manager header is serialized. * - * This function exists to prevent this problem. It does so by + * This function exists to prevent this problem. It does so by * forcing allocation of real file space for the section information. * * Note that in the Version 2 cache, this problem was dealt with by * simply flushing the section info before flushing the header. This - * was possible, since the clients handled file I/O directly. As - * this responsibility has moved to the cache in Version 3, this + * was possible, since the clients handled file I/O directly. As + * this responsibility has moved to the cache in Version 3, this * solution is no longer directly applicable. * * Return: Success: SUCCEED @@ -401,7 +401,7 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len, unsigned *flags) @@ -432,23 +432,23 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Set the ring type for the section info in the API context */ H5AC_set_ring(ring, &orig_ring); - /* This implies that the header "owns" the section info. + /* This implies that the header "owns" the section info. * - * Unfortunately, the comments in the code are not clear as to + * Unfortunately, the comments in the code are not clear as to * what this means, but from reviewing the code (most particularly - * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I - * gather that it means that the header is maintaining a pointer to - * an instance of H5FS_sinfo_t in which free space data is + * H5FS_close(), H5FS_sinfo_lock, and H5FS_sinfo_unlock()), I + * gather that it means that the header is maintaining a pointer to + * an instance of H5FS_sinfo_t in which free space data is * maintained, and either: * * 1) The instance of H5FS_sinfo_t is not in the metadata cache. * - * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) + * This will be TRUE iff H5F_addr_defined(fspace->sect_addr) * is FALSE, and fspace->sinfo is not NULL. This is sometimes * referred to as "floating" section info in the comments. * - * If the section info structure contains free space data - * that must be placed on disk eventually, then + * If the section info structure contains free space data + * that must be placed on disk eventually, then * * fspace->serial_sect_count > 0 * @@ -457,57 +457,57 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, * H5F_addr_defined(fspace->addr) * * will both be TRUE. If this contition does not hold, then - * either the free space info is not persistent - * (!H5F_addr_defined(fspace->addr)???) or the section info - * contains no free space data that must be written to file + * either the free space info is not persistent + * (!H5F_addr_defined(fspace->addr)???) or the section info + * contains no free space data that must be written to file * ( fspace->serial_sect_count == 0 ). * * 2) The instance of H5FS_sinfo_t is in the metadata cache with * address in temporary file space (AKA imaginary file space). - * The entry may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * The entry may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * * 3) The instance of H5FS_sinfo_t is in the metadata cache with * address in real file space. As in case 2) above, the entry - * may or may not be protected, and if protected, it - * may be protected either RW or RO (as indicated by + * may or may not be protected, and if protected, it + * may be protected either RW or RO (as indicated by * fspace->sinfo_protected and fspace->sinfo_accmod). * - * Observe that fspace->serial_sect_count > 0 must be TRUE in - * cases 2) and 3), as the section info should not be stored on + * Observe that fspace->serial_sect_count > 0 must be TRUE in + * cases 2) and 3), as the section info should not be stored on * disk if it doesn't exist. Similarly, since the section info - * will not be stored to disk unless the header is, + * will not be stored to disk unless the header is, * H5F_addr_defined(fspace->addr) must hold as well. * * As the objective is to touch up the free space manager header - * so that it contains sensical data on the size and location of + * so that it contains sensical data on the size and location of * the section information, we have to handle each of the above * cases differently. * - * Case 1) If either fspace->serial_sect_count == 0 or - * ! H5F_addr_defined(fspace->addr) do nothing as either - * the free space manager data is not persistent, or the + * Case 1) If either fspace->serial_sect_count == 0 or + * ! H5F_addr_defined(fspace->addr) do nothing as either + * the free space manager data is not persistent, or the * section info is empty. * * Otherwise, allocate space for the section info in real - * file space, insert the section info at this location, and - * set fspace->sect_addr, fspace->sect_size, and + * file space, insert the section info at this location, and + * set fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location * of the section info. Note that it is not necessary to * force a write of the section info. * * Case 2) Allocate space for the section info in real file space, - * and tell the metadata cache to relocate the entry. - * Update fspace->sect_addr, fspace->sect_size, and + * and tell the metadata cache to relocate the entry. + * Update fspace->sect_addr, fspace->sect_size, and * fspace->alloc_sect_size to reflect the new location. * * Case 3) Nothing to be done in this case, although it is useful * to perform sanity checks. * - * Note that while we may alter the contents of the free space - * header in cases 1) and 2), there is no need to mark the header - * as dirty, as the metadata cache would not be attempting to + * Note that while we may alter the contents of the free space + * header in cases 1) and 2), there is no need to mark the header + * as dirty, as the metadata cache would not be attempting to * serialize the header if it thought it was clean. */ if(fspace->serial_sect_count > 0 && H5F_addr_defined(fspace->addr)) { @@ -535,7 +535,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, HDassert(fspace->sinfo->cache_info.size == fspace->alloc_sect_size); - /* the metadata cache is now managing the section info, + /* the metadata cache is now managing the section info, * so set fspace->sinfo to NULL. */ fspace->sinfo = NULL; @@ -584,11 +584,11 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, } /* end else */ } /* end if */ else if(H5F_addr_defined(fspace->sect_addr)) { - /* Here the metadata cache is managing the section info. + /* Here the metadata cache is managing the section info. * - * Do some sanity checks, and then test to see if the section - * info is in real file space. If it isn't relocate it into - * real file space lest the header be written to file with + * Do some sanity checks, and then test to see if the section + * info is in real file space. If it isn't relocate it into + * real file space lest the header be written to file with * a nonsense section info address. */ if(!H5F_POINT_OF_NO_RETURN(f)) { @@ -601,12 +601,12 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, unsigned sect_status = 0; haddr_t new_sect_addr; - /* we have work to do -- must relocate section info into + /* we have work to do -- must relocate section info into * real file space. * * Since the section info address is in temporary space (AKA - * imaginary space), it follows that the entry must be in - * cache. Further, since fspace->sinfo is NULL, it must be + * imaginary space), it follows that the entry must be in + * cache. Further, since fspace->sinfo is NULL, it must be * unprotected and un-pinned. Start by verifying this. */ if(H5AC_get_entry_status(f, fspace->sect_addr, §_status) < 0) @@ -632,7 +632,7 @@ H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, /* Update the internal address for the section info */ fspace->sect_addr = new_sect_addr; - /* No need to mark the header dirty, as we are about to + /* No need to mark the header dirty, as we are about to * serialize it. */ } /* end if */ @@ -660,7 +660,7 @@ done: * * Purpose: Given an instance of H5FS_t and a suitably sized buffer, * serialize the contents of the instance of H5FS_t and write - * its contents to the buffer. This buffer will be used to + * its contents to the buffer. This buffer will be used to * write the image of the instance to file. * * Return: Success: SUCCEED @@ -690,20 +690,20 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); HDassert(fspace->hdr_size == len); - /* The section information does not always exits, and if it does, - * it is not always in the cache. To make matters more interesting, + /* The section information does not always exits, and if it does, + * it is not always in the cache. To make matters more interesting, * even if it is in the cache, it may not be in real file space. * - * The pre-serialize function should have moved the section info + * The pre-serialize function should have moved the section info * into real file space if necessary before this function was called. * The following asserts are a cursory check on this. */ HDassert((! H5F_addr_defined(fspace->sect_addr)) || (! H5F_IS_TMP_ADDR(f, fspace->sect_addr))); if(!H5F_POINT_OF_NO_RETURN(f)) - HDassert((! H5F_addr_defined(fspace->sect_addr)) || - ((fspace->serial_sect_count > 0) && - (fspace->sect_size > 0) && + HDassert((! H5F_addr_defined(fspace->sect_addr)) || + ((fspace->serial_sect_count > 0) && + (fspace->sect_size > 0) && (fspace->alloc_sect_size == (size_t)fspace->sect_size))); /* Magic number */ @@ -737,8 +737,8 @@ H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, /* Expand percent */ UINT16ENCODE(image, fspace->expand_percent); - /* Size of address space free space sections are within (log2 of - * actual value) + /* Size of address space free space sections are within (log2 of + * actual value) */ UINT16ENCODE(image, fspace->max_sect_addr); @@ -787,7 +787,7 @@ H5FS__cache_hdr_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(fspace); @@ -872,7 +872,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_get_initial_load_size() * - * Purpose: Compute the size of the on disk image of the free space + * Purpose: Compute the size of the on disk image of the free space * manager section info, and place this value in *image_len. * * Return: Success: SUCCEED @@ -883,7 +883,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_get_initial_load_size(void *_udata, size_t *image_len) { const H5FS_t *fspace; /* free space manager */ @@ -1136,9 +1136,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_pre_serialize * - * Purpose: The objective of this function is to test to see if file space - * for the section info is located in temporary (AKA imaginary) file - * space. If it is, relocate file space for the section info to + * Purpose: The objective of this function is to test to see if file space + * for the section info is located in temporary (AKA imaginary) file + * space. If it is, relocate file space for the section info to * regular file space. * * Return: Success: SUCCEED @@ -1149,7 +1149,7 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) { @@ -1225,8 +1225,8 @@ done: * Function: H5FS__cache_sinfo_serialize * * Purpose: Given an instance of H5FS_sinfo_t and a suitably sized buffer, - * serialize the contents of the instance of H5FS_sinfo_t and write - * its contents to the buffer. This buffer will be used to write + * serialize the contents of the instance of H5FS_sinfo_t and write + * its contents to the buffer. This buffer will be used to write * the image of the instance to file. * * Return: Success: SUCCEED @@ -1237,7 +1237,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thing) { @@ -1322,7 +1322,7 @@ H5FS__cache_sinfo_notify(H5AC_notify_action_t action, void *_thing) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT - + /* Sanity check */ HDassert(sinfo); @@ -1370,7 +1370,7 @@ done: /*------------------------------------------------------------------------- * Function: H5FS__cache_sinfo_free_icr * - * Purpose: Free the memory used for the in core representation of the + * Purpose: Free the memory used for the in core representation of the * free space manager section info. * * Note: The metadata cache sets the object's cache_info.magic to @@ -1385,7 +1385,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FS__cache_sinfo_free_icr(void *_thing) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ |