--------------------- PatchSet 8920 Date: 2007/02/15 10:23:10 Author: adri Branch: storework Tag: (none) Log: * remove objectLen() and code that uses it * remove some of the now unused disk store related code whilst I'm at it. Members: src/protos.h:1.133.2.3->1.133.2.4 src/store.c:1.45.2.4->1.45.2.5 src/store_dir.c:1.28->1.28.2.1 src/store_io.c:1.9->1.9.10.1 src/store_swapmeta.c:1.12.14.1->1.12.14.2 src/store_swapout.c:1.22->1.22.10.1 Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.133.2.3 retrieving revision 1.133.2.4 diff -u -r1.133.2.3 -r1.133.2.4 --- squid/src/protos.h 14 Feb 2007 14:18:24 -0000 1.133.2.3 +++ squid/src/protos.h 15 Feb 2007 10:23:10 -0000 1.133.2.4 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.133.2.3 2007/02/14 14:18:24 adri Exp $ + * $Id: protos.h,v 1.133.2.4 2007/02/15 10:23:10 adri Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -942,7 +942,6 @@ extern void storeAppendVPrintf(StoreEntry *, const char *, va_list ap); extern int storeCheckCachable(StoreEntry * e); extern void storeSetPrivateKey(StoreEntry *); -extern squid_off_t objectLen(const StoreEntry * e); extern squid_off_t contentLen(const StoreEntry * e); extern HttpReply *storeEntryReply(StoreEntry *); extern int storeTooManyDiskFilesOpen(void); Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.45.2.4 retrieving revision 1.45.2.5 diff -u -r1.45.2.4 -r1.45.2.5 --- squid/src/store.c 14 Feb 2007 14:18:25 -0000 1.45.2.4 +++ squid/src/store.c 15 Feb 2007 10:23:11 -0000 1.45.2.5 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.45.2.4 2007/02/14 14:18:25 adri Exp $ + * $Id: store.c,v 1.45.2.5 2007/02/15 10:23:11 adri Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -936,8 +936,8 @@ assert(e->mem_obj != NULL); reply = e->mem_obj->reply; debug(20, 3) ("storeEntryValidLength: Checking '%s'\n", storeKeyText(e->hash.key)); - debug(20, 5) ("storeEntryValidLength: object_len = %" PRINTF_OFF_T "\n", - objectLen(e)); + debug(20, 5) ("storeEntryValidLength: content_len = %" PRINTF_OFF_T "\n", + contentLen(e)); //debug(20, 5) ("storeEntryValidLength: hdr_sz = %d\n", // reply->hdr_sz); clen = httpReplyBodySize(e->mem_obj->method, reply); @@ -948,7 +948,7 @@ storeKeyText(e->hash.key)); return 1; } - diff = clen - objectLen(e); + diff = clen - contentLen(e); if (diff == 0) return 1; debug(20, 2) ("storeEntryValidLength: %" PRINTF_OFF_T " bytes too %s; '%s'\n", @@ -1243,17 +1243,6 @@ } } -/* - * XXX objectLen and contentLen are now the same? Do we need to - * include the header length here too? - */ -squid_off_t -objectLen(const StoreEntry * e) -{ - assert(e->mem_obj != NULL); - return e->mem_obj->object_sz; -} - squid_off_t contentLen(const StoreEntry * e) { Index: squid/src/store_dir.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_dir.c,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -u -r1.28 -r1.28.2.1 --- squid/src/store_dir.c 25 Jan 2007 20:52:00 -0000 1.28 +++ squid/src/store_dir.c 15 Feb 2007 10:23:12 -0000 1.28.2.1 @@ -1,6 +1,6 @@ /* - * $Id: store_dir.c,v 1.28 2007/01/25 20:52:00 squidadm Exp $ + * $Id: store_dir.c,v 1.28.2.1 2007/02/15 10:23:12 adri Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -159,31 +159,6 @@ static int storeDirSelectSwapDirRoundRobin(const StoreEntry * e) { - static int dirn = 0; - int i; - int load; - SwapDir *sd; - squid_off_t objsize = objectLen(e); - for (i = 0; i <= Config.cacheSwap.n_configured; i++) { - if (++dirn >= Config.cacheSwap.n_configured) - dirn = 0; - sd = &Config.cacheSwap.swapDirs[dirn]; - if (sd->flags.read_only) - continue; - if (sd->cur_size > sd->max_size) - continue; - if (!storeDirValidSwapDirSize(dirn, objsize)) - continue; - /* check for error or overload condition */ - if (sd->checkobj(sd, e) == 0) { - continue; - } - load = sd->checkload(sd, ST_OP_CREATE); - if (load < 0 || load > 1000) { - continue; - } - return dirn; - } return -1; } @@ -203,56 +178,7 @@ static int storeDirSelectSwapDirLeastLoad(const StoreEntry * e) { - squid_off_t objsize; - int most_free = 0, cur_free; - squid_off_t least_objsize = -1; - int least_load = INT_MAX; - int load; - int dirn = -1; - int i; - SwapDir *SD; - - /* Calculate the object size */ - objsize = objectLen(e); - if (objsize != -1) - objsize += e->mem_obj->swap_hdr_sz; - for (i = 0; i < Config.cacheSwap.n_configured; i++) { - SD = &Config.cacheSwap.swapDirs[i]; - SD->flags.selected = 0; - if (SD->checkobj(SD, e) == 0) { - continue; - } - load = SD->checkload(SD, ST_OP_CREATE); - if (load < 0 || load > 1000) { - continue; - } - if (!storeDirValidSwapDirSize(i, objsize)) - continue; - if (SD->flags.read_only) - continue; - if (SD->cur_size > SD->max_size) - continue; - if (load > least_load) - continue; - cur_free = SD->max_size - SD->cur_size; - /* If the load is equal, then look in more details */ - if (load == least_load) { - /* closest max_objsize fit */ - if (least_objsize != -1) - if (SD->max_objsize > least_objsize || SD->max_objsize == -1) - continue; - /* most free */ - if (cur_free < most_free) - continue; - } - least_load = load; - least_objsize = SD->max_objsize; - most_free = cur_free; - dirn = i; - } - if (dirn >= 0) - Config.cacheSwap.swapDirs[dirn].flags.selected = 1; - return dirn; + return -1; } Index: squid/src/store_io.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_io.c,v retrieving revision 1.9 retrieving revision 1.9.10.1 diff -u -r1.9 -r1.9.10.1 --- squid/src/store_io.c 5 Nov 2006 21:52:48 -0000 1.9 +++ squid/src/store_io.c 15 Feb 2007 10:23:12 -0000 1.9.10.1 @@ -26,37 +26,7 @@ storeIOState * storeCreate(StoreEntry * e, STIOCB * file_callback, STIOCB * close_callback, void *callback_data) { - squid_off_t objsize; - sdirno dirn; - SwapDir *SD; - storeIOState *sio; - - store_io_stats.create.calls++; - /* This is just done for logging purposes */ - objsize = objectLen(e); - if (objsize != -1) - objsize += e->mem_obj->swap_hdr_sz; - - /* - * Pick the swapdir - * We assume that the header has been packed by now .. - */ - dirn = storeDirSelectSwapDir(e); - if (dirn == -1) { - debug(20, 2) ("storeCreate: no valid swapdirs for this object\n"); - store_io_stats.create.select_fail++; return NULL; - } - debug(20, 2) ("storeCreate: Selected dir '%d' for obj size '%" PRINTF_OFF_T "'\n", dirn, objsize); - SD = &Config.cacheSwap.swapDirs[dirn]; - - /* Now that we have a fs to use, call its storeCreate function */ - sio = SD->obj.create(SD, e, file_callback, close_callback, callback_data); - if (NULL == sio) - store_io_stats.create.create_fail++; - else - store_io_stats.create.success++; - return sio; } @@ -67,23 +37,7 @@ storeOpen(StoreEntry * e, STFNCB * file_callback, STIOCB * callback, void *callback_data) { - int load; - storeIOState *sio; - - SwapDir *SD = &Config.cacheSwap.swapDirs[e->swap_dirn]; - store_io_stats.open.calls++; - load = SD->checkload(SD, ST_OP_OPEN); - if (load < 0 || load > 1000) { - store_io_stats.open.loadav_fail++; - return NULL; - } - sio = SD->obj.open(SD, e, file_callback, callback, callback_data); - if (sio == NULL) { - store_io_stats.open.open_fail++; - } else { - store_io_stats.open.success++; - } - return sio; + return NULL; } void Index: squid/src/store_swapmeta.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapmeta.c,v retrieving revision 1.12.14.1 retrieving revision 1.12.14.2 diff -u -r1.12.14.1 -r1.12.14.2 --- squid/src/store_swapmeta.c 13 Feb 2007 10:47:35 -0000 1.12.14.1 +++ squid/src/store_swapmeta.c 15 Feb 2007 10:23:13 -0000 1.12.14.2 @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.c,v 1.12.14.1 2007/02/13 10:47:35 adri Exp $ + * $Id: store_swapmeta.c,v 1.12.14.2 2007/02/15 10:23:13 adri Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -58,33 +58,6 @@ } } -/* - * Build a TLV list for a StoreEntry - */ -tlv * -storeSwapMetaBuild(StoreEntry * e) -{ - tlv *TLV = NULL; /* we'll return this */ - tlv **T = &TLV; - const char *url; - const squid_off_t objsize = objectLen(e); - assert(e->mem_obj != NULL); - assert(e->swap_status == SWAPOUT_WRITING); - url = storeUrl(e); - debug(20, 3) ("storeSwapMetaBuild: %s\n", url); - T = storeSwapTLVAdd(STORE_META_KEY, e->hash.key, MD5_DIGEST_CHARS, T); -#if SIZEOF_SQUID_FILE_SZ == SIZEOF_SIZE_T - T = storeSwapTLVAdd(STORE_META_STD, &e->timestamp, STORE_HDR_METASIZE, T); -#else - T = storeSwapTLVAdd(STORE_META_STD_LFS, &e->timestamp, STORE_HDR_METASIZE, T); -#endif - T = storeSwapTLVAdd(STORE_META_URL, url, strlen(url) + 1, T); - if (objsize > -1) { - T = storeSwapTLVAdd(STORE_META_OBJSIZE, &objsize, sizeof(objsize), T); - } - return TLV; -} - char * storeSwapMetaPack(tlv * tlv_list, int *length) { Index: squid/src/store_swapout.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store_swapout.c,v retrieving revision 1.22 retrieving revision 1.22.10.1 diff -u -r1.22 -r1.22.10.1 --- squid/src/store_swapout.c 22 Sep 2006 03:52:45 -0000 1.22 +++ squid/src/store_swapout.c 15 Feb 2007 10:23:14 -0000 1.22.10.1 @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.c,v 1.22 2006/09/22 03:52:45 squidadm Exp $ + * $Id: store_swapout.c,v 1.22.10.1 2007/02/15 10:23:14 adri Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -35,66 +35,6 @@ #include "squid.h" -static void storeSwapOutStart(StoreEntry * e); -static STIOCB storeSwapOutFileClosed; -static STIOCB storeSwapOutFileNotify; -static int storeSwapOutAble(const StoreEntry * e); - -/* start swapping object to disk */ -static void -storeSwapOutStart(StoreEntry * e) -{ - generic_cbdata *c; - MemObject *mem = e->mem_obj; - int swap_hdr_sz = 0; - tlv *tlv_list; - char *buf; - assert(mem); - /* Build the swap metadata, so the filesystem will know how much - * metadata there is to store - */ - debug(20, 5) ("storeSwapOutStart: Begin SwapOut '%s' to dirno %d, fileno %08X\n", - storeUrl(e), e->swap_dirn, e->swap_filen); - e->swap_status = SWAPOUT_WRITING; - tlv_list = storeSwapMetaBuild(e); - buf = storeSwapMetaPack(tlv_list, &swap_hdr_sz); - storeSwapTLVFree(tlv_list); - mem->swap_hdr_sz = (size_t) swap_hdr_sz; - /* Create the swap file */ - c = cbdataAlloc(generic_cbdata); - c->data = e; - mem->swapout.sio = storeCreate(e, storeSwapOutFileNotify, storeSwapOutFileClosed, c); - if (NULL == mem->swapout.sio) { - e->swap_status = SWAPOUT_NONE; - cbdataFree(c); - xfree(buf); - storeLog(STORE_LOG_SWAPOUTFAIL, e); - return; - } - storeLockObject(e); /* Don't lock until after create, or the replacement - * code might get confused */ - /* Pick up the file number if it was assigned immediately */ - e->swap_filen = mem->swapout.sio->swap_filen; - e->swap_dirn = mem->swapout.sio->swap_dirn; - /* write out the swap metadata */ - cbdataLock(mem->swapout.sio); - storeWrite(mem->swapout.sio, buf, mem->swap_hdr_sz, xfree); -} - -static void -storeSwapOutFileNotify(void *data, int errflag, storeIOState * sio) -{ - generic_cbdata *c = data; - StoreEntry *e = c->data; - MemObject *mem = e->mem_obj; - assert(e->swap_status == SWAPOUT_WRITING); - assert(mem); - assert(mem->swapout.sio == sio); - assert(errflag == 0); - e->swap_filen = mem->swapout.sio->swap_filen; - e->swap_dirn = mem->swapout.sio->swap_dirn; -} - /* as sideeffect returns if the object can be cached */ int storeSwapOutMaintainMemObject(StoreEntry * e) @@ -112,13 +52,6 @@ if (e->mem_status == IN_MEMORY) return 1; - swapout_able = storeSwapOutAble(e); - if (!swapout_able) { - /* Stop writing to disk */ - storeReleaseRequest(e); - if (e->mem_obj->swapout.sio != NULL) - storeSwapOutFileClose(e); - } /* storeLowestMemReaderOffset must be after the storeSwapOutFileClose * call above as storeLowestMemReaderOffset needs to know if we are * still writing to disk or not @@ -134,13 +67,6 @@ new_mem_lo = lowest_offset; else new_mem_lo = mem->inmem_lo; - /* The -1 makes sure the page isn't freed until storeSwapOut has - * walked to the next page. (mem->swapout.memnode->next) */ - if (swapout_able && new_mem_lo) { - squid_off_t on_disk = storeSwapOutObjectBytesOnDisk(e->mem_obj); - if (on_disk - 1 < new_mem_lo) - new_mem_lo = on_disk - 1; - } if (new_mem_lo < mem->inmem_lo) new_mem_lo = mem->inmem_lo; if (mem->inmem_lo != new_mem_lo) { @@ -159,252 +85,15 @@ } void -storeSwapOut(StoreEntry * e) +storeSwapOut(StoreEntry *e) { - MemObject *mem = e->mem_obj; - int swapout_able; - squid_off_t swapout_size; - size_t swap_buf_len; - if (mem == NULL) - return; - /* should we swap something out to disk? */ - debug(20, 7) ("storeSwapOut: %s\n", storeUrl(e)); - debug(20, 7) ("storeSwapOut: store_status = %s\n", - storeStatusStr[e->store_status]); - if (EBIT_TEST(e->flags, ENTRY_ABORTED)) { - assert(EBIT_TEST(e->flags, RELEASE_REQUEST)); - storeSwapOutFileClose(e); - return; - } - if (EBIT_TEST(e->flags, ENTRY_SPECIAL)) { - debug(20, 3) ("storeSwapOut: %s SPECIAL\n", storeUrl(e)); - return; - } - 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() = %" 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 - * the swapout based upon size - */ - swapout_size = mem->inmem_hi - mem->swapout.queue_offset; - if ((e->store_status != STORE_OK) && (swapout_size < store_maxobjsize)) { - /* - * NOTE: the store_maxobjsize here is the max of optional - * max-size values from 'cache_dir' lines. It is not the - * same as 'maximum_object_size'. By default, store_maxobjsize - * will be set to -1. However, I am worried that this - * deferance may consume a lot of memory in some cases. - * It would be good to make this decision based on reply - * content-length, rather than wait to accumulate huge - * amounts of object data in memory. - */ - debug(20, 5) ("storeSwapOut: Deferring starting swapping out\n"); - return; - } - swapout_able = storeSwapOutMaintainMemObject(e); -#if SIZEOF_SQUID_OFF_T <= 4 - if (mem->inmem_hi > 0x7FFF0000) { - debug(20, 0) ("WARNING: preventing squid_off_t overflow for %s\n", storeUrl(e)); - storeAbort(e); - return; - } -#endif - if (!swapout_able) - return; - debug(20, 7) ("storeSwapOut: swapout_size = %" PRINTF_OFF_T "\n", - swapout_size); - if (swapout_size == 0) { - if (e->store_status == STORE_OK) - storeSwapOutFileClose(e); - return; /* Nevermore! */ - } - if (e->store_status == STORE_PENDING) { - /* wait for a full block to write */ - if (swapout_size < SM_PAGE_SIZE) - return; - /* - * Wait until we are below the disk FD limit, only if the - * next server-side read won't be deferred. - */ - if (storeTooManyDiskFilesOpen() && !fwdCheckDeferRead(-1, e)) - return; - } - /* Ok, we have stuff to swap out. Is there a swapout.sio open? */ - if (e->swap_status == SWAPOUT_NONE && !EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) { - assert(mem->swapout.sio == NULL); - assert(mem->inmem_lo == 0); - if (storeCheckCachable(e)) - storeSwapOutStart(e); - else { - /* Now that we know the data is not cachable, free the memory - * to make sure the forwarding code does not defer the connection - */ - storeSwapOutMaintainMemObject(e); - return; - } - /* ENTRY_CACHABLE will be cleared and we'll never get here again */ - } - if (NULL == mem->swapout.sio) - return; - do { - /* - * Evil hack time. - * We are paging out to disk in page size chunks. however, later on when - * we update the queue position, we might not have a page (I *think*), - * so we do the actual page update here. - */ - - if (mem->swapout.memnode == NULL) { - /* We need to swap out the first page */ - mem->swapout.memnode = mem->data_hdr.head; - } else { - /* We need to swap out the next page */ - mem->swapout.memnode = mem->swapout.memnode->next; - } - /* - * Get the length of this buffer. We are assuming(!) that the buffer - * length won't change on this buffer, or things are going to be very - * strange. I think that after the copy to a buffer is done, the buffer - * size should stay fixed regardless so that this code isn't confused, - * but we can look at this at a later date or whenever the code results - * in bad swapouts, whichever happens first. :-) - */ - swap_buf_len = mem->swapout.memnode->len; - - debug(20, 3) ("storeSwapOut: swap_buf_len = %d\n", (int) swap_buf_len); - assert(swap_buf_len > 0); - 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, stmemNodeGet(mem->swapout.memnode), swap_buf_len, stmemNodeFree); - /* the storeWrite() call might generate an error */ - if (e->swap_status != SWAPOUT_WRITING) - break; - swapout_size = mem->inmem_hi - mem->swapout.queue_offset; - if (e->store_status == STORE_PENDING) - if (swapout_size < SM_PAGE_SIZE) - break; - } while (swapout_size > 0); - if (NULL == mem->swapout.sio) - /* oops, we're not swapping out any more */ - return; - if (e->store_status == STORE_OK) { - /* - * If the state is STORE_OK, then all data must have been given - * to the filesystem at this point because storeSwapOut() is - * not going to be called again for this entry. - */ - assert(mem->inmem_hi == mem->swapout.queue_offset); - storeSwapOutFileClose(e); - } + (void) storeSwapOutMaintainMemObject(e); } void storeSwapOutFileClose(StoreEntry * e) { MemObject *mem = e->mem_obj; - storeIOState *sio = mem->swapout.sio; - assert(mem != NULL); - debug(20, 3) ("storeSwapOutFileClose: %s\n", storeKeyText(e->hash.key)); - debug(20, 3) ("storeSwapOutFileClose: sio = %p\n", mem->swapout.sio); - if (sio == NULL) - return; - mem->swapout.sio = NULL; - storeClose(sio); -} - -static void -storeSwapOutFileClosed(void *data, int errflag, storeIOState * sio) -{ - generic_cbdata *c = data; - StoreEntry *e = c->data; - MemObject *mem = e->mem_obj; - assert(e->swap_status == SWAPOUT_WRITING); - cbdataFree(c); - if (errflag) { - debug(20, 1) ("storeSwapOutFileClosed: dirno %d, swapfile %08X, errflag=%d\n\t%s\n", - e->swap_dirn, e->swap_filen, errflag, xstrerror()); - if (errflag == DISK_NO_SPACE_LEFT) { - storeDirDiskFull(e->swap_dirn); - storeDirConfigure(); - storeConfigure(); - } - if (e->swap_filen > 0) - storeUnlink(e); - e->swap_filen = -1; - e->swap_dirn = -1; - e->swap_status = SWAPOUT_NONE; - storeReleaseRequest(e); - } else { - /* swapping complete */ - debug(20, 3) ("storeSwapOutFileClosed: SwapOut complete: '%s' to %d, %08X\n", - storeUrl(e), e->swap_dirn, e->swap_filen); - e->swap_file_sz = objectLen(e) + mem->swap_hdr_sz; - e->swap_status = SWAPOUT_DONE; - storeDirUpdateSwapSize(&Config.cacheSwap.swapDirs[e->swap_dirn], e->swap_file_sz, 1); - if (storeCheckCachable(e)) { - storeLog(STORE_LOG_SWAPOUT, e); - storeDirSwapLog(e, SWAP_LOG_ADD); - } - statCounter.swap.outs++; - } - debug(20, 3) ("storeSwapOutFileClosed: %s:%d\n", __FILE__, __LINE__); - mem->swapout.sio = NULL; - cbdataUnlock(sio); - storeSwapOutMaintainMemObject(e); - storeUnlockObject(e); + assert(mem->swapout.sio == NULL); } -/* - * How much of the object data is on the disk? - */ -squid_off_t -storeSwapOutObjectBytesOnDisk(const MemObject * mem) -{ - /* - * NOTE: storeOffset() represents the disk file size, - * not the amount of object data on disk. - * - * If we don't have at least 'swap_hdr_sz' bytes - * then none of the object data is on disk. - * - * This should still be safe if swap_hdr_sz == 0, - * meaning we haven't even opened the swapout file - * yet. - */ - off_t nwritten; - if (mem->swapout.sio == NULL) - return mem->swapout.queue_offset; - nwritten = storeOffset(mem->swapout.sio); - if (nwritten <= mem->swap_hdr_sz) - return 0; - return nwritten - mem->swap_hdr_sz; -} - -/* - * Is this entry a candidate for writing to disk? - */ -static int -storeSwapOutAble(const StoreEntry * e) -{ - if (e->mem_obj->inmem_hi > Config.Store.maxObjectSize) - return 0; - if (!EBIT_TEST(e->flags, ENTRY_CACHABLE)) - return 0; - if (e->mem_obj->swapout.sio != NULL) - return 1; - if (e->mem_obj->swapout.queue_offset) - if (e->mem_obj->swapout.queue_offset == e->mem_obj->inmem_hi) - return 1; - if (e->mem_obj->inmem_lo > 0) - return 0; - return 1; -}