Merge pull request #11692 from stiopaa1/mds_flock_addConstToMemFun

mds/flock: add const to member functions
This commit is contained in:
John Spray 2016-11-11 12:07:46 +01:00 committed by GitHub
commit 52efd27aec
2 changed files with 5 additions and 5 deletions

View File

@ -28,9 +28,9 @@ ceph_lock_state_t::~ceph_lock_state_t()
}
}
bool ceph_lock_state_t::is_waiting(const ceph_filelock &fl)
bool ceph_lock_state_t::is_waiting(const ceph_filelock &fl) const
{
multimap<uint64_t, ceph_filelock>::iterator p = waiting_locks.find(fl.start);
multimap<uint64_t, ceph_filelock>::const_iterator p = waiting_locks.find(fl.start);
while (p != waiting_locks.end()) {
if (p->second.start > fl.start)
return false;
@ -77,7 +77,7 @@ void ceph_lock_state_t::remove_waiting(const ceph_filelock& fl)
bool ceph_lock_state_t::is_deadlock(const ceph_filelock& fl,
list<multimap<uint64_t, ceph_filelock>::iterator>&
overlapping_locks,
const ceph_filelock *first_fl, unsigned depth)
const ceph_filelock *first_fl, unsigned depth) const
{
ldout(cct,15) << "is_deadlock " << fl << dendl;

View File

@ -87,7 +87,7 @@ public:
* @param fl The filelock to check for
* @returns True if the lock is waiting, false otherwise
*/
bool is_waiting(const ceph_filelock &fl);
bool is_waiting(const ceph_filelock &fl) const;
/**
* Remove a lock from the waiting_locks list
*
@ -144,7 +144,7 @@ private:
bool is_deadlock(const ceph_filelock& fl,
list<multimap<uint64_t, ceph_filelock>::iterator>&
overlapping_locks,
const ceph_filelock *first_fl=NULL, unsigned depth=0);
const ceph_filelock *first_fl=NULL, unsigned depth=0) const;
/**
* Add a lock to the waiting_locks list