]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Summary: Tweak the COSS update.
authorrobertc <>
Sat, 30 Aug 2003 12:39:24 +0000 (12:39 +0000)
committerrobertc <>
Sat, 30 Aug 2003 12:39:24 +0000 (12:39 +0000)
Keywords:

Parse coss options.
Fix (hopefully correctly) some signed < unsigned comparisons.

src/fs/coss/store_dir_coss.cc
src/fs/coss/store_io_coss.cc

index 14b92ec11669f4eb9bc330d299f204bcd0e8c06d..454f44b349192e6de8c0abf7fecd8b18b192e140 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_coss.cc,v 1.48 2003/08/27 21:19:38 wessels Exp $
+ * $Id: store_dir_coss.cc,v 1.49 2003/08/30 06:39:24 robertc Exp $
  *
  * DEBUG: section 47    Store COSS Directory Routines
  * AUTHOR: Eric Stern
@@ -861,7 +861,7 @@ CossSwapDir::parse(int anIndex, char *aPath)
 
     if (max_size > (max_offset>>10)) {
         debug(47,0)("COSS block-size = %d bytes\n", 1<<blksz_bits);
-        debug(47,0)("COSS largest file offset = %llu KB\n", max_offset >> 10);
+        debugs(47,0, "COSS largest file offset = " << (max_offset >> 10) << " KB");
         debug(47,0)("COSS cache_dir size = %d KB\n", max_size);
         fatal("COSS cache_dir size exceeds largest offset\n");
     }
index 2153d72da651cf035b75bfae212662f62c2e3c3f..b86a6471ca356d6e5c14eb2666074282e4f61224 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_io_coss.cc,v 1.23 2003/08/27 21:19:38 wessels Exp $
+ * $Id: store_io_coss.cc,v 1.24 2003/08/30 06:39:24 robertc Exp $
  *
  * DEBUG: section 79    Storage Manager COSS Interface
  * AUTHOR: Eric Stern
@@ -116,7 +116,7 @@ storeCossAllocate(CossSwapDir * SD, const StoreEntry * e, int which)
 
     /* Check if we have overflowed the disk .. */
     /* SD->max_size is int, so cast to (off_t) *before* bit-shifting */
-    if ((SD->current_offset + allocsize) > ((off_t)SD->max_size << 10)) {
+    if ((off_t)(SD->current_offset + allocsize) > ((off_t)SD->max_size << 10)) {
         /*
          * tried to allocate past the end of the disk, so wrap
          * back to the beginning
@@ -414,7 +414,7 @@ CossSwapDir::storeCossFilenoToMembuf(sfileno f)
     for (m = membufs.head; m; m = m->next) {
         t = (CossMemBuf *)m->data;
 
-        if ((o >= t->diskstart) && (o < t->diskend))
+        if ((o >= (off_t)t->diskstart) && (o < (off_t)t->diskend))
             break;
     }
 
@@ -665,7 +665,7 @@ storeCossCreateMemBuf(CossSwapDir * SD, size_t start,
         if (curfn == e->swap_filen)
             *collision = 1;    /* Mark an object alloc collision */
 
-        if ((o >= newmb->diskstart) && (o < newmb->diskend)) {
+        if ((o >= (off_t)newmb->diskstart) && (o < (off_t)newmb->diskend)) {
             storeRelease(e);
             numreleased++;
         } else