From: Michal Jarzabek Date: Thu, 27 Oct 2016 20:51:30 +0000 (+0100) Subject: mds/Mutation.h: add const to member functions X-Git-Tag: v11.1.0~496^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11670%2Fhead;p=ceph.git mds/Mutation.h: add const to member functions Signed-off-by: Michal Jarzabek --- diff --git a/src/mds/Mutation.cc b/src/mds/Mutation.cc index cb711843b02c..e8873e82631d 100644 --- a/src/mds/Mutation.cc +++ b/src/mds/Mutation.cc @@ -71,7 +71,7 @@ void MutationImpl::finish_locking(SimpleLock *lock) // auth pins -bool MutationImpl::is_auth_pinned(MDSCacheObject *object) +bool MutationImpl::is_auth_pinned(MDSCacheObject *object) const { return auth_pins.count(object) || remote_auth_pins.count(object); } @@ -192,7 +192,7 @@ MDRequestImpl::More* MDRequestImpl::more() return _more; } -bool MDRequestImpl::has_more() +bool MDRequestImpl::has_more() const { return _more != nullptr; } @@ -207,7 +207,7 @@ bool MDRequestImpl::slave_did_prepare() return has_more() && more()->slave_commit; } -bool MDRequestImpl::did_ino_allocation() +bool MDRequestImpl::did_ino_allocation() const { return alloc_ino || used_prealloc_ino || prealloc_inos.size(); } diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index 89cc92f38647..fbe259938b85 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -113,7 +113,7 @@ public: bool is_master() const { return slave_to_mds == MDS_RANK_NONE; } bool is_slave() const { return slave_to_mds != MDS_RANK_NONE; } - client_t get_client() { + client_t get_client() const { if (reqid.name.is_client()) return client_t(reqid.name.num()); return -1; @@ -144,7 +144,7 @@ public: void finish_locking(SimpleLock *lock); // auth pins - bool is_auth_pinned(MDSCacheObject *object); + bool is_auth_pinned(MDSCacheObject *object) const; void auth_pin(MDSCacheObject *object); void auth_unpin(MDSCacheObject *object); void drop_local_auth_pins(); @@ -321,10 +321,10 @@ struct MDRequestImpl : public MutationImpl, public TrackedOp { ~MDRequestImpl(); More* more(); - bool has_more(); + bool has_more() const; bool has_witnesses(); bool slave_did_prepare(); - bool did_ino_allocation(); + bool did_ino_allocation() const; bool freeze_auth_pin(CInode *inode); void unfreeze_auth_pin(bool clear_inode=false); void set_remote_frozen_auth_pin(CInode *inode);