diff options
author | Jeffle Xu <jefflexu@linux.alibaba.com> | 2021-12-28 13:44:19 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2022-01-21 22:36:28 +0100 |
commit | cef0223191452b3c493a1070baad9ffe806babac (patch) | |
tree | 9b9564268738c32273f3654c1a2364cc04dc21e5 /fs/netfs | |
parent | fscache: Add a comment explaining how page-release optimisation works (diff) | |
download | linux-cef0223191452b3c493a1070baad9ffe806babac.tar.xz linux-cef0223191452b3c493a1070baad9ffe806babac.zip |
netfs: Make ops->init_rreq() optional
Make the ops->init_rreq() callback optional. This isn't required for the
erofs changes I'm implementing to do on-demand read through fscache[1].
Further, ceph has an empty init_rreq method that can then be removed and
it's marked optional in the documentation.
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/20211227125444.21187-1-jefflexu@linux.alibaba.com/ [1]
Link: https://lore.kernel.org/r/20211228124419.103020-1-jefflexu@linux.alibaba.com
Link: https://lore.kernel.org/r/164251410387.3435901.2504600788262093313.stgit@warthog.procyon.org.uk/ # v1
Diffstat (limited to 'fs/netfs')
-rw-r--r-- | fs/netfs/read_helper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c index 6169659857b3..501da990c259 100644 --- a/fs/netfs/read_helper.c +++ b/fs/netfs/read_helper.c @@ -55,7 +55,8 @@ static struct netfs_read_request *netfs_alloc_read_request( INIT_WORK(&rreq->work, netfs_rreq_work); refcount_set(&rreq->usage, 1); __set_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags); - ops->init_rreq(rreq, file); + if (ops->init_rreq) + ops->init_rreq(rreq, file); netfs_stat(&netfs_n_rh_rreq); } |