@@ -360,6 +360,7 @@ static int afs_symlink_read_folio(struct file *file, struct folio *folio)
static int afs_init_request(struct netfs_io_request *rreq, struct file *file)
{
rreq->netfs_priv = key_get(afs_file_key(file));
+ rreq->rsize = 4 * 1024 * 1024;
return 0;
}
@@ -419,6 +419,8 @@ static int ceph_init_request(struct netfs_io_request *rreq, struct file *file)
struct ceph_netfs_request_data *priv;
int ret = 0;
+ rreq->rsize = 1024 * 1024;
+
if (rreq->origin != NETFS_READAHEAD)
return 0;
@@ -188,6 +188,7 @@ struct netfs_io_request {
struct list_head subrequests; /* Contributory I/O operations */
void *netfs_priv; /* Private data for the netfs */
unsigned int debug_id;
+ unsigned int rsize; /* Maximum read size (0 for none) */
atomic_t nr_outstanding; /* Number of ops in progress */
atomic_t nr_copy_ops; /* Number of copy-to-cache ops in progress */
size_t submitted; /* Amount submitted for I/O so far */
Add an rsize parameter to netfs_io_request to be filled in by the network filesystem when the request is initialised. This indicates the maximum size of a read request that the netfs will honour in that region. Signed-off-by: David Howells <dhowells@redhat.com> cc: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com cc: linux-fsdevel@vger.kernel.org cc: linux-mm@kvack.org --- fs/afs/file.c | 1 + fs/ceph/addr.c | 2 ++ include/linux/netfs.h | 1 + 3 files changed, 4 insertions(+)