]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: set response data fields earlier
authorAlex Elder <elder@inktank.com>
Tue, 5 Mar 2013 00:29:06 +0000 (18:29 -0600)
committerGreg Farnum <greg@inktank.com>
Wed, 13 Mar 2013 00:45:11 +0000 (17:45 -0700)
commit8fb0e266930a2d9738d71409483c4b676b7c10c5
treeea6f2d66c817ae0397122f3ec4b586baaa6b25d2
parenta4f948c11f5b02a5cfd0b1b7d319f6943cd2c56d
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