You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2010/09/17 01:06:29 UTC

svn commit: r997945 - in /trafficserver/traffic/trunk/iocore/cache: Cache.cc Store.cc

Author: jplevyak
Date: Thu Sep 16 23:06:29 2010
New Revision: 997945

URL: http://svn.apache.org/viewvc?rev=997945&view=rev
Log:
TS-43: slipped a sign (- for +) TS-43 fix which resulted in a bad size of disk
calculation, this only effected code since the first TS-43 checkin

Modified:
    trafficserver/traffic/trunk/iocore/cache/Cache.cc
    trafficserver/traffic/trunk/iocore/cache/Store.cc

Modified: trafficserver/traffic/trunk/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Cache.cc?rev=997945&r1=997944&r2=997945&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Cache.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Cache.cc Thu Sep 16 23:06:29 2010
@@ -544,7 +544,7 @@ CacheProcessor::start_internal(int flags
         if (sd->hw_sector_size <= 0 || sector_size > STORE_BLOCK_SIZE)
           Error("bad hardware sector size");
         off_t skip = ROUND_TO_STORE_BLOCK((sd->offset < START_POS ? START_POS + sd->alignment : sd->offset));
-        blocks = blocks - ROUND_TO_STORE_BLOCK(sd->offset - skip);
+        blocks = blocks - ROUND_TO_STORE_BLOCK(sd->offset + skip);
         gdisks[gndisks]->open(path, blocks, skip, sector_size, fd, clear);
         gndisks++;
       }
@@ -691,13 +691,13 @@ CacheProcessor::cacheInitialized()
 
   if (theCache) {
     total_size += theCache->cache_size;
-    Debug("cache_init", "CacheProcessor::cacheInitialized - theCache, total_size = %lld = %lld",
-          total_size, total_size / (1024 * 1024));
+    Debug("cache_init", "CacheProcessor::cacheInitialized - theCache, total_size = %lld = %lld MB",
+          total_size, total_size / ((1024 * 1024) / STORE_BLOCK_SIZE));
   }
   if (theStreamCache) {
     total_size += theStreamCache->cache_size;
-    Debug("cache_init", "CacheProcessor::cacheInitialized - theStreamCache, total_size = %lld = %lld",
-          total_size, total_size / (1024 * 1024));
+    Debug("cache_init", "CacheProcessor::cacheInitialized - theStreamCache, total_size = %lld = %lld MB",
+          total_size, total_size / ((1024 * 1024) / STORE_BLOCK_SIZE));
   }
 
   if (theCache) {

Modified: trafficserver/traffic/trunk/iocore/cache/Store.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/iocore/cache/Store.cc?rev=997945&r1=997944&r2=997945&view=diff
==============================================================================
--- trafficserver/traffic/trunk/iocore/cache/Store.cc (original)
+++ trafficserver/traffic/trunk/iocore/cache/Store.cc Thu Sep 16 23:06:29 2010
@@ -633,7 +633,7 @@ Span::init(char *filename, int64 size)
 #endif
 
   if (is_disk) {
-    long physsectors = 0;
+    uint32 physsectors = 0;
 
     /* Disks cannot be mmapped */
     is_mmapable_internal = false;
@@ -671,6 +671,9 @@ Span::init(char *filename, int64 size)
      * possibly something other than the actual number of blocks, but the
      * code for other arches seems to.  Revisit this, perhaps. */
     blocks = size / STORE_BLOCK_SIZE;
+    
+    Debug("cache_init", "Span::init physical sectors %u total size %lld geometry size %lld store blocks %lld", 
+          physsectors, hw_sector_size * (int64)physsectors, size, blocks);
 
     pathname = xstrdup(filename);
     file_pathname = 1;