]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common: rename MemoryModel::snap to mem_snap_t
authorRonen Friedman <rfriedma@redhat.com>
Mon, 17 Jun 2024 17:16:10 +0000 (12:16 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Tue, 18 Jun 2024 08:06:54 +0000 (03:06 -0500)
as 'snap' as a struct name does not follow the naming convention, and
'snap' is way overloaded in the codebase.

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/common/MemoryModel.cc
src/common/MemoryModel.h
src/mds/MDCache.cc

index 0f6ab986f5aa67212aa086ef1458fbfae957d01e..e6511547db3272123a68916d8fb511e07a629a39 100644 (file)
 #define dout_subsys ceph_subsys_
 
 using namespace std;
+using mem_snap_t = MemoryModel::mem_snap_t;
 
 MemoryModel::MemoryModel(CephContext *cct_)
   : cct(cct_)
 {
 }
 
-void MemoryModel::_sample(snap *psnap)
+void MemoryModel::_sample(mem_snap_t *psnap)
 {
   ifstream f;
 
index 658173491f828b4b442c3f45a04e10d961f8678c..ca14819145424da42d20357a10a37b38dc1e6169 100644 (file)
 
 class MemoryModel {
 public:
-  struct snap {
+  struct mem_snap_t {
     long peak;
     long size;
     long hwm;
     long rss;
     long data;
     long lib;
-    
+
     long heap;
 
-    snap() : peak(0), size(0), hwm(0), rss(0), data(0), lib(0),
+    mem_snap_t() : peak(0), size(0), hwm(0), rss(0), data(0), lib(0),
             heap(0)
     {}
 
@@ -40,11 +40,11 @@ public:
 
 private:
   CephContext *cct;
-  void _sample(snap *p);
+  void _sample(mem_snap_t *p);
 
 public:
   explicit MemoryModel(CephContext *cct);
-  void sample(snap *p = 0) {
+  void sample(mem_snap_t *p = 0) {
     _sample(&last);
     if (p)
       *p = last;
index 2ba0d638af0a11a868b95c01d394771ca116b9c2..dd99f861ed4e42f4c1a41260db4ca2d6161a9cc1 100644 (file)
@@ -7816,9 +7816,9 @@ void MDCache::trim_client_leases()
 void MDCache::check_memory_usage()
 {
   static MemoryModel mm(g_ceph_context);
-  static MemoryModel::snap last;
+  static MemoryModel::mem_snap_t last;
   mm.sample(&last);
-  static MemoryModel::snap baseline = last;
+  static MemoryModel::mem_snap_t baseline = last;
 
   // check client caps
   ceph_assert(CInode::count() == inode_map.size() + snap_inode_map.size() + num_shadow_inodes);