From: Greg Farnum Date: Thu, 21 Aug 2014 03:02:45 +0000 (-0700) Subject: Server: add snapbl to MDRequest and eliminate last explicit MClientReply X-Git-Tag: v0.89~50^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e980d1b29100f5797f1c97ed5fd5c962cf41af95;p=ceph.git Server: add snapbl to MDRequest and eliminate last explicit MClientReply Signed-off-by: Greg Farnum --- diff --git a/src/mds/Mutation.h b/src/mds/Mutation.h index a7d8de986212..166fa3bfa107 100644 --- a/src/mds/Mutation.h +++ b/src/mds/Mutation.h @@ -203,6 +203,7 @@ struct MDRequestImpl : public MutationImpl, public TrackedOp { int getattr_caps; ///< caps requested by getattr bufferlist reply_extra_bl; + bufferlist reply_snapbl; // inos we did a embedded cap release on, and may need to eval if we haven't since reissued map cap_releases; diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 61fb6b74bc2e..e59f6c5d1588 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -960,6 +960,7 @@ void Server::early_reply(MDRequestRef& mdr, CInode *tracei, CDentry *tracedn) } reply->set_extra_bl(mdr->reply_extra_bl); + assert(mdr->reply_snapbl.length() == 0); // only used on mksnap req->get_connection()->send_message(reply); mdr->did_early_reply = true; @@ -1047,6 +1048,7 @@ void Server::reply_request(MDRequestRef& mdr, MClientReply *reply) // We can set the extra bl unconditionally: if it's already been sent in the // early_reply, set_extra_bl will have claimed it and reply_extra_bl is empty reply->set_extra_bl(mdr->reply_extra_bl); + reply->snapbl = mdr->reply_snapbl; reply->set_mdsmap_epoch(mds->mdsmap->get_epoch()); client_con->send_message(reply); @@ -7507,10 +7509,9 @@ void Server::_mksnap_finish(MDRequestRef& mdr, CInode *diri, SnapInfo &info) // yay mdr->in[0] = diri; mdr->snapid = info.snapid; - MClientReply *reply = new MClientReply(mdr->client_request, 0); - reply->snapbl = diri->snaprealm->get_snap_trace(); + mdr->reply_snapbl = diri->snaprealm->get_snap_trace(); mdr->tracei = diri; - reply_request(mdr, reply); + reply_request(mdr, 0); }