From: wessels <> Date: Tue, 25 Aug 1998 04:06:44 +0000 (+0000) Subject: Henrik's fixes for DW adding FD to AIOCB bugs X-Git-Tag: SQUID_3_0_PRE1~2803 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1cbc844840be383a87074f5684d731a01a8db20;p=thirdparty%2Fsquid.git Henrik's fixes for DW adding FD to AIOCB bugs --- diff --git a/src/disk.cc b/src/disk.cc index d1229ebbe6..237dc7358c 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,7 +1,7 @@ /* - * $Id: disk.cc,v 1.132 1998/08/21 09:15:22 wessels Exp $ + * $Id: disk.cc,v 1.133 1998/08/24 22:06:44 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -214,7 +214,9 @@ diskCombineWrites(struct _fde_disk *fdd) static void diskHandleWrite(int fd, void *notused) { +#if !USE_ASYNC_IO int len = 0; +#endif fde *F = &fd_table[fd]; struct _fde_disk *fdd = &F->disk; if (!fdd->write_q) @@ -238,7 +240,7 @@ diskHandleWrite(int fd, void *notused) len = write(fd, fdd->write_q->buf + fdd->write_q->buf_offset, fdd->write_q->len - fdd->write_q->buf_offset); - diskHandleWriteComplete(fd, NULL, len, errno); + diskHandleWriteComplete(fd, fdd->write_q, len, errno); #endif } @@ -275,7 +277,6 @@ diskHandleWriteComplete(int fd, void *data, int len, int errcode) errcode = EFAULT; } #endif - safe_free(data); if (q == NULL) /* Someone aborted then write completed */ return; diff --git a/src/protos.h b/src/protos.h index 6714efde85..5be079b437 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.253 1998/08/21 03:15:22 wessels Exp $ + * $Id: protos.h,v 1.254 1998/08/24 22:06:46 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -869,7 +869,6 @@ extern void storeSwapTLVFree(tlv * n); */ extern void storeDoRebuildFromSwapFiles(void *data); extern void storeValidate(StoreEntry *, STVLDCB *, void *, void *); -extern void storeValidateComplete(void *data, int retcode, int errcode); extern void storeRebuildStart(void); /* diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index e455296556..9e20fc5265 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -1,5 +1,5 @@ /* - * $Id: store_rebuild.cc,v 1.45 1998/08/05 08:19:56 wessels Exp $ + * $Id: store_rebuild.cc,v 1.46 1998/08/24 22:06:48 wessels Exp $ * * DEBUG: section 20 Store Rebuild Routines * AUTHOR: Duane Wessels @@ -100,6 +100,7 @@ static StoreEntry *storeAddDiskRestore(const cache_key * key, u_num32 refcount, u_num32 flags, int clean); +static AIOCB storeValidateComplete; static int storeRebuildFromDirectory(rebuild_dir * d) @@ -665,13 +666,13 @@ storeValidate(StoreEntry * e, STVLDCB * callback, void *callback_data, void *tag * not specified; */ x = stat(path, sb); - storeValidateComplete(ctrlp, x, errno); + storeValidateComplete(-1, ctrlp, x, errno); #endif return; } void -storeValidateComplete(void *data, int retcode, int errcode) +storeValidateComplete(int fd, void *data, int retcode, int errcode) { valid_ctrl_t *ctrlp = data; struct stat *sb = ctrlp->sb; diff --git a/src/tools.cc b/src/tools.cc index 627fb6373c..647655fabf 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.166 1998/07/25 04:47:29 wessels Exp $ + * $Id: tools.cc,v 1.167 1998/08/24 22:06:49 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -49,7 +49,7 @@ static void fatal_common(const char *); static void fatalvf(const char *fmt, va_list args); static void mail_warranty(void); #if USE_ASYNC_IO -static void safeunlinkComplete(void *data, int retcode, int errcode); +static AIOCB safeunlinkComplete; #endif #if MEM_GEN_TRACE extern void log_trace_done(); @@ -446,7 +446,7 @@ safeunlink(const char *s, int quiet) #if USE_ASYNC_IO static void -safeunlinkComplete(void *data, int retcode, int errcode) +safeunlinkComplete(int fd, void *data, int retcode, int errcode) { char *s = data; if (retcode < 0) {