summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5FDcore.c87
1 files changed, 15 insertions, 72 deletions
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index 5ce6560..f29e231 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -203,9 +203,6 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end)
haddr_t a_addr = 0;
hbool_t create_new_node = TRUE;
herr_t ret_value = SUCCEED;
-#ifdef DER
- hbool_t was_adjusted = FALSE;
-#endif
FUNC_ENTER_STATIC
@@ -213,34 +210,15 @@ H5FD__core_add_dirty_region(H5FD_core_t *file, haddr_t start, haddr_t end)
HDassert(file->dirty_list);
HDassert(start <= end);
-#ifdef DER
-fprintf(stderr, "Add region: (%llu, %llu)\n", start, end);
-#endif
-
/* Adjust the dirty region to the nearest block boundaries */
- if(start % file->bstore_page_size != 0) {
+ if(start % file->bstore_page_size != 0)
start = (start / file->bstore_page_size) * file->bstore_page_size;
-#ifdef DER
- was_adjusted = TRUE;
-#endif
- }
+
if(end % file->bstore_page_size != (file->bstore_page_size - 1)) {
end = (((end / file->bstore_page_size) + 1) * file->bstore_page_size) - 1;
- if(end > file->eof){
-#ifdef DER
-fprintf(stderr, "Adjusted to EOF\n");
-#endif
+ if(end > file->eof)
end = file->eof - 1;
- }
-#ifdef DER
- was_adjusted = TRUE;
-#endif
- }
-
-#ifdef DER
-if(was_adjusted)
- fprintf(stderr, "Adjusted region: (%llu, %llu)\n", start, end);
-#endif
+ } /* end if */
/* Get the regions before and after the intended insertion point */
b_addr = start +1;
@@ -249,15 +227,13 @@ if(was_adjusted)
a_item = (H5FD_core_region_t *)H5SL_less(file->dirty_list, &a_addr);
/* Check to see if we need to extend the upper end of the NEW region */
- if(a_item) {
+ if(a_item)
if(start < a_item->start && end < a_item->end) {
-
/* Extend the end of the NEW region to match the existing AFTER region */
end = a_item->end;
- }
- }
+ } /* end if */
/* Attempt to extend the PREV region */
- if(b_item) {
+ if(b_item)
if(start <= b_item->end + 1) {
/* Need to set this for the delete algorithm */
@@ -267,8 +243,7 @@ if(was_adjusted)
* just update an existing one instead.
*/
create_new_node = FALSE;
- }
- }
+ } /* end if */
/* Remove any old nodes that are no longer needed */
while(a_item && a_item->start > start) {
@@ -286,7 +261,7 @@ if(was_adjusted)
/* Set up to check the next node */
if(less)
a_item = less;
- }
+ } /* end while */
/* Insert the new node */
if(create_new_node) {
@@ -297,17 +272,17 @@ if(was_adjusted)
item->end = end;
if(H5SL_insert(file->dirty_list, item, &item->start) < 0)
HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't insert new dirty region: (%llu, %llu)\n", (unsigned long long)start, (unsigned long long)end)
- }
+ } /* end if */
else {
/* Store the new item endpoint if it's bigger */
item->end = (item->end < end) ? end : item->end;
- }
- }
+ } /* end else */
+ } /* end if */
else {
/* Update the size of the before region */
if(b_item->end < end)
b_item->end = end;
- }
+ } /* end else */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -336,20 +311,13 @@ H5FD__core_destroy_dirty_list(H5FD_core_t *file)
if(file->dirty_list) {
H5FD_core_region_t *region = NULL;
-#ifdef DER
-{
-size_t count = H5SL_count(file->dirty_list);
-if(count != 0)
- fprintf(stderr, "LIST NOT EMPTY AT DESTROY\n");
-}
-#endif
while(NULL != (region = (H5FD_core_region_t *)H5SL_remove_first(file->dirty_list)))
region = H5FL_FREE(H5FD_core_region_t, region);
if(H5SL_close(file->dirty_list) < 0)
HGOTO_ERROR(H5E_SLIST, H5E_CLOSEERROR, FAIL, "can't close core vfd dirty list")
file->dirty_list = NULL;
- }
+ } /* end if */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -394,14 +362,8 @@ H5FD__core_write_to_bstore(H5FD_core_t *file, haddr_t addr, size_t size)
else
bytes_in = (h5_posix_io_t)size;
-#ifdef DER
-fprintf(stderr, "\nNEW\n");
-#endif
do {
bytes_wrote = HDwrite(file->fd, ptr, bytes_in);
-#ifdef DER
-fprintf(stderr, "bytes wrote: %lu\n", bytes_wrote);
-#endif
} while(-1 == bytes_wrote && EINTR == errno);
if(-1 == bytes_wrote) { /* error */
@@ -844,9 +806,6 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
if(use_write_tracking) {
if(NULL == (file->dirty_list = H5SL_create(H5SL_TYPE_HADDR, NULL)))
HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, NULL, "can't create core vfd dirty region list");
-#ifdef DER
-fprintf(stderr, "\n");
-#endif
} /* end if */
} /* end if */
@@ -1350,9 +1309,6 @@ H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UN
H5FD_core_region_t *item = NULL;
size_t size;
-#ifdef DER
- fprintf(stderr, "FLUSHING. DIRTY LIST:\n");
-#endif
while(NULL != (item = (H5FD_core_region_t *)H5SL_remove_first(file->dirty_list))) {
/* The file may have been truncated, so check for that
@@ -1362,11 +1318,8 @@ H5FD__core_flush(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UN
if(item->end >= file->eof)
item->end = file->eof - 1;
-
size = (size_t)((item->end - item->start) + 1);
-#ifdef DER
-fprintf(stderr, "(%llu, %llu : %lu)\n", item->start, item->end, size);
-#endif
+
if(H5FD__core_write_to_bstore(file, item->start, size) != SUCCEED)
HGOTO_ERROR(H5E_VFL, H5E_WRITEERROR, FAIL, "unable to write to backing store")
} /* end if */
@@ -1374,13 +1327,6 @@ fprintf(stderr, "(%llu, %llu : %lu)\n", item->start, item->end, size);
item = H5FL_FREE(H5FD_core_region_t, item);
} /* end while */
-#ifdef DER
-fprintf(stderr, "EOF: %llu\n", file->eof);
-fprintf(stderr, "EOA: %llu\n", file->eoa);
-if(file->eoa > file->eof)
- fprintf(stderr, "*** EOA BADNESS ***\n");
-fprintf(stderr, "\n");
-#endif
} /* end if */
/* Otherwise, write the entire file out at once */
else {
@@ -1504,9 +1450,6 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing
HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly")
#endif /* H5_HAVE_WIN32_API */
-#ifdef DER
-fprintf(stderr, "OLD: Truncated to: %llu\n", file->eoa);
-#endif
} /* end if */
/* Update the eof value */