From 9b60a446b369bf13be70eba14b6a450cf03cf891 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 13 Apr 2003 23:39:11 -0500 Subject: [svn-r6649] Purpose: Bug fix. Description: Corrected fencepost error which was incorrectly checking for merging metadata at the front of the metadata accumulator. This now allows the metadata cache to cache I/O operations more efficiently. Platforms tested: FreeBSD 4.8 (sleipnir) w/C++ Linux 2.4 (burrwhite) w/FORTRAN Solaris 2.7 (arabica) w/FORTRAN IRIX64 6.5 (modi4) w/parallel & FORTRAN (h5committest not run due to my ongoing difficulties with C++ on burrwhite). --- src/H5FD.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/H5FD.c b/src/H5FD.c index 08c241c..ccc95eb 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -2268,10 +2268,12 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si * Truncate it if this is true. */ if(file->cls->get_eoa) { haddr_t eoa; + eoa = file->cls->get_eoa(file); if(eoa == (last->addr+last->size)) { if(file->cls->set_eoa(file, last->addr) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "set end of space allocation request failed"); + /* Remove this free block from the list */ file->fl[mapped_type] = last->next; if(file->maxsize==last->size) @@ -2984,7 +2986,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si /* Check if the piece of metadata being written adjoins or is inside the metadata accumulator */ if((addr>=file->accum_loc && addr<=(file->accum_loc+file->accum_size)) || ((addr+size)>file->accum_loc && (addr+size)<=(file->accum_loc+file->accum_size)) - || (addraccum_loc && (addr+size)>file->accum_loc)) { + || (addraccum_loc && (addr+size)>=file->accum_loc)) { /* Check if the new metadata adjoins the beginning of the current accumulator */ if((addr+size)==file->accum_loc) { -- cgit v0.12