Skip to content

Commit

Permalink
Removed no longer needed private methods of the ZSwapDebug class.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvitaly committed Oct 19, 2024
1 parent c49ecab commit 36bd5d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 37 deletions.
32 changes: 11 additions & 21 deletions src/lib/zswapdebug/zswapdebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,57 +17,57 @@

unsigned long ZSwapDebug::GetDuplicateEntry() const
{
return ReadModuleDebugValueUnsigned("duplicate_entry");
return ReadModuleDebugValue<unsigned long>("duplicate_entry", 0UL);
}

unsigned long ZSwapDebug::GetPoolLimitHit() const
{
return ReadModuleDebugValueUnsigned("pool_limit_hit");
return ReadModuleDebugValue<unsigned long>("pool_limit_hit", 0UL);
}

unsigned long ZSwapDebug::GetPoolTotalSize() const
{
return ReadModuleDebugValueUnsigned("pool_total_size");
return ReadModuleDebugValue<unsigned long>("pool_total_size", 0UL);
}

unsigned long ZSwapDebug::GetRejectAllocFail() const
{
return ReadModuleDebugValueUnsigned("reject_alloc_fail");
return ReadModuleDebugValue<unsigned long>("reject_alloc_fail", 0UL);
}

unsigned long ZSwapDebug::GetRejectCompressPoor() const
{
return ReadModuleDebugValueUnsigned("reject_compress_poor");
return ReadModuleDebugValue<unsigned long>("reject_compress_poor", 0UL);
}

unsigned long ZSwapDebug::GetRejectKmemCacheFail() const
{
return ReadModuleDebugValueUnsigned("reject_kmemcache_fail");
return ReadModuleDebugValue<unsigned long>("reject_kmemcache_fail", 0UL);
}

unsigned long ZSwapDebug::GetRejectReclaimFail() const
{
return ReadModuleDebugValueUnsigned("reject_reclaim_fail");
return ReadModuleDebugValue<unsigned long>("reject_reclaim_fail", 0UL);
}

unsigned long ZSwapDebug::GetRejectCompressFail() const
{
return ReadModuleDebugValueUnsigned("reject_compress_fail");
return ReadModuleDebugValue<unsigned long>("reject_compress_fail", 0UL);
}

long ZSwapDebug::GetSameFilledPages() const
{
return ReadModuleDebugValueSigned("same_filled_pages");
return ReadModuleDebugValue<long>("same_filled_pages", 0L);
}

long ZSwapDebug::GetStoredPages() const
{
return ReadModuleDebugValueSigned("stored_pages");
return ReadModuleDebugValue<long>("stored_pages", 0L);
}

unsigned long ZSwapDebug::GetWrittenBackPages() const
{
return ReadModuleDebugValueUnsigned("written_back_pages");
return ReadModuleDebugValue<unsigned long>("written_back_pages", 0UL);
}

bool ZSwapDebug::IsDebugAvailable() const
Expand All @@ -89,13 +89,3 @@ T ZSwapDebug::ReadModuleDebugValue(const std::string& Name, const T& Default) co

return Result;
}

long ZSwapDebug::ReadModuleDebugValueSigned(const std::string& Name) const
{
return ReadModuleDebugValue<long>(Name, 0U);
}

unsigned long ZSwapDebug::ReadModuleDebugValueUnsigned(const std::string& Name) const
{
return ReadModuleDebugValue<unsigned long>(Name, 0UL);
}
16 changes: 0 additions & 16 deletions src/lib/zswapdebug/zswapdebug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,6 @@ class ZSwapDebug
*/
const std::string ModuleDebugPath = "/sys/kernel/debug/zswap/";

/**
* Reads the debug value of the ZSwap kernel module by the
* specified name as a signed integer.
* @param Name Debug value name.
* @returns Value.
*/
long ReadModuleDebugValueSigned(const std::string&) const;

/**
* Reads the debug value of the ZSwap kernel module by the
* specified name as an unsigned integer.
* @param Name Debug value name.
* @returns Value.
*/
unsigned long ReadModuleDebugValueUnsigned(const std::string&) const;

/**
* Template method for reading the debug value of the ZSwap
* kernel module by the specified name as the specified type.
Expand Down

0 comments on commit 36bd5d6

Please sign in to comment.