diff options
author | Alex Elder <elder@inktank.com> | 2013-04-05 21:46:01 +0200 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-05-02 06:18:33 +0200 |
commit | ca8b3a69174b04376722672d7dd6b666a7f17c50 (patch) | |
tree | 68c78a604897ae23ff10d971d511b8e2690e2f58 /fs/ceph/mds_client.c | |
parent | libceph: replace message data pointer with list (diff) | |
download | linux-ca8b3a69174b04376722672d7dd6b666a7f17c50.tar.xz linux-ca8b3a69174b04376722672d7dd6b666a7f17c50.zip |
libceph: implement multiple data items in a message
This patch adds support to the messenger for more than one data item
in its data list.
A message data cursor has two more fields to support this:
- a count of the number of bytes left to be consumed across
all data items in the list, "total_resid"
- a pointer to the head of the list (for validation only)
The cursor initialization routine has been split into two parts: the
outer one, which initializes the cursor for traversing the entire
list of data items; and the inner one, which initializes the cursor
to start processing a single data item.
When a message cursor is first initialized, the outer initialization
routine sets total_resid to the length provided. The data pointer
is initialized to the first data item on the list. From there, the
inner initialization routine finishes by setting up to process the
data item the cursor points to.
Advancing the cursor consumes bytes in total_resid. If the resid
field reaches zero, it means the current data item is fully
consumed. If total_resid indicates there is more data, the cursor
is advanced to point to the next data item, and then the inner
initialization routine prepares for using that. (A check is made at
this point to make sure we don't wrap around the front of the list.)
The type-specific init routines are modified so they can be given a
length that's larger than what the data item can support. The resid
field is initialized to the smaller of the provided length and the
length of the entire data item.
When total_resid reaches zero, we're done.
This resolves:
http://tracker.ceph.com/issues/3761
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'fs/ceph/mds_client.c')
0 files changed, 0 insertions, 0 deletions