From 2fb219aa236c0f6dfc8510e2a0bae97e71c6c3e8 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Tue, 30 Mar 2010 16:29:02 -0700 Subject: [PATCH] msg: fix uses of MClientCaps destructor to use put() --- src/client/Client.cc | 18 +++++++++--------- src/mds/Locker.cc | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 827299a2775a3..6afa97fe65e98 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2450,7 +2450,7 @@ void Client::handle_caps(MClientCaps *m) if (inode_map.count(vino)) in = inode_map[vino]; if (!in) { dout(5) << "handle_caps don't have vino " << vino << dendl; - delete m; + m->put(); return; } @@ -2462,7 +2462,7 @@ void Client::handle_caps(MClientCaps *m) if (in->caps.count(mds) == 0) { dout(5) << "handle_caps don't have " << *in << " cap on mds" << mds << dendl; - delete m; + m->put(); return; } @@ -2474,7 +2474,7 @@ void Client::handle_caps(MClientCaps *m) case CEPH_CAP_OP_GRANT: return handle_cap_grant(in, mds, cap, m); case CEPH_CAP_OP_FLUSH_ACK: return handle_cap_flush_ack(in, mds, cap, m); default: - delete m; + m->put(); } } @@ -2502,7 +2502,7 @@ void Client::handle_cap_import(Inode *in, MClientCaps *m) << ", keeping exporting_issued " << ccap_string(in->exporting_issued) << " mseq " << in->exporting_mseq << " by mds" << in->exporting_mds << dendl; } - delete m; + m->put(); } void Client::handle_cap_export(Inode *in, MClientCaps *m) @@ -2539,7 +2539,7 @@ void Client::handle_cap_export(Inode *in, MClientCaps *m) remove_cap(in, mds); - delete m; + m->put(); } void Client::handle_cap_trunc(Inode *in, MClientCaps *m) @@ -2562,7 +2562,7 @@ void Client::handle_cap_trunc(Inode *in, MClientCaps *m) } in->reported_size = in->size = m->get_size(); - delete m; + m->put(); } void Client::handle_cap_flush_ack(Inode *in, int mds, InodeCap *cap, MClientCaps *m) @@ -2599,7 +2599,7 @@ void Client::handle_cap_flush_ack(Inode *in, int mds, InodeCap *cap, MClientCaps } } - delete m; + m->put(); } @@ -2624,7 +2624,7 @@ void Client::handle_cap_flushsnap_ack(Inode *in, MClientCaps *m) // we may not have it if we send multiple FLUSHSNAP requests and (got multiple FLUSHEDSNAPs back) } - delete m; + m->put(); } @@ -2706,7 +2706,7 @@ void Client::handle_cap_grant(Inode *in, int mds, InodeCap *cap, MClientCaps *m) if (new_caps) signal_cond_list(in->waitfor_caps); - delete m; + m->put(); } diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index 31d4b71a6dc9c..0e405a8c9c73f 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1647,7 +1647,7 @@ void Locker::handle_client_caps(MClientCaps *m) CInode *head_in = mdcache->get_inode(m->get_ino()); if (!head_in) { dout(7) << "handle_client_caps on unknown ino " << m->get_ino() << ", dropping" << dendl; - delete m; + m->put(); return; } @@ -1664,7 +1664,7 @@ void Locker::handle_client_caps(MClientCaps *m) cap = in->get_client_cap(client); if (!cap) { dout(7) << "handle_client_caps no cap for client" << client << " on " << *in << dendl; - delete m; + m->put(); return; } assert(cap); @@ -1682,7 +1682,7 @@ void Locker::handle_client_caps(MClientCaps *m) if (ceph_seq_cmp(m->get_mseq(), cap->get_mseq()) < 0) { dout(7) << "handle_client_caps mseq " << m->get_mseq() << " < " << cap->get_mseq() << ", dropping" << dendl; - delete m; + m->put(); return; } @@ -1793,7 +1793,7 @@ void Locker::handle_client_caps(MClientCaps *m) } out: - delete m; + m->put(); } void Locker::process_cap_update(MDRequest *mdr, client_t client, -- 2.39.5