Skip to content

Commit e972233

Browse files
committed
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 <[email protected]>
1 parent e081268 commit e972233

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/common/MemoryModel.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
#define dout_subsys ceph_subsys_
1111

1212
using namespace std;
13+
using mem_snap_t = MemoryModel::mem_snap_t;
1314

1415
MemoryModel::MemoryModel(CephContext *cct_)
1516
: cct(cct_)
1617
{
1718
}
1819

19-
void MemoryModel::_sample(snap *psnap)
20+
void MemoryModel::_sample(mem_snap_t *psnap)
2021
{
2122
ifstream f;
2223

src/common/MemoryModel.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919

2020
class MemoryModel {
2121
public:
22-
struct snap {
22+
struct mem_snap_t {
2323
long peak;
2424
long size;
2525
long hwm;
2626
long rss;
2727
long data;
2828
long lib;
29-
29+
3030
long heap;
3131

32-
snap() : peak(0), size(0), hwm(0), rss(0), data(0), lib(0),
32+
mem_snap_t() : peak(0), size(0), hwm(0), rss(0), data(0), lib(0),
3333
heap(0)
3434
{}
3535

@@ -40,11 +40,11 @@ class MemoryModel {
4040

4141
private:
4242
CephContext *cct;
43-
void _sample(snap *p);
43+
void _sample(mem_snap_t *p);
4444

4545
public:
4646
explicit MemoryModel(CephContext *cct);
47-
void sample(snap *p = 0) {
47+
void sample(mem_snap_t *p = 0) {
4848
_sample(&last);
4949
if (p)
5050
*p = last;

src/mds/MDCache.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7816,9 +7816,9 @@ void MDCache::trim_client_leases()
78167816
void MDCache::check_memory_usage()
78177817
{
78187818
static MemoryModel mm(g_ceph_context);
7819-
static MemoryModel::snap last;
7819+
static MemoryModel::mem_snap_t last;
78207820
mm.sample(&last);
7821-
static MemoryModel::snap baseline = last;
7821+
static MemoryModel::mem_snap_t baseline = last;
78227822

78237823
// check client caps
78247824
ceph_assert(CInode::count() == inode_map.size() + snap_inode_map.size() + num_shadow_inodes);

0 commit comments

Comments
 (0)