From: Ronen Friedman Date: Mon, 17 Jun 2024 17:16:10 +0000 (-0500) Subject: common: rename MemoryModel::snap to mem_snap_t X-Git-Tag: v20.0.0~1349^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e97223399d09ef6ae96e64feb4c6d6c85d5f9e72;p=ceph.git common: rename MemoryModel::snap to mem_snap_t 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 --- diff --git a/src/common/MemoryModel.cc b/src/common/MemoryModel.cc index 0f6ab986f5a..e6511547db3 100644 --- a/src/common/MemoryModel.cc +++ b/src/common/MemoryModel.cc @@ -10,13 +10,14 @@ #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; diff --git a/src/common/MemoryModel.h b/src/common/MemoryModel.h index 658173491f8..ca148191454 100644 --- a/src/common/MemoryModel.h +++ b/src/common/MemoryModel.h @@ -19,17 +19,17 @@ 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; diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2ba0d638af0..dd99f861ed4 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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);