--------------------- PatchSet 6502 Date: 2005/03/12 01:31:45 Author: hno Branch: lfs-2_5 Tag: (none) Log: --enable-cache-large-files configure option, to allow the on-disk cache to default binary compatible with existing caches. time casts to long int rather than int limit maximum_object_size to what we can write to disk use off_t for OS related I/O layers. kill a few fore invalid (int) typecasts fix quickAbort on very large objects (was casting to int) Members: configure.in:1.42.2.59.2.1->1.42.2.59.2.2 src/access_log.c:1.15.6.6->1.15.6.6.8.1 src/cache_cf.c:1.38.6.18.2.5->1.38.6.18.2.6 src/disk.c:1.8.14.2.8.3->1.8.14.2.8.4 src/protos.h:1.41.6.22.2.7->1.41.6.22.2.8 src/store.c:1.16.6.7.6.6->1.16.6.7.6.7 src/store_client.c:1.9.6.2.16.5->1.9.6.2.16.6 src/store_log.c:1.7.74.1->1.7.74.2 src/store_swapout.c:1.11.2.1.30.7->1.11.2.1.30.8 src/structs.h:1.48.2.33.2.9->1.48.2.33.2.10 src/typedefs.h:1.25.6.6.8.5->1.25.6.6.8.6 src/fs/aufs/aiops.c:1.11.6.7.16.1->1.11.6.7.16.2 src/fs/aufs/async_io.c:1.7.6.4.22.1->1.7.6.4.22.2 src/fs/aufs/store_asyncufs.h:1.6.14.2.16.1->1.6.14.2.16.2 src/fs/aufs/store_dir_aufs.c:1.23.6.9.8.1->1.23.6.9.8.2 src/fs/aufs/store_io_aufs.c:1.13.2.11.8.2->1.13.2.11.8.3 src/fs/coss/store_dir_coss.c:1.17.6.9.16.1->1.17.6.9.16.2 src/fs/diskd/store_dir_diskd.c:1.32.6.8.16.1->1.32.6.8.16.2 src/fs/diskd/store_diskd.h:1.5.64.1->1.5.64.2 src/fs/diskd/store_io_diskd.c:1.8.22.3.26.1->1.8.22.3.26.2 src/fs/ufs/store_dir_ufs.c:1.21.6.10.8.1->1.21.6.10.8.2 src/fs/ufs/store_io_ufs.c:1.7.6.3.8.2->1.7.6.3.8.3 Index: squid/configure.in =================================================================== RCS file: /cvsroot/squid-sf//squid/configure.in,v retrieving revision 1.42.2.59.2.1 retrieving revision 1.42.2.59.2.2 diff -u -r1.42.2.59.2.1 -r1.42.2.59.2.2 --- squid/configure.in 25 Feb 2005 10:48:44 -0000 1.42.2.59.2.1 +++ squid/configure.in 12 Mar 2005 01:31:45 -0000 1.42.2.59.2.2 @@ -3,7 +3,7 @@ dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.42.2.59.2.1 2005/02/25 10:48:44 hno Exp $ +dnl $Id: configure.in,v 1.42.2.59.2.2 2005/03/12 01:31:45 hno Exp $ dnl dnl dnl @@ -11,7 +11,7 @@ AC_CONFIG_AUX_DIR(cfgaux) AM_INIT_AUTOMAKE(squid, 2.5.STABLE9-CVS) AM_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.42.2.59.2.1 $)dnl +AC_REVISION($Revision: 1.42.2.59.2.2 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AM_MAINTAINER_MODE @@ -749,14 +749,26 @@ dnl Enable Large file support AC_ARG_ENABLE(large-files, -[ --enable-large-files Enable support for large files (>2GB). Still - experimental.], +[ --enable-large-files Enable support for large files (logs etc)], [ if test "$enableval" = "yes" ; then echo "Large file support enabled" CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" fi ]) +dnl Enable Large file support +AC_ARG_ENABLE(large-cache-files, +[ --enable-cache-large-files + Enable support for large cache files (>2GB). Also + implicitly enabled the --enable-large-files option. + WARNING: on-disk cache format is changed by this option], +[ if test "$enableval" = "yes" ; then + echo "Large file support enabled" + AC_DEFINE(LARGE_CACHE_FILES, 1, [Support large cache files > 2GB]) + CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64" + fi +]) + AM_CONDITIONAL(MAKE_LEAKFINDER, false) dnl Enable Leak Finding Functions AC_ARG_ENABLE(leakfinder, Index: squid/src/access_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/access_log.c,v retrieving revision 1.15.6.6 retrieving revision 1.15.6.6.8.1 diff -u -r1.15.6.6 -r1.15.6.6.8.1 --- squid/src/access_log.c 28 Sep 2004 02:14:07 -0000 1.15.6.6 +++ squid/src/access_log.c 12 Mar 2005 01:31:51 -0000 1.15.6.6.8.1 @@ -1,6 +1,6 @@ /* - * $Id: access_log.c,v 1.15.6.6 2004/09/28 02:14:07 squidadm Exp $ + * $Id: access_log.c,v 1.15.6.6.8.1 2005/03/12 01:31:51 hno Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -245,8 +245,8 @@ client = inet_ntoa(al->cache.caddr); user = accessLogFormatName(al->cache.authuser ? al->cache.authuser : al->cache.rfc931); - logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %lu %s %s %s %s%s/%s %s", - (int) current_time.tv_sec, + logfilePrintf(logfile, "%9ld.%03d %6d %s %s/%03d %lu %s %s %s %s%s/%s %s", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, al->cache.msec, client, Index: squid/src/cache_cf.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/cache_cf.c,v retrieving revision 1.38.6.18.2.5 retrieving revision 1.38.6.18.2.6 diff -u -r1.38.6.18.2.5 -r1.38.6.18.2.6 --- squid/src/cache_cf.c 11 Mar 2005 23:54:14 -0000 1.38.6.18.2.5 +++ squid/src/cache_cf.c 12 Mar 2005 01:31:51 -0000 1.38.6.18.2.6 @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.c,v 1.38.6.18.2.5 2005/03/11 23:54:14 hno Exp $ + * $Id: cache_cf.c,v 1.38.6.18.2.6 2005/03/12 01:31:51 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -465,6 +465,26 @@ debug(22, 0) ("NOTICE: positive_dns_ttl must be larger than negative_dns_ttl. Resetting negative_dns_ttl to match\n"); Config.positiveDnsTtl = Config.negativeDnsTtl; } +#if SIZEOF_SQUID_FILE_SZ <= 4 +#if SIZEOF_SQUID_OFF_T <= 4 + if (Config.Store.maxObjectSize > 0x7FFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB due to hardware limitations\n", 0x7FFF0000 / 1024); + Config.Store.maxObjectSize = 0x7FFF0000; + } +#elif SIZEOF_OFF_T <= 4 + if (Config.Store.maxObjectSize > 0xFFFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB due to OS limitations\n", 0xFFFF0000 / 1024); + Config.Store.maxObjectSize = 0xFFFF0000; + } +#else + if (Config.Store.maxObjectSize > 0xFFFF0000) { + debug(22, 0) ("NOTICE: maximum_object_size limited to %d KB to keep compatibility with existing cache\n", 0xFFFF0000 / 1024); + Config.Store.maxObjectSize = 0xFFFF0000; + } +#endif +#endif + if (Config.Store.maxInMemObjSize > 8 * 1024 * 1024) + debug(22, 0) ("WARNING: Very large maximum_object_size_in_memory settings can have negative impact on performance\n"); } /* Parse a time specification from the config file. Store the Index: squid/src/disk.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/disk.c,v retrieving revision 1.8.14.2.8.3 retrieving revision 1.8.14.2.8.4 diff -u -r1.8.14.2.8.3 -r1.8.14.2.8.4 --- squid/src/disk.c 5 Mar 2005 20:58:58 -0000 1.8.14.2.8.3 +++ squid/src/disk.c 12 Mar 2005 01:31:53 -0000 1.8.14.2.8.4 @@ -1,6 +1,6 @@ /* - * $Id: disk.c,v 1.8.14.2.8.3 2005/03/05 20:58:58 hno Exp $ + * $Id: disk.c,v 1.8.14.2.8.4 2005/03/12 01:31:53 hno Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -291,7 +291,7 @@ /* call a handle when writing is complete. */ void file_write(int fd, - squid_off_t file_offset, + off_t file_offset, void *ptr_to_buf, size_t len, DWCB * handle, @@ -331,7 +331,7 @@ * in a snap */ void -file_write_mbuf(int fd, squid_off_t file_offset, MemBuf mb, DWCB * handler, void *handler_data) +file_write_mbuf(int fd, off_t file_offset, MemBuf mb, DWCB * handler, void *handler_data) { file_write(fd, file_offset, mb.buf, mb.size, handler, handler_data, memBufFreeFunc(&mb)); } @@ -388,7 +388,7 @@ * It must have at least req_len space in there. * call handler when a reading is complete. */ void -file_read(int fd, char *buf, size_t req_len, squid_off_t file_offset, DRCB * handler, void *client_data) +file_read(int fd, char *buf, size_t req_len, off_t file_offset, DRCB * handler, void *client_data) { dread_ctrl *ctrl_dat; assert(fd >= 0); Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.41.6.22.2.7 retrieving revision 1.41.6.22.2.8 diff -u -r1.41.6.22.2.7 -r1.41.6.22.2.8 --- squid/src/protos.h 11 Mar 2005 22:41:09 -0000 1.41.6.22.2.7 +++ squid/src/protos.h 12 Mar 2005 01:31:53 -0000 1.41.6.22.2.8 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.41.6.22.2.7 2005/03/11 22:41:09 hno Exp $ + * $Id: protos.h,v 1.41.6.22.2.8 2005/03/12 01:31:53 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1030,7 +1030,7 @@ */ extern void storeSwapOut(StoreEntry * e); extern void storeSwapOutFileClose(StoreEntry * e); -extern int storeSwapOutMaintainMemObject(StoreEntry * e); +extern squid_off_t storeSwapOutMaintainMemObject(StoreEntry * e); /* * store_client.c Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.16.6.7.6.6 retrieving revision 1.16.6.7.6.7 diff -u -r1.16.6.7.6.6 -r1.16.6.7.6.7 --- squid/src/store.c 11 Mar 2005 00:15:32 -0000 1.16.6.7.6.6 +++ squid/src/store.c 12 Mar 2005 01:31:55 -0000 1.16.6.7.6.7 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.16.6.7.6.6 2005/03/11 00:15:32 hno Exp $ + * $Id: store.c,v 1.16.6.7.6.7 2005/03/12 01:31:55 hno Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -606,7 +606,7 @@ if (mem->object_sz < Config.Store.minObjectSize) return 1; if (mem->reply->content_length > -1) - if (mem->reply->content_length < (int) Config.Store.minObjectSize) + if (mem->reply->content_length < Config.Store.minObjectSize) return 1; return 0; } @@ -1127,13 +1127,13 @@ mem->data_hdr.tail); debug(20, 1) ("MemObject->data.origin_offset: %"PRINTF_OFF_T"\n", mem->data_hdr.origin_offset); - debug(20, 1) ("MemObject->start_ping: %d.%06d\n", - (int) mem->start_ping.tv_sec, + debug(20, 1) ("MemObject->start_ping: %ld.%06d\n", + (long int) mem->start_ping.tv_sec, (int) mem->start_ping.tv_usec); - debug(20, 1) ("MemObject->inmem_hi: %d\n", - (int) mem->inmem_hi); - debug(20, 1) ("MemObject->inmem_lo: %d\n", - (int) mem->inmem_lo); + debug(20, 1) ("MemObject->inmem_hi: %"PRINTF_OFF_T"\n", + mem->inmem_hi); + debug(20, 1) ("MemObject->inmem_lo: %"PRINTF_OFF_T"\n", + mem->inmem_lo); debug(20, 1) ("MemObject->nclients: %d\n", mem->nclients); debug(20, 1) ("MemObject->reply: %p\n", @@ -1151,11 +1151,11 @@ debug(20, l) ("StoreEntry->key: %s\n", storeKeyText(e->hash.key)); debug(20, l) ("StoreEntry->next: %p\n", e->hash.next); debug(20, l) ("StoreEntry->mem_obj: %p\n", e->mem_obj); - debug(20, l) ("StoreEntry->timestamp: %d\n", (int) e->timestamp); - debug(20, l) ("StoreEntry->lastref: %d\n", (int) e->lastref); - debug(20, l) ("StoreEntry->expires: %d\n", (int) e->expires); - debug(20, l) ("StoreEntry->lastmod: %d\n", (int) e->lastmod); - debug(20, l) ("StoreEntry->swap_file_sz: %ld\n", (long) e->swap_file_sz); + debug(20, l) ("StoreEntry->timestamp: %ld\n", (long int) e->timestamp); + debug(20, l) ("StoreEntry->lastref: %ld\n", (long int) e->lastref); + debug(20, l) ("StoreEntry->expires: %ld\n", (long int) e->expires); + debug(20, l) ("StoreEntry->lastmod: %ld\n", (long int) e->lastmod); + debug(20, l) ("StoreEntry->swap_file_sz: %"PRINTF_OFF_T"\n", (squid_off_t) e->swap_file_sz); debug(20, l) ("StoreEntry->refcount: %d\n", e->refcount); debug(20, l) ("StoreEntry->flags: %s\n", storeEntryFlags(e)); debug(20, l) ("StoreEntry->swap_dirn: %d\n", (int) e->swap_dirn); Index: squid/src/store_client.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_client.c,v retrieving revision 1.9.6.2.16.5 retrieving revision 1.9.6.2.16.6 diff -u -r1.9.6.2.16.5 -r1.9.6.2.16.6 --- squid/src/store_client.c 11 Mar 2005 22:41:12 -0000 1.9.6.2.16.5 +++ squid/src/store_client.c 12 Mar 2005 01:32:10 -0000 1.9.6.2.16.6 @@ -1,6 +1,6 @@ /* - * $Id: store_client.c,v 1.9.6.2.16.5 2005/03/11 22:41:12 hno Exp $ + * $Id: store_client.c,v 1.9.6.2.16.6 2005/03/12 01:32:10 hno Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -183,10 +183,10 @@ void *data) { assert(!EBIT_TEST(e->flags, ENTRY_ABORTED)); - debug(20, 3) ("storeClientCopy: %s, seen %d, want %d, size %d, cb %p, cbdata %p\n", + debug(20, 3) ("storeClientCopy: %s, seen %"PRINTF_OFF_T", want %"PRINTF_OFF_T", size %d, cb %p, cbdata %p\n", storeKeyText(e->hash.key), - (int) seen_offset, - (int) copy_offset, + seen_offset, + copy_offset, (int) size, callback, data); @@ -599,9 +599,9 @@ static int CheckQuickAbort2(StoreEntry * entry) { - int curlen; - int minlen; - int expectlen; + squid_off_t curlen; + squid_off_t minlen; + squid_off_t expectlen; MemObject *mem = entry->mem_obj; assert(mem); debug(20, 3) ("CheckQuickAbort2: entry=%p, mem=%p\n", entry, mem); @@ -614,8 +614,8 @@ return 1; } expectlen = mem->reply->content_length + mem->reply->hdr_sz; - curlen = (int) mem->inmem_hi; - minlen = (int) Config.quickAbort.min << 10; + curlen = mem->inmem_hi; + minlen = Config.quickAbort.min << 10; if (minlen < 0) { debug(20, 3) ("CheckQuickAbort2: NO disabled\n"); return 0; Index: squid/src/store_log.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_log.c,v retrieving revision 1.7.74.1 retrieving revision 1.7.74.2 diff -u -r1.7.74.1 -r1.7.74.2 --- squid/src/store_log.c 25 Feb 2005 10:48:51 -0000 1.7.74.1 +++ squid/src/store_log.c 12 Mar 2005 01:32:12 -0000 1.7.74.2 @@ -1,6 +1,6 @@ /* - * $Id: store_log.c,v 1.7.74.1 2005/02/25 10:48:51 hno Exp $ + * $Id: store_log.c,v 1.7.74.2 2005/03/12 01:32:12 hno Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -69,17 +69,17 @@ * Because if we print it before the swap file number, it'll break * the existing log format. */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s %4d %9d %9d %9d %s %"PRINTF_OFF_T"/%"PRINTF_OFF_T" %s %s\n", - (int) current_time.tv_sec, + logfilePrintf(storelog, "%9ld.%03d %-7s %02d %08X %s %4d %9ld %9ld %9ld %s %"PRINTF_OFF_T"/%"PRINTF_OFF_T" %s %s\n", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, storeLogTags[tag], e->swap_dirn, e->swap_filen, storeKeyText(e->hash.key), reply->sline.status, - (int) reply->date, - (int) reply->last_modified, - (int) reply->expires, + (long int) reply->date, + (long int) reply->last_modified, + (long int) reply->expires, strLen(reply->content_type) ? strBuf(reply->content_type) : "unknown", reply->content_length, mem->inmem_hi - mem->reply->hdr_sz, @@ -87,8 +87,8 @@ mem->log_url); } else { /* no mem object. Most RELEASE cases */ - logfilePrintf(storelog, "%9d.%03d %-7s %02d %08X %s ? ? ? ? ?/? ?/? ? ?\n", - (int) current_time.tv_sec, + logfilePrintf(storelog, "%9ld.%03d %-7s %02d %08X %s ? ? ? ? ?/? ?/? ? ?\n", + (long int) current_time.tv_sec, (int) current_time.tv_usec / 1000, storeLogTags[tag], e->swap_dirn, Index: squid/src/store_swapout.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapout.c,v retrieving revision 1.11.2.1.30.7 retrieving revision 1.11.2.1.30.8 diff -u -r1.11.2.1.30.7 -r1.11.2.1.30.8 --- squid/src/store_swapout.c 11 Mar 2005 23:54:35 -0000 1.11.2.1.30.7 +++ squid/src/store_swapout.c 12 Mar 2005 01:32:13 -0000 1.11.2.1.30.8 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.11.2.1.30.7 2005/03/11 23:54:35 hno Exp $ + * $Id: store_swapout.c,v 1.11.2.1.30.8 2005/03/12 01:32:13 hno Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -97,7 +97,7 @@ } /* as sideeffect returns the on disk offset for use by storeSwapOut() */ -int +squid_off_t storeSwapOutMaintainMemObject(StoreEntry * e) { MemObject *mem = e->mem_obj; @@ -117,8 +117,8 @@ * still writing to disk or not */ lowest_offset = storeLowestMemReaderOffset(e); - debug(20, 7) ("storeSwapOut: lowest_offset = %d\n", - (int) lowest_offset); + debug(20, 7) ("storeSwapOut: lowest_offset = %"PRINTF_OFF_T"\n", + lowest_offset); /* * Careful. lowest_offset can be greater than inmem_hi, such * as in the case of a range request. @@ -159,7 +159,7 @@ MemObject *mem = e->mem_obj; squid_off_t on_disk; squid_off_t swapout_size; - squid_off_t swap_buf_len; + size_t swap_buf_len; if (mem == NULL) return; /* should we swap something out to disk? */ @@ -175,15 +175,15 @@ debug(20, 3) ("storeSwapOut: %s SPECIAL\n", storeUrl(e)); return; } - debug(20, 7) ("storeSwapOut: mem->inmem_lo = %d\n", - (int) mem->inmem_lo); - debug(20, 7) ("storeSwapOut: mem->inmem_hi = %d\n", - (int) mem->inmem_hi); - debug(20, 7) ("storeSwapOut: swapout.queue_offset = %d\n", - (int) mem->swapout.queue_offset); + debug(20, 7) ("storeSwapOut: mem->inmem_lo = %"PRINTF_OFF_T"\n", + mem->inmem_lo); + debug(20, 7) ("storeSwapOut: mem->inmem_hi = %"PRINTF_OFF_T"\n", + mem->inmem_hi); + debug(20, 7) ("storeSwapOut: swapout.queue_offset = %"PRINTF_OFF_T"\n", + mem->swapout.queue_offset); if (mem->swapout.sio) - debug(20, 7) ("storeSwapOut: storeOffset() = %d\n", - (int) storeOffset(mem->swapout.sio)); + debug(20, 7) ("storeSwapOut: storeOffset() = %"PRINTF_OFF_T"\n", + storeOffset(mem->swapout.sio)); assert(mem->inmem_hi >= mem->swapout.queue_offset); /* * Grab the swapout_size and check to see whether we're going to defer @@ -216,8 +216,8 @@ return; if (e->swap_status == SWAPOUT_WRITING) assert(mem->inmem_lo <= on_disk); - debug(20, 7) ("storeSwapOut: swapout_size = %d\n", - (int) swapout_size); + debug(20, 7) ("storeSwapOut: swapout_size = %"PRINTF_OFF_T"\n", + swapout_size); if (swapout_size == 0) { if (e->store_status == STORE_OK) storeSwapOutFileClose(e); @@ -273,8 +273,8 @@ debug(20, 3) ("storeSwapOut: swap_buf_len = %d\n", (int) swap_buf_len); assert(swap_buf_len > 0); - debug(20, 3) ("storeSwapOut: swapping out %ld bytes from %ld\n", - (long int) swap_buf_len, (long int) mem->swapout.queue_offset); + debug(20, 3) ("storeSwapOut: swapping out %d bytes from %"PRINTF_OFF_T"\n", + (int) swap_buf_len, mem->swapout.queue_offset); mem->swapout.queue_offset += swap_buf_len; storeWrite(mem->swapout.sio, mem->swapout.memnode->data, swap_buf_len, -1, NULL); /* the storeWrite() call might generate an error */ Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.33.2.9 retrieving revision 1.48.2.33.2.10 diff -u -r1.48.2.33.2.9 -r1.48.2.33.2.10 --- squid/src/structs.h 10 Mar 2005 14:18:23 -0000 1.48.2.33.2.9 +++ squid/src/structs.h 12 Mar 2005 01:32:13 -0000 1.48.2.33.2.10 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.33.2.9 2005/03/10 14:18:23 hno Exp $ + * $Id: structs.h,v 1.48.2.33.2.10 2005/03/12 01:32:13 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1528,7 +1528,7 @@ time_t lastref; time_t expires; time_t lastmod; - off_t swap_file_sz; + squid_file_sz swap_file_sz; u_short refcount; u_short flags; /* END OF ON-DISK STORE_META_STD */ @@ -1899,7 +1899,7 @@ time_t lastref; time_t expires; time_t lastmod; - off_t swap_file_sz; + squid_file_sz swap_file_sz; u_short refcount; u_short flags; unsigned char key[MD5_DIGEST_CHARS]; Index: squid/src/typedefs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/typedefs.h,v retrieving revision 1.25.6.6.8.5 retrieving revision 1.25.6.6.8.6 diff -u -r1.25.6.6.8.5 -r1.25.6.6.8.6 --- squid/src/typedefs.h 11 Mar 2005 23:54:35 -0000 1.25.6.6.8.5 +++ squid/src/typedefs.h 12 Mar 2005 01:32:14 -0000 1.25.6.6.8.6 @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.25.6.6.8.5 2005/03/11 23:54:35 hno Exp $ + * $Id: typedefs.h,v 1.25.6.6.8.6 2005/03/12 01:32:14 hno Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -53,6 +53,14 @@ #define strto_off_t strtol #endif +#if LARGE_CACHE_FILES +typedef squid_off_t squid_file_sz; +#define SIZEOF_SQUID_FILE_SZ SQUIDOF_SQUID_OFF_T +#else +typedef size_t squid_file_sz; +#define SIZEOF_SQUID_FILE_SZ SIZEOF_SIZE_T +#endif + typedef struct { squid_off_t bytes; squid_off_t kb; Index: squid/src/fs/aufs/aiops.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/aiops.c,v retrieving revision 1.11.6.7.16.1 retrieving revision 1.11.6.7.16.2 diff -u -r1.11.6.7.16.1 -r1.11.6.7.16.2 --- squid/src/fs/aufs/aiops.c 3 Mar 2005 03:44:09 -0000 1.11.6.7.16.1 +++ squid/src/fs/aufs/aiops.c 12 Mar 2005 01:32:15 -0000 1.11.6.7.16.2 @@ -94,7 +94,7 @@ char *bufferp; char *tmpbufp; int buflen; - squid_off_t offset; + off_t offset; int whence; int ret; int err; @@ -632,7 +632,7 @@ int -squidaio_read(int fd, char *bufp, int bufs, squid_off_t offset, int whence, squidaio_result_t * resultp) +squidaio_read(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) { squidaio_request_t *requestp; @@ -663,7 +663,7 @@ int -squidaio_write(int fd, char *bufp, int bufs, squid_off_t offset, int whence, squidaio_result_t * resultp) +squidaio_write(int fd, char *bufp, int bufs, off_t offset, int whence, squidaio_result_t * resultp) { squidaio_request_t *requestp; @@ -773,7 +773,7 @@ } int -squidaio_truncate(const char *path, squid_off_t length, squidaio_result_t * resultp) +squidaio_truncate(const char *path, off_t length, squidaio_result_t * resultp) { squidaio_request_t *requestp; Index: squid/src/fs/aufs/async_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/async_io.c,v retrieving revision 1.7.6.4.22.1 retrieving revision 1.7.6.4.22.2 diff -u -r1.7.6.4.22.1 -r1.7.6.4.22.2 --- squid/src/fs/aufs/async_io.c 3 Mar 2005 03:44:09 -0000 1.7.6.4.22.1 +++ squid/src/fs/aufs/async_io.c 12 Mar 2005 01:32:18 -0000 1.7.6.4.22.2 @@ -185,7 +185,7 @@ void -aioWrite(int fd, int offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) +aioWrite(int fd, off_t offset, char *bufp, int len, AIOCB * callback, void *callback_data, FREE * free_func) { squidaio_ctrl_t *ctrlp; int seekmode; @@ -213,7 +213,7 @@ void -aioRead(int fd, int offset, int len, AIOCB * callback, void *callback_data) +aioRead(int fd, off_t offset, int len, AIOCB * callback, void *callback_data) { squidaio_ctrl_t *ctrlp; int seekmode; @@ -277,7 +277,7 @@ } /* aioUnlink */ void -aioTruncate(const char *path, squid_off_t length, AIOCB * callback, void *callback_data) +aioTruncate(const char *path, off_t length, AIOCB * callback, void *callback_data) { squidaio_ctrl_t *ctrlp; assert(initialised); Index: squid/src/fs/aufs/store_asyncufs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_asyncufs.h,v retrieving revision 1.6.14.2.16.1 retrieving revision 1.6.14.2.16.2 diff -u -r1.6.14.2.16.1 -r1.6.14.2.16.2 --- squid/src/fs/aufs/store_asyncufs.h 3 Mar 2005 03:44:10 -0000 1.6.14.2.16.1 +++ squid/src/fs/aufs/store_asyncufs.h 12 Mar 2005 01:32:19 -0000 1.6.14.2.16.2 @@ -43,12 +43,12 @@ int squidaio_cancel(squidaio_result_t *); int squidaio_open(const char *, int, mode_t, squidaio_result_t *); -int squidaio_read(int, char *, int, squid_off_t, int, squidaio_result_t *); -int squidaio_write(int, char *, int, squid_off_t, int, squidaio_result_t *); +int squidaio_read(int, char *, int, off_t, int, squidaio_result_t *); +int squidaio_write(int, char *, int, off_t, int, squidaio_result_t *); int squidaio_close(int, squidaio_result_t *); int squidaio_stat(const char *, struct stat *, squidaio_result_t *); int squidaio_unlink(const char *, squidaio_result_t *); -int squidaio_truncate(const char *, squid_off_t length, squidaio_result_t *); +int squidaio_truncate(const char *, off_t length, squidaio_result_t *); int squidaio_opendir(const char *, squidaio_result_t *); squidaio_result_t *squidaio_poll_done(void); int squidaio_operations_pending(void); @@ -62,11 +62,11 @@ void aioCancel(int); void aioOpen(const char *, int, mode_t, AIOCB *, void *); void aioClose(int); -void aioWrite(int, int offset, char *, int size, AIOCB *, void *, FREE *); -void aioRead(int, int offset, int size, AIOCB *, void *); +void aioWrite(int, off_t offset, char *, int size, AIOCB *, void *, FREE *); +void aioRead(int, off_t offset, int size, AIOCB *, void *); void aioStat(char *, struct stat *, AIOCB *, void *); void aioUnlink(const char *, AIOCB *, void *); -void aioTruncate(const char *, squid_off_t length, AIOCB *, void *); +void aioTruncate(const char *, off_t length, AIOCB *, void *); int aioCheckCallbacks(SwapDir *); void aioSync(SwapDir *); int aioQueueSize(void); @@ -98,14 +98,14 @@ struct _queued_write { char *buf; size_t size; - squid_off_t offset; + off_t offset; FREE *free_func; }; struct _queued_read { char *buf; size_t size; - squid_off_t offset; + off_t offset; STRCB *callback; void *callback_data; }; Index: squid/src/fs/aufs/store_dir_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_dir_aufs.c,v retrieving revision 1.23.6.9.8.1 retrieving revision 1.23.6.9.8.2 diff -u -r1.23.6.9.8.1 -r1.23.6.9.8.2 --- squid/src/fs/aufs/store_dir_aufs.c 3 Mar 2005 03:44:10 -0000 1.23.6.9.8.1 +++ squid/src/fs/aufs/store_dir_aufs.c 12 Mar 2005 01:32:19 -0000 1.23.6.9.8.2 @@ -82,7 +82,7 @@ static int storeAufsDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -783,7 +783,7 @@ static StoreEntry * storeAufsDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -944,7 +944,7 @@ char *new; char *cln; char *outbuf; - squid_off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; Index: squid/src/fs/aufs/store_io_aufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/aufs/store_io_aufs.c,v retrieving revision 1.13.2.11.8.2 retrieving revision 1.13.2.11.8.3 diff -u -r1.13.2.11.8.2 -r1.13.2.11.8.3 --- squid/src/fs/aufs/store_io_aufs.c 3 Mar 2005 03:44:11 -0000 1.13.2.11.8.2 +++ squid/src/fs/aufs/store_io_aufs.c 12 Mar 2005 01:32:21 -0000 1.13.2.11.8.3 @@ -167,7 +167,7 @@ q = memPoolAlloc(aufs_qread_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t)offset; q->callback = callback; q->callback_data = callback_data; cbdataLock(q->callback_data); @@ -183,10 +183,10 @@ sio->offset = offset; aiostate->flags.reading = 1; #if ASYNC_READ - aioRead(aiostate->fd, offset, size, storeAufsReadDone, sio); + aioRead(aiostate->fd, (off_t)offset, size, storeAufsReadDone, sio); statCounter.syscalls.disk.reads++; #else - file_read(aiostate->fd, buf, size, offset, storeAufsReadDone, sio); + file_read(aiostate->fd, buf, size, (off_t)offset, storeAufsReadDone, sio); /* file_read() increments syscalls.disk.reads */ #endif } @@ -206,7 +206,7 @@ q = memPoolAlloc(aufs_qwrite_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t)offset; q->free_func = free_func; linklistPush(&(aiostate->pending_writes), q); return; @@ -218,17 +218,17 @@ q = memPoolAlloc(aufs_qwrite_pool); q->buf = buf; q->size = size; - q->offset = offset; + q->offset = (off_t)offset; q->free_func = free_func; linklistPush(&(aiostate->pending_writes), q); return; } aiostate->flags.writing = 1; - aioWrite(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, + aioWrite(aiostate->fd, (off_t)offset, buf, size, storeAufsWriteDone, sio, free_func); statCounter.syscalls.disk.writes++; #else - file_write(aiostate->fd, offset, buf, size, storeAufsWriteDone, sio, + file_write(aiostate->fd, (off_t)offset, buf, size, storeAufsWriteDone, sio, free_func); /* file_write() increments syscalls.disk.writes */ #endif @@ -320,7 +320,7 @@ squidaiostate_t *aiostate = (squidaiostate_t *) sio->fsstate; STRCB *callback = sio->read.callback; void *their_data = sio->read.callback_data; - squid_off_t rlen; + ssize_t rlen; int inreaddone = aiostate->flags.inreaddone; /* Protect from callback loops */ debug(79, 3) ("storeAufsReadDone: dirno %d, fileno %08X, FD %d, len %d\n", sio->swap_dirn, sio->swap_filen, fd, len); @@ -330,7 +330,7 @@ debug(79, 3) ("storeAufsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (squid_off_t) len; + rlen = len; sio->offset += len; } #if ASYNC_READ Index: squid/src/fs/coss/store_dir_coss.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/coss/store_dir_coss.c,v retrieving revision 1.17.6.9.16.1 retrieving revision 1.17.6.9.16.2 diff -u -r1.17.6.9.16.1 -r1.17.6.9.16.2 --- squid/src/fs/coss/store_dir_coss.c 3 Mar 2005 03:44:27 -0000 1.17.6.9.16.1 +++ squid/src/fs/coss/store_dir_coss.c 12 Mar 2005 01:32:23 -0000 1.17.6.9.16.2 @@ -63,7 +63,7 @@ static EVH storeCossRebuildFromSwapLog; static StoreEntry *storeCossAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -318,7 +318,7 @@ static StoreEntry * storeCossAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, Index: squid/src/fs/diskd/store_dir_diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_dir_diskd.c,v retrieving revision 1.32.6.8.16.1 retrieving revision 1.32.6.8.16.2 diff -u -r1.32.6.8.16.1 -r1.32.6.8.16.2 --- squid/src/fs/diskd/store_dir_diskd.c 3 Mar 2005 03:44:28 -0000 1.32.6.8.16.1 +++ squid/src/fs/diskd/store_dir_diskd.c 12 Mar 2005 01:32:24 -0000 1.32.6.8.16.2 @@ -86,7 +86,7 @@ static int storeDiskdDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key, sfileno file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -528,7 +528,7 @@ storeDiskdHandle(&M); retval = 1; /* Return that we've actually done some work */ if (M.shm_offset > -1) - storeDiskdShmPut(SD, (squid_off_t) M.shm_offset); + storeDiskdShmPut(SD, M.shm_offset); } return retval; } @@ -970,7 +970,7 @@ static StoreEntry * storeDiskdDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -1128,7 +1128,7 @@ char *new; char *cln; char *outbuf; - squid_off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; @@ -1636,7 +1636,7 @@ */ void * -storeDiskdShmGet(SwapDir * sd, squid_off_t * shm_offset) +storeDiskdShmGet(SwapDir * sd, int * shm_offset) { char *buf = NULL; diskdinfo_t *diskdinfo = sd->fsdata; @@ -1659,7 +1659,7 @@ } void -storeDiskdShmPut(SwapDir * sd, squid_off_t offset) +storeDiskdShmPut(SwapDir * sd, int offset) { int i; diskdinfo_t *diskdinfo = sd->fsdata; Index: squid/src/fs/diskd/store_diskd.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_diskd.h,v retrieving revision 1.5.64.1 retrieving revision 1.5.64.2 diff -u -r1.5.64.1 -r1.5.64.2 --- squid/src/fs/diskd/store_diskd.h 3 Mar 2005 03:44:29 -0000 1.5.64.1 +++ squid/src/fs/diskd/store_diskd.h 12 Mar 2005 01:32:25 -0000 1.5.64.2 @@ -59,7 +59,7 @@ int seq_no; void *callback_data; int size; - int offset; + squid_off_t offset; int status; int shm_offset; } diomsg; @@ -95,8 +95,8 @@ extern void storeDiskdDirUnlinkFile(SwapDir *, sfileno); extern void storeDiskdDirReplAdd(SwapDir *, StoreEntry *); extern void storeDiskdDirReplRemove(StoreEntry *); -extern void storeDiskdShmPut(SwapDir *, squid_off_t); -extern void *storeDiskdShmGet(SwapDir *, squid_off_t *); +extern void storeDiskdShmPut(SwapDir *, int); +extern void *storeDiskdShmGet(SwapDir *, int *); extern void storeDiskdHandle(diomsg * M); extern int storeDiskdDirCallback(SwapDir *); Index: squid/src/fs/diskd/store_io_diskd.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/diskd/store_io_diskd.c,v retrieving revision 1.8.22.3.26.1 retrieving revision 1.8.22.3.26.2 diff -u -r1.8.22.3.26.1 -r1.8.22.3.26.2 --- squid/src/fs/diskd/store_io_diskd.c 3 Mar 2005 03:44:29 -0000 1.8.22.3.26.1 +++ squid/src/fs/diskd/store_io_diskd.c 12 Mar 2005 01:32:26 -0000 1.8.22.3.26.2 @@ -42,7 +42,7 @@ #include "store_diskd.h" -static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, int, squid_off_t); +static int storeDiskdSend(int, SwapDir *, int, storeIOState *, int, off_t, int); static void storeDiskdIOCallback(storeIOState * sio, int errflag); static CBDUNL storeDiskdIOFreeEntry; @@ -59,7 +59,7 @@ storeIOState *sio; char *buf; diskdstate_t *diskdstate; - squid_off_t shm_offset; + int shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; debug(79, 3) ("storeDiskdOpen: fileno %08X\n", f); /* @@ -115,7 +115,7 @@ int x; storeIOState *sio; char *buf; - squid_off_t shm_offset; + int shm_offset; diskdinfo_t *diskdinfo = SD->fsdata; diskdstate_t *diskdstate; /* @@ -194,7 +194,7 @@ storeDiskdRead(SwapDir * SD, storeIOState * sio, char *buf, size_t size, squid_off_t offset, STRCB * callback, void *callback_data) { int x; - squid_off_t shm_offset; + int shm_offset; char *rbuf; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdRead: dirno %d, fileno %08X\n", sio->swap_dirn, sio->swap_filen); @@ -219,8 +219,8 @@ SD, diskdstate->id, sio, - (int) size, - (int) offset, + size, + (off_t)offset, shm_offset); if (x < 0) { debug(79, 1) ("storeDiskdSend READ: %s\n", xstrerror()); @@ -235,7 +235,7 @@ { int x; char *sbuf; - squid_off_t shm_offset; + int shm_offset; diskdstate_t *diskdstate = sio->fsstate; debug(79, 3) ("storeDiskdWrite: dirno %d, fileno %08X\n", SD->index, sio->swap_filen); assert(!diskdstate->flags.close_request); @@ -252,8 +252,8 @@ SD, diskdstate->id, sio, - (int) size, - (int) offset, + size, + (off_t)offset, shm_offset); if (x < 0) { debug(79, 1) ("storeDiskdSend WRITE: %s\n", xstrerror()); @@ -267,7 +267,7 @@ storeDiskdUnlink(SwapDir * SD, StoreEntry * e) { int x; - squid_off_t shm_offset; + int shm_offset; char *buf; diskdinfo_t *diskdinfo = SD->fsdata; @@ -462,7 +462,7 @@ } static int -storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, int offset, squid_off_t shm_offset) +storeDiskdSend(int mtype, SwapDir * sd, int id, storeIOState * sio, int size, off_t offset, int shm_offset) { int x; diomsg M; Index: squid/src/fs/ufs/store_dir_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_dir_ufs.c,v retrieving revision 1.21.6.10.8.1 retrieving revision 1.21.6.10.8.2 diff -u -r1.21.6.10.8.1 -r1.21.6.10.8.2 --- squid/src/fs/ufs/store_dir_ufs.c 3 Mar 2005 03:44:30 -0000 1.21.6.10.8.1 +++ squid/src/fs/ufs/store_dir_ufs.c 12 Mar 2005 01:32:27 -0000 1.21.6.10.8.2 @@ -80,7 +80,7 @@ static int storeUfsDirGetNextFile(RebuildState *, sfileno *, int *size); static StoreEntry *storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -782,7 +782,7 @@ static StoreEntry * storeUfsDirAddDiskRestore(SwapDir * SD, const cache_key * key, int file_number, - size_t swap_file_sz, + squid_file_sz swap_file_sz, time_t expires, time_t timestamp, time_t lastref, @@ -942,7 +942,7 @@ char *new; char *cln; char *outbuf; - squid_off_t outbuf_offset; + int outbuf_offset; int fd; RemovalPolicyWalker *walker; }; Index: squid/src/fs/ufs/store_io_ufs.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/fs/ufs/store_io_ufs.c,v retrieving revision 1.7.6.3.8.2 retrieving revision 1.7.6.3.8.3 diff -u -r1.7.6.3.8.2 -r1.7.6.3.8.3 --- squid/src/fs/ufs/store_io_ufs.c 3 Mar 2005 03:44:31 -0000 1.7.6.3.8.2 +++ squid/src/fs/ufs/store_io_ufs.c 12 Mar 2005 01:32:28 -0000 1.7.6.3.8.3 @@ -166,7 +166,7 @@ file_read(ufsstate->fd, buf, size, - offset, + (off_t)offset, storeUfsReadDone, sio); } @@ -178,7 +178,7 @@ debug(79, 3) ("storeUfsWrite: dirn %d, fileno %08X, FD %d\n", sio->swap_dirn, sio->swap_filen, ufsstate->fd); ufsstate->flags.writing = 1; file_write(ufsstate->fd, - offset, + (off_t)offset, buf, size, storeUfsWriteDone, @@ -204,7 +204,7 @@ ufsstate_t *ufsstate = (ufsstate_t *) sio->fsstate; STRCB *callback = sio->read.callback; void *their_data = sio->read.callback_data; - squid_off_t rlen; + ssize_t rlen; debug(79, 3) ("storeUfsReadDone: dirno %d, fileno %08X, FD %d, len %d\n", sio->swap_dirn, sio->swap_filen, fd, len); @@ -213,7 +213,7 @@ debug(79, 3) ("storeUfsReadDone: got failure (%d)\n", errflag); rlen = -1; } else { - rlen = (squid_off_t) len; + rlen = len; sio->offset += len; } assert(callback);