/*
- * $Id: protos.h,v 1.267 1998/09/15 19:37:56 wessels Exp $
+ * $Id: protos.h,v 1.268 1998/09/20 01:14:24 wessels Exp $
*
*
* SQUID Internet Object Cache http://squid.nlanr.net/Squid/
extern void storeCheckSwapOut(StoreEntry * e);
extern void storeSwapOutFileClose(StoreEntry * e);
extern int storeSwapOutWriteQueued(MemObject * mem);
+extern int storeSwapOutAble(const StoreEntry * e);
/*
* store_client.c
/*
- * $Id: store_client.cc,v 1.45 1998/09/19 23:10:30 wessels Exp $
+ * $Id: store_client.cc,v 1.46 1998/09/20 01:14:25 wessels Exp $
*
* DEBUG: section 20 Storage Manager Client-Side Interface
* AUTHOR: Duane Wessels
if (sc->type == STORE_DISK_CLIENT)
/* assert we'll be able to get the data we want */
/* maybe we should open swapin_fd here */
- assert(e->swap_file_number > -1);
+ assert(e->swap_file_number > -1 || storeSwapOutAble(e));
for (T = &mem->clients; *T; T = &(*T)->next);
*T = sc;
}
/*
- * $Id: store_swapout.cc,v 1.33 1998/09/19 17:06:16 wessels Exp $
+ * $Id: store_swapout.cc,v 1.34 1998/09/20 01:14:25 wessels Exp $
*
* DEBUG: section 20 Storage Manager Swapout Functions
* AUTHOR: Duane Wessels
static FOCB storeSwapOutFileOpened;
static off_t storeSwapOutObjectBytesOnDisk(const MemObject *);
-static int storeSwapOutAble(const StoreEntry * e);
/* start swapping object to disk */
void
/*
* Is this entry a candidate for writing to disk?
*/
-static int
+int
storeSwapOutAble(const StoreEntry * e)
{
+ store_client *sc;
if (e->swap_status == SWAPOUT_OPENING)
return 1;
if (e->mem_obj->swapout.fd > -1)
if (e->mem_obj->inmem_lo > 0)
return 0;
/* swapout.fd == -1 && inmem_lo == 0 */
+ /*
+ * If there are DISK clients, we must write to disk
+ * even if its not cachable
+ */
+ for (sc = e->mem_obj->clients; sc; sc=sc->next)
+ if (sc->type == STORE_DISK_CLIENT)
+ return 1;
return EBIT_TEST(e->flags, ENTRY_CACHABLE);
}