implement convention that stop=0 means flush to EOF

This commit is contained in:
Sears Russell 2009-08-05 19:50:07 +00:00
parent 16c137aaf7
commit 69490f1c98
3 changed files with 3 additions and 0 deletions

View file

@ -453,6 +453,7 @@ static int file_force_range(stasis_handle_t *h, lsn_t start, lsn_t stop) {
}
//#ifdef HAVE_F_SYNC_RANGE
#ifdef HAVE_SYNC_FILE_RANGE
if(!stop) stop = impl->end_pos;
printf("Calling sync_file_range\n");
ret = sync_file_range(fd, start-off, (stop-start),
SYNC_FILE_RANGE_WAIT_BEFORE |

View file

@ -535,6 +535,7 @@ static int nbw_force_range_impl(stasis_handle_t * h, lsn_t start, lsn_t stop) {
tree_node scratch;
scratch.start_pos = start;
scratch.end_pos = start+1;
if(!stop) stop = impl->end_pos;
const tree_node * n = RB_ENTRY(lookup)(RB_LUGTEQ,&scratch,impl->fast_handles); // min)(impl->fast_handles);
int blocked = 0;
while(n) {

View file

@ -374,6 +374,7 @@ static int pfile_force(stasis_handle_t *h) {
static int pfile_force_range(stasis_handle_t *h, lsn_t start, lsn_t stop) {
pfile_impl * impl = h->impl;
#ifdef HAVE_SYNC_FILE_RANGE
if(!stop) stop = impl->end_pos;
DEBUG("pfile_force_range calling sync_file_range %lld %lld\n",
start-impl->start_pos, stop-start); fflush(stdout);
int ret = sync_file_range(impl->fd, start-impl->start_pos, stop-start,