]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
remove OPTIMISTIC_IO crap
authorwessels <>
Tue, 4 May 1999 02:39:30 +0000 (02:39 +0000)
committerwessels <>
Tue, 4 May 1999 02:39:30 +0000 (02:39 +0000)
src/comm.cc
src/disk.cc
src/store.cc
src/store_client.cc
src/structs.h

index 5558c1875e8c15c4d135881476db4d9424e3c651..5f548b2b45ff0cffaff475e77c1f7c98e7922787 100644 (file)
@@ -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 */
index 25e914566d2d590aaf474554a392424bf8bf489a..53dc388bb131bad2decba51061880bb2df4c9163 100644 (file)
@@ -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;
 }
index 6422b042604ceb00f616c8a8604ba3f4304d15d9..cafb627df4863f08f9214bb049c96fc97bea68ca 100644 (file)
@@ -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
index 1f49166653f60e6c628702ef263680e8bfcc9d4f..1593984baa5626b067cbc95d985912b2c52043b7 100644 (file)
@@ -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
index 970a1d629f07bc775a31f27c7c39b9fb4c133ad6..b8cc7f59ad7f17684eff64b621d8603d42996326 100644 (file)
@@ -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;