Switch the cephfs client to use sparse reads instead of normal ones. XXX: doesn't currently work since OSD doesn't support truncate_seq on a sparse read. See: https://tracker.ceph.com/issues/54280 Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx> --- fs/ceph/addr.c | 2 +- fs/ceph/file.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 46e0881ae8b2..565cc2197dd1 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -317,7 +317,7 @@ static void ceph_netfs_issue_op(struct netfs_read_subrequest *subreq) return; req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout, vino, subreq->start, &len, - 0, 1, CEPH_OSD_OP_READ, + 0, 1, CEPH_OSD_OP_SPARSE_READ, CEPH_OSD_FLAG_READ | fsc->client->osdc.client->options->read_from_replica, NULL, ci->i_truncate_seq, ci->i_truncate_size, false); if (IS_ERR(req)) { diff --git a/fs/ceph/file.c b/fs/ceph/file.c index feb75eb1cd82..d1956a20c627 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -934,7 +934,7 @@ static ssize_t ceph_sync_read(struct kiocb *iocb, struct iov_iter *to, req = ceph_osdc_new_request(osdc, &ci->i_layout, ci->i_vino, off, &len, 0, 1, - CEPH_OSD_OP_READ, CEPH_OSD_FLAG_READ, + CEPH_OSD_OP_SPARSE_READ, CEPH_OSD_FLAG_READ, NULL, ci->i_truncate_seq, ci->i_truncate_size, false); if (IS_ERR(req)) { @@ -1291,7 +1291,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, vino, pos, &size, 0, 1, write ? CEPH_OSD_OP_WRITE : - CEPH_OSD_OP_READ, + CEPH_OSD_OP_SPARSE_READ, flags, snapc, ci->i_truncate_seq, ci->i_truncate_size, -- 2.34.1