ceph: add new mount option to enable sparse reads
authorJeff Layton <jlayton@kernel.org>
Sat, 26 Feb 2022 11:33:03 +0000 (06:33 -0500)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 22 Aug 2023 07:01:47 +0000 (09:01 +0200)
commit03bc06c7b0bd8d86b9f17f459acaeb1283ba2700
tree4fac68b0dbfa895f1851e00653a8e1a2ca7f217f
parentf628d799972799023d32c2542bb2639eb8c4f84e
ceph: add new mount option to enable sparse reads

Add a new mount option that has the client issue sparse reads instead of
normal ones. The callers now preallocate an sparse extent buffer that
the libceph receive code can populate and hand back after the operation
completes.

After a successful sparse read, we can't use the req->r_result value to
determine the amount of data "read", so instead we set the received
length to be from the end of the last extent in the buffer. Any
interstitial holes will have been filled by the receive code.

[ xiubli: fix a double free on req reported by Ilya ]

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/addr.c
fs/ceph/file.c
fs/ceph/super.c
fs/ceph/super.h