summaryrefslogtreecommitdiff
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-07-01 07:26:53 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2024-07-08 13:47:51 -0400
commitf1b7c7552cbcf89e56b15ff481f3d19b53046291 (patch)
treeb9978d9d78f7a55f9f9a7766ad2f07ccad6c511b /fs/nfs/write.c
parent25edbcac6e32eab345e470d56ca9974a577b878b (diff)
nfs: move nfs_wait_on_request to write.c
nfs_wait_on_request is now only used in write.c. Move it there and mark it static. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 0fe9d7bf34db..089c242efac0 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -478,6 +478,23 @@ void nfs_join_page_group(struct nfs_page *head, struct nfs_commit_info *cinfo,
nfs_destroy_unlinked_subrequests(destroy_list, head, inode);
}
+/**
+ * nfs_wait_on_request - Wait for a request to complete.
+ * @req: request to wait upon.
+ *
+ * Interruptible by fatal signals only.
+ * The user is responsible for holding a count on the request.
+ */
+static int nfs_wait_on_request(struct nfs_page *req)
+{
+ if (!test_bit(PG_BUSY, &req->wb_flags))
+ return 0;
+ set_bit(PG_CONTENDED2, &req->wb_flags);
+ smp_mb__after_atomic();
+ return wait_on_bit_io(&req->wb_flags, PG_BUSY,
+ TASK_UNINTERRUPTIBLE);
+}
+
/*
* nfs_unroll_locks - unlock all newly locked reqs and wait on @req
* @head: head request of page group, must be holding head lock