]> Pileus Git - ~andy/linux/commit
libceph: set response data fields earlier
authorAlex Elder <elder@inktank.com>
Tue, 5 Mar 2013 00:29:06 +0000 (18:29 -0600)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:16:43 +0000 (21:16 -0700)
commit70636773b7c3c73677e1d653629dace7c21d14bf
treeb88e59bb77918a577f39e1a650e69464ad5716db
parent4a73ef27ad04f1b8ea23eb55e50b20fcc0530a6f
libceph: set response data fields earlier

When an incoming message is destined for the osd client, the
messenger calls the osd client's alloc_msg method.  That function
looks up which request has the tid matching the incoming message,
and returns the request message that was preallocated to receive the
response.  The response message is therefore known before the
request is even started.

Between the start of the request and the receipt of the response,
the request and its data fields will not change, so there's no
reason we need to hold off setting them.  In fact it's preferable
to set them just once because it's more obvious that they're
unchanging.

So set up the fields describing where incoming data is to land in a
response message at the beginning of ceph_osdc_start_request().
Define a helper function that sets these fields, and use it to
set the fields for both outgoing data in the request message and
incoming data in the response.

This resolves:
    http://tracker.ceph.com/issues/4284

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
net/ceph/osd_client.c