]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Removed restriction on cache_dir max-size to be a multiple of pagesize.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 05:46:29 +0000 (22:46 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 1 Feb 2011 05:46:29 +0000 (22:46 -0700)
It was specific to Mmapped DiskIO module which we no longer use.

src/fs/rock/RockIoState.cc
src/fs/rock/RockSwapDir.cc

index 0e184444f73b99a70ff63a80a0169f4098ffcaf0..3f89ea63b8cae4bc592c031d4f15d9f5a951f1d3 100644 (file)
@@ -100,17 +100,16 @@ Rock::IoState::startWriting()
     assert(theFile->canWrite());
     assert(!theBuf.isNull());
 
-    static const int ps = getpagesize();
-    const size_t tail = (ps - (theBuf.contentSize() % ps)) % ps;
-    const int64_t writeSize = theBuf.contentSize() + tail;
+    // TODO: if DiskIO module is mmap-based, we should be writing whole pages
+    // to avoid triggering read-page;new_head+old_tail;write-page overheads
+
     debugs(79, 5, HERE << swap_filen << " at " << offset_ << '+' <<
-        theBuf.contentSize() << '+' << tail);
+        theBuf.contentSize());
 
     assert(theBuf.contentSize() <= slotSize);
-    assert(writeSize <= slotSize);
     // theFile->write may call writeCompleted immediatelly
     theFile->write(new WriteRequest(::WriteRequest(theBuf.content(), offset_,
-        writeSize, theBuf.freeFunc()), this));
+        theBuf.contentSize(), theBuf.freeFunc()), this));
 }
 
 // 
index 32f4c4363d0f996e930aeb9a9b4059720064f03a..bbe98428577fc1bcbae7b9724e441083cd697c07 100644 (file)
@@ -216,15 +216,6 @@ Rock::SwapDir::validateOptions()
     if (max_objsize <= 0)
         fatal("Rock store requires a positive max-size");
 
-    // Rock::IoState::startWriting() inflates write size to the end of the page
-    // so that mmap does not have to read the tail and then write it back.
-    // This is a weak check that the padded area will be allocated by [growing]
-    // MemBuf and a sufficient check that inflated size will not exceed the
-    // slot size.
-    static const int ps = getpagesize();
-    if (ps > 0 && (max_objsize % ps != 0))
-        fatal("Rock store max-size should be a multiple of page size");
-
     /*
     const int64_t eLimitHi = 0xFFFFFF; // Core sfileno maximum
     const int64_t eLimitLo = map.entryLimit(); // dynamic shrinking unsupported