lkml.org 
[lkml]   [2022]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 20/20] erofs: support on-demand reading
Date
Implement the .issue_op() callback, and all work is done by
netfs_ondemand_read().

Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
---
fs/erofs/fscache.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
index e8df35ee4ba8..9ba668c42098 100644
--- a/fs/erofs/fscache.c
+++ b/fs/erofs/fscache.c
@@ -28,9 +28,15 @@ static void erofs_noop_cleanup(struct address_space *mapping, void *netfs_priv)
{
}

+static void erofs_issue_op(struct netfs_read_subrequest *subreq)
+{
+ netfs_ondemand_read(subreq);
+}
+
static const struct netfs_read_request_ops erofs_blob_req_ops = {
.begin_cache_operation = erofs_blob_begin_cache_operation,
.cleanup = erofs_noop_cleanup,
+ .issue_op = erofs_issue_op,
};

static int erofs_begin_cache_operation(struct netfs_read_request *rreq)
@@ -58,6 +64,7 @@ static const struct netfs_read_request_ops erofs_req_ops = {
.begin_cache_operation = erofs_begin_cache_operation,
.cleanup = erofs_noop_cleanup,
.clamp_length = erofs_clamp_length,
+ .issue_op = erofs_issue_op,
};

static int erofs_fscache_blob_readpage(struct file *data, struct page *page)
--
2.27.0
\
 
 \ /
  Last update: 2022-01-18 14:13    [W:0.215 / U:0.920 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site