From: wessels <> Date: Tue, 4 May 1999 02:39:30 +0000 (+0000) Subject: remove OPTIMISTIC_IO crap X-Git-Tag: SQUID_3_0_PRE1~2233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6ae5b4191acb236ccaac5a75207a05e53b4ace;p=thirdparty%2Fsquid.git remove OPTIMISTIC_IO crap --- diff --git a/src/comm.cc b/src/comm.cc index 5558c1875e..5f548b2b45 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $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 @@ -863,11 +863,7 @@ comm_write(int fd, char *buf, int size, CWCB * handler, void *handler_data, FREE 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 */ diff --git a/src/disk.cc b/src/disk.cc index 25e914566d..53dc388bb1 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,7 +1,7 @@ /* - * $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 @@ -237,9 +237,6 @@ diskHandleWrite(int fd, void *notused) 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); @@ -379,17 +376,11 @@ diskHandleWriteComplete(int fd, void *data, int len, int errcode) 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; } } @@ -437,18 +428,9 @@ file_write(int fd, #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 } } @@ -471,9 +453,6 @@ diskHandleRead(int fd, void *data) 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. @@ -510,9 +489,6 @@ diskHandleReadComplete(int fd, void *data, int len, int errcode) { 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 */ @@ -532,14 +508,8 @@ diskHandleReadComplete(int fd, void *data, int len, int errcode) } 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); } @@ -553,9 +523,6 @@ int 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; @@ -569,18 +536,11 @@ file_read(int fd, char *buf, int req_len, off_t offset, DRCB * handler, void *cl #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; } diff --git a/src/store.cc b/src/store.cc index 6422b04260..cafb627df4 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,7 +1,7 @@ /* - * $Id: store.cc,v 1.490 1999/04/23 02:57:36 wessels Exp $ - * $Id: store.cc,v 1.490 1999/04/23 02:57:36 wessels Exp $ + * $Id: store.cc,v 1.491 1999/05/03 20:39:33 wessels Exp $ + * $Id: store.cc,v 1.491 1999/05/03 20:39:33 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -410,14 +410,8 @@ storeAppend(StoreEntry * e, const char *buf, int len) } if (EBIT_TEST(e->flags, DELAY_SENDING)) return; -#ifdef OPTIMISTIC_IO - storeLockObject(e); -#endif InvokeHandlers(e); storeCheckSwapOut(e); -#ifdef OPTIMISTIC_IO - storeUnlockObject(e); -#endif } void diff --git a/src/store_client.cc b/src/store_client.cc index 1f49166653..1593984baa 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -1,7 +1,7 @@ /* - * $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 @@ -315,9 +315,6 @@ storeClientFileRead(store_client * sc) { 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, @@ -335,9 +332,6 @@ storeClientFileRead(store_client * sc) storeClientReadBody, sc); } -#ifndef OPTIMISTIC_IO - sc->flags.disk_io_pending = 1; -#endif } static void diff --git a/src/structs.h b/src/structs.h index 970a1d629f..b8cc7f59ad 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.285 1999/04/26 21:04:48 wessels Exp $ + * $Id: structs.h,v 1.286 1999/05/03 20:39:36 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -529,9 +529,6 @@ struct _fde { unsigned int nonblocking:1; unsigned int ipc:1; unsigned int called_connect:1; -#ifdef OPTIMISTIC_IO - unsigned int calling_io_handler:1; -#endif } flags; int bytes_read; int bytes_written;