[PATCH 12/19] netfs: Prepare to split read_helper.c

From: David Howells
Date: Wed Mar 02 2022 - 09:08:11 EST


Prepare to split read_helper.c by removing some 'static' markers and
declaring those functions in internal.h.

Rename netfs_rreq_unlock() to netfs_rreq_unlock_folios() to make it sound
less like it's dropping a lock on an netfs_io_request struct.

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
cc: linux-cachefs@xxxxxxxxxx
---

fs/netfs/internal.h | 8 ++++++++
fs/netfs/read_helper.c | 10 +++++-----
2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h
index ee2f64cde221..3970528955be 100644
--- a/fs/netfs/internal.h
+++ b/fs/netfs/internal.h
@@ -15,6 +15,11 @@

#define pr_fmt(fmt) "netfs: " fmt

+/*
+ * buffered_read.c
+ */
+void netfs_rreq_unlock_folios(struct netfs_io_request *rreq);
+
/*
* objects.c
*/
@@ -40,6 +45,9 @@ static inline void netfs_see_request(struct netfs_io_request *rreq,
extern unsigned int netfs_debug;

void netfs_rreq_work(struct work_struct *work);
+void netfs_rreq_assess(struct netfs_io_request *rreq, bool was_async);
+bool netfs_rreq_submit_slice(struct netfs_io_request *rreq,
+ unsigned int *_debug_index);

/*
* stats.c
diff --git a/fs/netfs/read_helper.c b/fs/netfs/read_helper.c
index c953a573b6b6..e666f9cccc95 100644
--- a/fs/netfs/read_helper.c
+++ b/fs/netfs/read_helper.c
@@ -250,7 +250,7 @@ static void netfs_rreq_write_to_cache(struct netfs_io_request *rreq)
* Unlock the folios in a read operation. We need to set PG_fscache on any
* folios we're going to write back before we unlock them.
*/
-static void netfs_rreq_unlock(struct netfs_io_request *rreq)
+void netfs_rreq_unlock_folios(struct netfs_io_request *rreq)
{
struct netfs_io_subrequest *subreq;
struct folio *folio;
@@ -418,7 +418,7 @@ static void netfs_rreq_is_still_valid(struct netfs_io_request *rreq)
* Note that we could be in an ordinary kernel thread, on a workqueue or in
* softirq context at this point. We inherit a ref from the caller.
*/
-static void netfs_rreq_assess(struct netfs_io_request *rreq, bool was_async)
+void netfs_rreq_assess(struct netfs_io_request *rreq, bool was_async)
{
trace_netfs_rreq(rreq, netfs_rreq_trace_assess);

@@ -432,7 +432,7 @@ static void netfs_rreq_assess(struct netfs_io_request *rreq, bool was_async)
return;
}

- netfs_rreq_unlock(rreq);
+ netfs_rreq_unlock_folios(rreq);

clear_bit_unlock(NETFS_RREQ_IN_PROGRESS, &rreq->flags);
wake_up_bit(&rreq->flags, NETFS_RREQ_IN_PROGRESS);
@@ -632,8 +632,8 @@ netfs_rreq_prepare_read(struct netfs_io_request *rreq,
/*
* Slice off a piece of a read request and submit an I/O request for it.
*/
-static bool netfs_rreq_submit_slice(struct netfs_io_request *rreq,
- unsigned int *_debug_index)
+bool netfs_rreq_submit_slice(struct netfs_io_request *rreq,
+ unsigned int *_debug_index)
{
struct netfs_io_subrequest *subreq;
enum netfs_io_source source;