trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wbard...@apache.org
Subject trafficserver git commit: TS-3323 Cache scan will stop early if any empty volumes
Date Mon, 26 Jan 2015 19:03:05 GMT
Repository: trafficserver
Updated Branches:
  refs/heads/master aea7efdcb -> d5d754913


TS-3323 Cache scan will stop early if any empty volumes

In the volume empty case, match existing 'volume not empty' logic and
skip to next volume.  Also add some more checks to the disk space used
optimization to avoid false positives about directory entries being valid.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/d5d75491
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d5d75491
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d5d75491

Branch: refs/heads/master
Commit: d5d7549135ae93f97bd78067d709655f54da36ab
Parents: aea7efd
Author: William Bardwell <wbardwel@apache.org>
Authored: Mon Jan 26 11:36:48 2015 -0500
Committer: William Bardwell <wbardwel@apache.org>
Committed: Mon Jan 26 14:01:10 2015 -0500

----------------------------------------------------------------------
 CHANGES                  | 1 +
 iocore/cache/CacheVol.cc | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d5d75491/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e61a7ac..e58d89f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 5.3.0
+  *) [TS-3323] Cache scan will stop early if any empty volumes
 
   *) [TS-3320] traffic_manager does not accept "#-1" as the admin user.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d5d75491/iocore/cache/CacheVol.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheVol.cc b/iocore/cache/CacheVol.cc
index 7acbd95..9428774 100644
--- a/iocore/cache/CacheVol.cc
+++ b/iocore/cache/CacheVol.cc
@@ -134,7 +134,7 @@ static char *make_vol_map(Vol *d)
         break;
       }
       while (e) {
-        if (dir_offset(e)) {
+        if (dir_offset(e) && dir_valid(d, e) && dir_agg_valid(d, e) &&
dir_head(e)) {
             off_t offset = vol_offset(d, e) - start_offset;
             if (offset <= vol_len) vol_map[offset / SCAN_BUF_SIZE] = 1;
         }
@@ -179,7 +179,7 @@ CacheVC::scanObject(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED
*/)
     scan_vol_map = make_vol_map(vol);
     io.aiocb.aio_offset = next_in_map(vol, scan_vol_map, vol_offset_to_offset(vol, 0));
     if (io.aiocb.aio_offset >= (off_t)(vol->skip + vol->len))
-      goto Ldone;
+      goto Lnext_vol;
     io.aiocb.aio_nbytes = SCAN_BUF_SIZE;
     io.aiocb.aio_buf = buf->data();
     io.action = this;
@@ -347,6 +347,7 @@ CacheVC::scanObject(int /* event ATS_UNUSED */, Event * /* e ATS_UNUSED
*/)
   }
 
   if (io.aiocb.aio_offset >= vol->skip + vol->len) {
+Lnext_vol:
     SET_HANDLER(&CacheVC::scanVol);
     eventProcessor.schedule_in(this, HRTIME_MSECONDS(scan_msec_delay));
     return EVENT_CONT;


Mime
View raw message