Skip to content

Commit

Permalink
mds/flock: add const to member functions
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Jarzabek <[email protected]>
  • Loading branch information
stiopaa1 committed Oct 30, 2016
1 parent ee5a43c commit 66bcf0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/mds/flock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions src/mds/flock.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ceph_lock_state_t {
* @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
*
Expand Down Expand Up @@ -144,7 +144,7 @@ class ceph_lock_state_t {
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
Expand Down

0 comments on commit 66bcf0b

Please sign in to comment.