This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 3e4eb4eb4 Cleanup: Remove unused functions of cache (#9166)
3e4eb4eb4 is described below

commit 3e4eb4eb4b1272dd7b2cd584d64b347bbb4336ef
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Tue Nov 1 09:13:31 2022 +0900

    Cleanup: Remove unused functions of cache (#9166)
---
 iocore/cache/Cache.cc     | 27 ---------------------------
 iocore/cache/I_Cache.h    |  1 -
 iocore/cache/P_CacheDir.h |  1 -
 iocore/cache/P_CacheVol.h | 12 ------------
 4 files changed, 41 deletions(-)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 652984ab6..dd1751b41 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -1073,15 +1073,6 @@ CacheProcessor::dir_check(bool afix)
   return 0;
 }
 
-int
-CacheProcessor::db_check(bool afix)
-{
-  for (int i = 0; i < gnvol; i++) {
-    gvol[i]->db_check(afix);
-  }
-  return 0;
-}
-
 Action *
 CacheProcessor::lookup(Continuation *cont, const CacheKey *key, CacheFragType 
frag_type, const char *hostname, int host_len)
 {
@@ -1135,24 +1126,6 @@ CacheProcessor::IsCacheReady(CacheFragType type)
   return static_cast<bool>(cache_ready & (1 << type));
 }
 
-int
-Vol::db_check(bool /* fix ATS_UNUSED */)
-{
-  char tt[256];
-  printf("    Data for [%s]\n", hash_text.get());
-  printf("        Length:          %" PRIu64 "\n", static_cast<uint64_t>(len));
-  printf("        Write Position:  %" PRIu64 "\n", 
static_cast<uint64_t>(header->write_pos - skip));
-  printf("        Phase:           %d\n", static_cast<int>(!!header->phase));
-  ink_ctime_r(&header->create_time, tt);
-  tt[strlen(tt) - 1] = 0;
-  printf("        Create Time:     %s\n", tt);
-  printf("        Sync Serial:     %u\n", static_cast<unsigned 
int>(header->sync_serial));
-  printf("        Write Serial:    %u\n", static_cast<unsigned 
int>(header->write_serial));
-  printf("\n");
-
-  return 0;
-}
-
 static void
 vol_init_data_internal(Vol *d)
 {
diff --git a/iocore/cache/I_Cache.h b/iocore/cache/I_Cache.h
index 103d22ddc..5cdb1f604 100644
--- a/iocore/cache/I_Cache.h
+++ b/iocore/cache/I_Cache.h
@@ -72,7 +72,6 @@ struct CacheProcessor : public Processor {
   void stop();
 
   int dir_check(bool fix);
-  int db_check(bool fix);
 
   Action *lookup(Continuation *cont, const CacheKey *key, CacheFragType 
frag_type = CACHE_FRAG_TYPE_NONE,
                  const char *hostname = nullptr, int host_len = 0);
diff --git a/iocore/cache/P_CacheDir.h b/iocore/cache/P_CacheDir.h
index 70e6bfded..b83e6111a 100644
--- a/iocore/cache/P_CacheDir.h
+++ b/iocore/cache/P_CacheDir.h
@@ -274,7 +274,6 @@ struct CacheSync : public Continuation {
 // Global Functions
 
 void vol_init_dir(Vol *d);
-int dir_token_probe(const CacheKey *, Vol *, Dir *);
 int dir_probe(const CacheKey *, Vol *, Dir *, Dir **);
 int dir_insert(const CacheKey *key, Vol *d, Dir *to_part);
 int dir_overwrite(const CacheKey *key, Vol *d, Dir *to_part, Dir *overwrite, 
bool must_overwrite = true);
diff --git a/iocore/cache/P_CacheVol.h b/iocore/cache/P_CacheVol.h
index 24d9d4313..cf91c2aa9 100644
--- a/iocore/cache/P_CacheVol.h
+++ b/iocore/cache/P_CacheVol.h
@@ -204,21 +204,10 @@ struct Vol : public Continuation {
   int dir_init_done(int event, void *data);
 
   int dir_check(bool fix);
-  int db_check(bool fix);
 
   bool evac_bucket_valid(off_t bucket) const;
 
   int is_io_in_progress() const;
-  int
-  increment_generation()
-  {
-    // this is stored in the offset field of the directory (!=0)
-    ink_assert(mutex->thread_holding == this_ethread());
-    header->generation++;
-    if (!header->generation)
-      header->generation++;
-    return header->generation;
-  }
   void set_io_not_in_progress();
 
   int aggWriteDone(int event, Event *e);
@@ -317,7 +306,6 @@ struct Doc {
   uint32_t data_len() const;
   uint32_t prefix_len() const;
   int single_fragment() const;
-  int no_data_in_fragment();
   char *hdr();
   char *data();
 };

Reply via email to