]> git-server-git.apps.pok.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)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 15 Aug 2022 12:51:40 +0000 (14:51 +0200)
commitb766ae044b5daee41252a41178b51064572f573a
treeb03b5d66c9dc41ce729f69b09be499880fdb3627
parent9d6ce2cdca453d67ddad371b145b397d0cffc17b
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