Skip to content

Commit f1b7c75

Browse files
Christoph Hellwigamschuma-ntap
authored andcommitted
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 <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 25edbca commit f1b7c75

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

fs/nfs/pagelist.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -598,25 +598,6 @@ void nfs_release_request(struct nfs_page *req)
598598
}
599599
EXPORT_SYMBOL_GPL(nfs_release_request);
600600

601-
/**
602-
* nfs_wait_on_request - Wait for a request to complete.
603-
* @req: request to wait upon.
604-
*
605-
* Interruptible by fatal signals only.
606-
* The user is responsible for holding a count on the request.
607-
*/
608-
int
609-
nfs_wait_on_request(struct nfs_page *req)
610-
{
611-
if (!test_bit(PG_BUSY, &req->wb_flags))
612-
return 0;
613-
set_bit(PG_CONTENDED2, &req->wb_flags);
614-
smp_mb__after_atomic();
615-
return wait_on_bit_io(&req->wb_flags, PG_BUSY,
616-
TASK_UNINTERRUPTIBLE);
617-
}
618-
EXPORT_SYMBOL_GPL(nfs_wait_on_request);
619-
620601
/*
621602
* nfs_generic_pg_test - determine if requests can be coalesced
622603
* @desc: pointer to descriptor

fs/nfs/write.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,23 @@ void nfs_join_page_group(struct nfs_page *head, struct nfs_commit_info *cinfo,
478478
nfs_destroy_unlinked_subrequests(destroy_list, head, inode);
479479
}
480480

481+
/**
482+
* nfs_wait_on_request - Wait for a request to complete.
483+
* @req: request to wait upon.
484+
*
485+
* Interruptible by fatal signals only.
486+
* The user is responsible for holding a count on the request.
487+
*/
488+
static int nfs_wait_on_request(struct nfs_page *req)
489+
{
490+
if (!test_bit(PG_BUSY, &req->wb_flags))
491+
return 0;
492+
set_bit(PG_CONTENDED2, &req->wb_flags);
493+
smp_mb__after_atomic();
494+
return wait_on_bit_io(&req->wb_flags, PG_BUSY,
495+
TASK_UNINTERRUPTIBLE);
496+
}
497+
481498
/*
482499
* nfs_unroll_locks - unlock all newly locked reqs and wait on @req
483500
* @head: head request of page group, must be holding head lock

include/linux/nfs_page.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
152152
extern size_t nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
153153
struct nfs_page *prev,
154154
struct nfs_page *req);
155-
extern int nfs_wait_on_request(struct nfs_page *);
156155
extern void nfs_unlock_request(struct nfs_page *req);
157156
extern void nfs_unlock_and_release_request(struct nfs_page *);
158157
extern void nfs_join_page_group(struct nfs_page *head,

0 commit comments

Comments
 (0)