From: Henrik Nordstrom Date: Mon, 27 Jul 2009 22:03:12 +0000 (+0200) Subject: Make client attaching while an object is being swapped in disk clients X-Git-Tag: SQUID_3_2_0_1~795^2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=344a9006cb70c644f2f13ccd5ddbf0ba912df463;p=thirdparty%2Fsquid.git Make client attaching while an object is being swapped in disk clients so they can do the swapin if needed. --- diff --git a/src/store.cc b/src/store.cc index ca7f056559..dc3b80bdaa 100644 --- a/src/store.cc +++ b/src/store.cc @@ -313,11 +313,18 @@ StoreEntry::storeClientType() const if (store_status == STORE_OK) { /* the object has completed. */ - if (mem_obj->inmem_lo == 0 && !isEmpty()) - /* hot object */ - return STORE_MEM_CLIENT; - else - return STORE_DISK_CLIENT; + if (mem_obj->inmem_lo == 0 && !isEmpty()) { + if (swap_status == SWAPOUT_DONE) { + if (mem_obj->endOffset() == mem_obj->object_sz) { + /* hot object fully swapped in */ + return STORE_MEM_CLIENT; + } + } else { + /* Memory-only, or currently being swapped out */ + return STORE_MEM_CLIENT; + } + } + return STORE_DISK_CLIENT; } /* here and past, entry is STORE_PENDING */