]> git.apps.os.sepia.ceph.com Git - ceph-client.git/commit
libceph: add sparse read support to msgr2 crc state machine
authorJeff Layton <jlayton@kernel.org>
Tue, 25 Jan 2022 13:26:31 +0000 (08:26 -0500)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 14:45:08 +0000 (10:45 -0400)
commit44a495843cd434dc61780b12ba1bc7aba8da19f6
treeedee15b03f0e07bf4fb1a16634c2f7e752280a04
parent0810ae7b95375c2076c09e59591a965c13b07bcf
libceph: add sparse read support to msgr2 crc state machine

Add support for a new sparse_read ceph_connection operation. The idea is
that the client driver can define this operation use it to do special
handling for incoming reads.

The alloc_msg routine will look at the request and determine whether the
reply is expected to be sparse. If it is, then we'll dispatch to a
different set of state machine states that will repeatedly call the
driver's sparse_read op to get length and placement info for reading the
extent map, and the extents themselves.

This necessitates adding some new field to some other structs:

- The msg gets a new bool to track whether it's a sparse_read request.

- A new field is added to the cursor to track the amount remaining in the
current extent. This is used to cap the read from the socket into the
msg_data

- Handing a revoke with all of this is particularly difficult, so I've
added a new data_len_remain field to the v2 connection info, and then
use that to skip that much on a revoke. We may want to expand the use of
that to the normal read path as well, just for consistency's sake.

Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
include/linux/ceph/messenger.h
net/ceph/messenger.c
net/ceph/messenger_v2.c