From f41a2f87c2954a4ae5d34a6fb545b9cefd30103f Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Mon, 10 Mar 2014 16:08:11 -0700 Subject: [PATCH] Locker: use MDRequestRef instead of MDRequest* Signed-off-by: Greg Farnum --- src/mds/Locker.cc | 18 +++++++++--------- src/mds/Locker.h | 18 +++++++++--------- src/mds/MDCache.cc | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 6a274bb432ede..042da7ff7bdbf 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -169,7 +169,7 @@ void Locker::include_snap_rdlocks_wlayout(set& rdlocks, CInode *in, /* If this function returns false, the mdr has been placed * on the appropriate wait list */ -bool Locker::acquire_locks(MDRequest *mdr, +bool Locker::acquire_locks(MDRequestRef& mdr, set &rdlocks, set &wrlocks, set &xlocks, @@ -1149,7 +1149,7 @@ bool Locker::rdlock_try(SimpleLock *lock, client_t client, Context *con) return false; } -bool Locker::rdlock_start(SimpleLock *lock, MDRequest *mut, bool as_anon) +bool Locker::rdlock_start(SimpleLock *lock, MDRequestRef& mut, bool as_anon) { dout(7) << "rdlock_start on " << *lock << " on " << *lock->get_parent() << dendl; @@ -1287,7 +1287,7 @@ void Locker::wrlock_force(SimpleLock *lock, Mutation *mut) mut->locks.insert(lock); } -bool Locker::wrlock_start(SimpleLock *lock, MDRequest *mut, bool nowait) +bool Locker::wrlock_start(SimpleLock *lock, MDRequestRef& mut, bool nowait) { if (lock->get_type() == CEPH_LOCK_IVERSION || lock->get_type() == CEPH_LOCK_DVERSION) @@ -1376,7 +1376,7 @@ void Locker::wrlock_finish(SimpleLock *lock, Mutation *mut, bool *pneed_issue) // remote wrlock -void Locker::remote_wrlock_start(SimpleLock *lock, int target, MDRequest *mut) +void Locker::remote_wrlock_start(SimpleLock *lock, int target, MDRequestRef& mut) { dout(7) << "remote_wrlock_start mds." << target << " on " << *lock << " on " << *lock->get_parent() << dendl; @@ -1423,7 +1423,7 @@ void Locker::remote_wrlock_finish(SimpleLock *lock, int target, Mutation *mut) // ------------------ // xlock -bool Locker::xlock_start(SimpleLock *lock, MDRequest *mut) +bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut) { if (lock->get_type() == CEPH_LOCK_IVERSION || lock->get_type() == CEPH_LOCK_DVERSION) @@ -2542,7 +2542,7 @@ public: } }; -void Locker::process_request_cap_release(MDRequest *mdr, client_t client, const ceph_mds_request_release& item, +void Locker::process_request_cap_release(MDRequestRef& mdr, client_t client, const ceph_mds_request_release& item, const string &dname) { inodeno_t ino = (uint64_t)item.ino; @@ -2652,7 +2652,7 @@ void Locker::kick_issue_caps(CInode *in, client_t client, ceph_seq_t seq) issue_caps(in, cap); } -void Locker::kick_cap_releases(MDRequest *mdr) +void Locker::kick_cap_releases(MDRequestRef& mdr) { client_t client = mdr->get_client(); for (map::iterator p = mdr->cap_releases.begin(); @@ -4161,7 +4161,7 @@ void Locker::local_wrlock_grab(LocalLock *lock, Mutation *mut) mut->locks.insert(lock); } -bool Locker::local_wrlock_start(LocalLock *lock, MDRequest *mut) +bool Locker::local_wrlock_start(LocalLock *lock, MDRequestRef& mut) { dout(7) << "local_wrlock_start on " << *lock << " on " << *lock->get_parent() << dendl; @@ -4193,7 +4193,7 @@ void Locker::local_wrlock_finish(LocalLock *lock, Mutation *mut) } } -bool Locker::local_xlock_start(LocalLock *lock, MDRequest *mut) +bool Locker::local_xlock_start(LocalLock *lock, MDRequestRef& mut) { dout(7) << "local_xlock_start on " << *lock << " on " << *lock->get_parent() << dendl; diff --git a/src/mds/Locker.h b/src/mds/Locker.h index 605686270b7a6..90fbdcb4f74f4 100644 --- a/src/mds/Locker.h +++ b/src/mds/Locker.h @@ -84,7 +84,7 @@ public: void include_snap_rdlocks_wlayout(set& rdlocks, CInode *in, ceph_file_layout **layout); - bool acquire_locks(MDRequest *mdr, + bool acquire_locks(MDRequestRef& mdr, set &rdlocks, set &wrlocks, set &xlocks, @@ -129,20 +129,20 @@ public: bool _rdlock_kick(SimpleLock *lock, bool as_anon); bool rdlock_try(SimpleLock *lock, client_t client, Context *c); - bool rdlock_start(SimpleLock *lock, MDRequest *mut, bool as_anon=false); + bool rdlock_start(SimpleLock *lock, MDRequestRef& mut, bool as_anon=false); void rdlock_finish(SimpleLock *lock, Mutation *mut, bool *pneed_issue); bool can_rdlock_set(set& locks); bool rdlock_try_set(set& locks); void rdlock_take_set(set& locks, Mutation *mut); void wrlock_force(SimpleLock *lock, Mutation *mut); - bool wrlock_start(SimpleLock *lock, MDRequest *mut, bool nowait=false); + bool wrlock_start(SimpleLock *lock, MDRequestRef& mut, bool nowait=false); void wrlock_finish(SimpleLock *lock, Mutation *mut, bool *pneed_issue); - void remote_wrlock_start(SimpleLock *lock, int target, MDRequest *mut); + void remote_wrlock_start(SimpleLock *lock, int target, MDRequestRef& mut); void remote_wrlock_finish(SimpleLock *lock, int target, Mutation *mut); - bool xlock_start(SimpleLock *lock, MDRequest *mut); + bool xlock_start(SimpleLock *lock, MDRequestRef& mut); void _finish_xlock(SimpleLock *lock, client_t xlocker, bool *pneed_issue); void xlock_finish(SimpleLock *lock, Mutation *mut, bool *pneed_issue); @@ -209,10 +209,10 @@ public: // process_request_cap_release to preserve ordering. bool should_defer_client_cap_frozen(CInode *in); - void process_request_cap_release(MDRequest *mdr, client_t client, const ceph_mds_request_release& r, + void process_request_cap_release(MDRequestRef& mdr, client_t client, const ceph_mds_request_release& r, const string &dname); - void kick_cap_releases(MDRequest *mdr); + void kick_cap_releases(MDRequestRef& mdr); void kick_issue_caps(CInode *in, client_t client, ceph_seq_t seq); void remove_client_cap(CInode *in, client_t client); @@ -233,9 +233,9 @@ public: public: void local_wrlock_grab(LocalLock *lock, Mutation *mut); protected: - bool local_wrlock_start(LocalLock *lock, MDRequest *mut); + bool local_wrlock_start(LocalLock *lock, MDRequestRef& mut); void local_wrlock_finish(LocalLock *lock, Mutation *mut); - bool local_xlock_start(LocalLock *lock, MDRequest *mut); + bool local_xlock_start(LocalLock *lock, MDRequestRef& mut); void local_xlock_finish(LocalLock *lock, Mutation *mut); diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 1a34c4bb8ac76..793b0aaa86811 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8894,7 +8894,7 @@ MDRequestRef MDCache::request_get(metareqid_t rid) return active_requests[rid].lock(); } -void MDCache::request_finish(MDRequestRef mdr) +void MDCache::request_finish(MDRequestRef& mdr) { dout(7) << "request_finish " << *mdr << dendl; -- 2.39.5