/*
- * $Id: comm.cc,v 1.300 1999/04/23 02:57:20 wessels Exp $
+ * $Id: comm.cc,v 1.301 1999/05/03 20:39:30 wessels Exp $
*
* DEBUG: section 5 Socket Functions
* AUTHOR: Harvest Derived
state->handler_data = handler_data;
state->free_func = free_func;
cbdataLock(handler_data);
-#ifdef OPTIMISTIC_IO
- commHandleWrite(fd, state);
-#else
commSetSelect(fd, COMM_SELECT_WRITE, commHandleWrite, state, 0);
-#endif
}
/* a wrapper around comm_write to allow for MemBuf to be comm_written in a snap */
/*
- * $Id: disk.cc,v 1.142 1999/04/15 06:15:53 wessels Exp $
+ * $Id: disk.cc,v 1.143 1999/05/03 20:39:31 wessels Exp $
*
* DEBUG: section 6 Disk I/O Routines
* AUTHOR: Harvest Derived
struct _fde_disk *fdd = &F->disk;
if (!fdd->write_q)
return;
-#ifdef OPTIMISTIC_IO
- assert(!F->flags.calling_io_handler);
-#endif
debug(6, 3) ("diskHandleWrite: FD %d\n", fd);
assert(fdd->write_q != NULL);
assert(fdd->write_q->len > fdd->write_q->buf_offset);
if (fdd->wrt_handle_data != NULL)
cbdataUnlock(fdd->wrt_handle_data);
if (do_callback) {
-#ifdef OPTIMISTIC_IO
- F->flags.calling_io_handler = 1;
-#endif
fdd->wrt_handle(fd, status, len, fdd->wrt_handle_data);
/*
* NOTE, this callback can close the FD, so we must
* not touch 'F', 'fdd', etc. after this.
*/
-#ifdef OPTIMISTIC_IO
- F->flags.calling_io_handler = 0;
-#endif
return;
}
}
#if USE_ASYNC_IO
diskHandleWrite(fd, NULL);
#else
-#ifdef OPTIMISTIC_IO
- if (F->flags.calling_io_handler)
-#endif
commSetSelect(fd, COMM_SELECT_WRITE, diskHandleWrite, NULL, 0);
-#ifdef OPTIMISTIC_IO
- else
- diskHandleWrite(fd, NULL);
#endif
-#endif
-#ifndef OPTIMISTIC_IO
F->flags.write_daemon = 1;
-#endif
}
}
fde *F = &fd_table[fd];
int len;
#endif
-#ifdef OPTIMISTIC_IO
- assert(!F->flags.calling_io_handler);
-#endif /* OPTIMISTIC_IO */
/*
* FD < 0 indicates premature close; we just have to free
* the state data.
{
dread_ctrl *ctrl_dat = data;
int rc = DISK_OK;
-#ifdef OPTIMISTIC_IO
- fde *F = &fd_table[fd];
-#endif /* OPTIMISTIC_IO */
Counter.syscalls.disk.reads++;
errno = errcode;
if (len == -2 && errcode == -2) { /* Read cancelled - cleanup */
} else if (len == 0) {
rc = DISK_EOF;
}
-#ifdef OPTIMISTIC_IO
- F->flags.calling_io_handler = 1;
-#endif /* OPTIMISTIC_IO */
if (cbdataValid(ctrl_dat->client_data))
ctrl_dat->handler(fd, ctrl_dat->buf, len, rc, ctrl_dat->client_data);
-#ifdef OPTIMISTIC_IO
- F->flags.calling_io_handler = 0;
-#endif /* OPTIMISTIC_IO */
cbdataUnlock(ctrl_dat->client_data);
memFree(ctrl_dat, MEM_DREAD_CTRL);
}
file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *client_data)
{
dread_ctrl *ctrl_dat;
-#ifdef OPTIMISTIC_IO
- fde *F = &fd_table[fd];
-#endif /* OPTIMISTIC_IO */
assert(fd >= 0);
ctrl_dat = memAllocate(MEM_DREAD_CTRL);
ctrl_dat->fd = fd;
#if USE_ASYNC_IO
diskHandleRead(fd, ctrl_dat);
#else
-#ifndef OPTIMISTIC_IO
commSetSelect(fd,
COMM_SELECT_READ,
diskHandleRead,
ctrl_dat,
0);
-#else
- if (F->flags.calling_io_handler)
- commSetSelect(fd, COMM_SELECT_READ, diskHandleRead, ctrl_dat, 0);
- else
- diskHandleRead(fd, ctrl_dat);
-#endif /* OPTIMISTIC_IO */
#endif
return DISK_OK;
}
/*
- * $Id: store_client.cc,v 1.63 1999/04/23 02:57:37 wessels Exp $
- * $Id: store_client.cc,v 1.63 1999/04/23 02:57:37 wessels Exp $
+ * $Id: store_client.cc,v 1.64 1999/05/03 20:39:35 wessels Exp $
+ * $Id: store_client.cc,v 1.64 1999/05/03 20:39:35 wessels Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
{
MemObject *mem = sc->entry->mem_obj;
assert(sc->callback != NULL);
-#ifdef OPTIMISTIC_IO
- sc->flags.disk_io_pending = 1;
-#endif
if (mem->swap_hdr_sz == 0) {
file_read(sc->swapin_fd,
sc->copy_buf,
storeClientReadBody,
sc);
}
-#ifndef OPTIMISTIC_IO
- sc->flags.disk_io_pending = 1;
-#endif
}
static void